fix: downstream types and arg-passing

This commit is contained in:
shirakaba
2022-11-23 12:24:08 +09:00
parent 453adef5fa
commit 3dad494136
28 changed files with 144 additions and 127 deletions

View File

@@ -91,18 +91,19 @@ export class WebView extends View {
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
* @param callback - Callback function which will be executed when event is raised.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
* @param options An optional parameter. If passed as a boolean, configures the useCapture value. Otherwise, specifies options.
*/
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
/**
* Raised when a loadFinished event occurs.
*/
on(event: 'loadFinished', callback: (args: LoadEventData) => void, thisArg?: any);
on(event: 'loadFinished', callback: (args: LoadEventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
/**
* Raised when a loadStarted event occurs.
*/
on(event: 'loadStarted', callback: (args: LoadEventData) => void, thisArg?: any);
on(event: 'loadStarted', callback: (args: LoadEventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
}
/**

View File

@@ -101,9 +101,9 @@ export abstract class WebViewBase extends ContainerView {
// HACK: We declare all these 'on' statements, so that they can appear in the API reference
// HACK: Do we need this? Is it useful? There are static fields to the WebViewBase class for the event names.
export interface WebViewBase {
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
on(event: 'loadFinished', callback: (args: LoadEventData) => void, thisArg?: any): void;
on(event: 'loadStarted', callback: (args: LoadEventData) => void, thisArg?: any): void;
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
on(event: 'loadFinished', callback: (args: LoadEventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
on(event: 'loadStarted', callback: (args: LoadEventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
}
srcProperty.register(WebViewBase);