Skip to content

Conversation

MarshallOfSound
Copy link
Member

This adds support for the new event type blocks that electron/docs-parser#80 generates. Specifically...

Inline Events
{
  "name": "event",
  "description": "",
  "collection": false,
  "type": "Event",
  "eventProperties": [
    {
      "name": "url",
      "description": "The URL the frame is navigating to.",
      "required": true,
      "additionalTags": [],
      "collection": false,
      "type": "String",
      "possibleValues": null
    },
    {
      "name": "isSameDocument",
      "description": "Whether the navigation happened without changing document. Examples of same document navigations are reference fragment navigations, pushState/replaceState, and same page history navigation.",
      "required": true,
      "additionalTags": [],
      "collection": false,
      "type": "boolean"
    },
    {
      "name": "isMainFrame",
      "description": "True if the navigation is taking place in a main frame.",
      "required": true,
      "additionalTags": [],
      "collection": false,
      "type": "boolean"
    },
    {
      "name": "frame",
      "description": "The frame to be navigated.",
      "required": true,
      "additionalTags": [],
      "collection": false,
      "type": "WebFrameMain"
    },
    {
      "name": "initiator",
      "description": "The frame which initiated the navigation, which can be a parent frame (e.g. via `window.open` with a frame's name), or null if the navigation was not initiated by a frame. This can also be null if the initiating frame was deleted before the event was emitted.",
      "required": false,
      "additionalTags": [],
      "collection": false,
      "type": "WebFrameMain"
    }
  ],
  "additionalTags": [],
  "required": true
},
Structure Referenced Events
{
  "name": "event",
  "description": "",
  "collection": false,
  "type": "Event",
  "eventPropertiesReference": {
    "collection": false,
    "type": "NavigationEventParams"
  },
  "additionalTags": [],
  "required": true
},

This is a pretty hefty change under the hood and it contains some other subtle fixes that will become more apparent in the archeologist output when this is landed into electron/electron.

  • Things with empty comments but "deprecated" tags will now actually generate a tag comment.
  • Electron.Event no longer incorrectly extends the DOM Event object. It instead accurately defines itself as an isolated type.
  • DOM Element events (e.g. webview) still extend DOMEvent correctly
  • sender on Event is now typed correctly depending on the object emitting the event
  • menu is flagged as an event emitter correctly
  • function properties of structures are now fully typed instead of being loose Function types

@MarshallOfSound MarshallOfSound requested review from a team as code owners February 1, 2023 09:02
@MarshallOfSound MarshallOfSound merged commit 765bbb1 into main Feb 2, 2023
@MarshallOfSound MarshallOfSound deleted the event-handling branch February 2, 2023 00:59
@continuous-auth
Copy link

🎉 This PR is included in version 8.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants