-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
web-view.d.ts
114 lines (94 loc) · 3.09 KB
/
web-view.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/**
* Contains the WebView class, which represents a standard browser widget.
* @module "ui/web-view"
*/ /** */
import { View, Property, EventData } from "../core/view";
/**
* Represents the observable property backing the Url property of each WebView instance.
*/
export const urlProperty: Property<WebView, string>;
/**
* Represents navigation type
*/
export type NavigationType = "linkClicked" | "formSubmitted" | "backForward" | "reload" | "formResubmitted" | "other" | undefined;
/**
* Represents a standard WebView widget.
*/
export class WebView extends View {
/**
* String value used when hooking to loadStarted event.
*/
public static loadStartedEvent: string;
/**
* String value used when hooking to loadFinished event.
*/
public static loadFinishedEvent: string;
/**
* Gets the native [android widget](http://developer.android.com/reference/android/webkit/WebView.html) that represents the user interface for this component. Valid only when running on Android OS.
*/
android: any /* android.webkit.WebView */;
/**
* Gets the native [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview/) that represents the user interface for this component. Valid only when running on iOS.
*/
ios: any /* WKWebView */;
/**
* Gets or sets the url, local file path or HTML string.
*/
src: string;
/**
* Gets a value indicating whether the WebView can navigate back.
*/
canGoBack: boolean;
/**
* Gets a value indicating whether the WebView can navigate forward.
*/
canGoForward: boolean;
/**
* Stops loading the current content (if any).
*/
stopLoading(): void;
/**
* Navigates back.
*/
goBack();
/**
* Navigates forward.
*/
goForward();
/**
* Reloads the current url.
*/
reload();
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @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.
*/
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
/**
* Raised when a loadFinished event occurs.
*/
on(event: "loadFinished", callback: (args: LoadEventData) => void, thisArg?: any);
/**
* Raised when a loadStarted event occurs.
*/
on(event: "loadStarted", callback: (args: LoadEventData) => void, thisArg?: any);
}
/**
* Event data containing information for the loading events of a WebView.
*/
export interface LoadEventData extends EventData {
/**
* Gets the url of the web-view.
*/
url: string;
/**
* Gets the navigation type of the web-view.
*/
navigationType: NavigationType;
/**
* Gets the error (if any).
*/
error: string;
}