mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: downstream types and arg-passing
This commit is contained in:
7
packages/core/ui/web-view/index.d.ts
vendored
7
packages/core/ui/web-view/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user