Skip to content

It seems to be impossible to document functions that are attached to a certain property #96

@FrankenApps

Description

@FrankenApps

I would like to fix this Issue.

Especially I would like to document the view.webContents.destroy() method so that I can use it from typescript without having to do shenangians like (view.webContents as any).destroy().

To make it work, normally all that would be required is the change from

    /**
     * A `WebContents` object owned by this view.
     *
     * @experimental
     */
    webContents: WebContents;

to

    /**
     * A `WebContents` object owned by this view.
     *
     * @experimental
     */
    webContents: WebContents & {
      /**
       * Destroys the `WebContents` of the associated `BrowserView`.
       *
       * @experimental
       */
      destroy(): void;
    };

in the typescript definition of the BrowserView class.

However because the typescript defintions are auto-generated form the JSON API file retrieved by parsing the documentation, it seems to me that it is impossible at the moment to make that improvement.

What would be the best option to make such edge cases work? Do we need to extend the parser and the defintions generator and then adjust the documentation somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions