• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/// <reference path='./import.ts' />
17class ArkWebComponent extends ArkComponent implements WebAttribute {
18  constructor(nativePtr: KNode, classType?: ModifierType) {
19    super(nativePtr, classType);
20  }
21  javaScriptAccess(javaScriptAccess: boolean): this {
22    throw new Error('Method not implemented.');
23  }
24  fileAccess(fileAccess: boolean): this {
25    throw new Error('Method not implemented.');
26  }
27  onlineImageAccess(onlineImageAccess: boolean): this {
28    throw new Error('Method not implemented.');
29  }
30  domStorageAccess(domStorageAccess: boolean): this {
31    throw new Error('Method not implemented.');
32  }
33  imageAccess(imageAccess: boolean): this {
34    throw new Error('Method not implemented.');
35  }
36  mixedMode(mixedMode: MixedMode): this {
37    throw new Error('Method not implemented.');
38  }
39  zoomAccess(zoomAccess: boolean): this {
40    throw new Error('Method not implemented.');
41  }
42  geolocationAccess(geolocationAccess: boolean): this {
43    throw new Error('Method not implemented.');
44  }
45  javaScriptProxy(javaScriptProxy: { object: object; name: string; methodList: string[]; controller: any; }): this {
46    throw new Error('Method not implemented.');
47  }
48  password(password: boolean): this {
49    throw new Error('Method not implemented.');
50  }
51  cacheMode(cacheMode: CacheMode): this {
52    throw new Error('Method not implemented.');
53  }
54  darkMode(mode: WebDarkMode): this {
55    throw new Error('Method not implemented.');
56  }
57  forceDarkAccess(access: boolean): this {
58    throw new Error('Method not implemented.');
59  }
60  mediaOptions(options: WebMediaOptions): this {
61    throw new Error('Method not implemented.');
62  }
63  tableData(tableData: boolean): this {
64    throw new Error('Method not implemented.');
65  }
66  wideViewModeAccess(wideViewModeAccess: boolean): this {
67    throw new Error('Method not implemented.');
68  }
69  overviewModeAccess(overviewModeAccess: boolean): this {
70    throw new Error('Method not implemented.');
71  }
72  overScrollMode(mode: OverScrollMode): this {
73    throw new Error('Method not implemented.');
74  }
75  textZoomAtio(textZoomAtio: number): this {
76    throw new Error('Method not implemented.');
77  }
78  textZoomRatio(textZoomRatio: number): this {
79    throw new Error('Method not implemented.');
80  }
81  databaseAccess(databaseAccess: boolean): this {
82    throw new Error('Method not implemented.');
83  }
84  initialScale(percent: number): this {
85    throw new Error('Method not implemented.');
86  }
87  userAgent(userAgent: string): this {
88    throw new Error('Method not implemented.');
89  }
90  onPageEnd(callback: (event?: { url: string; } | undefined) => void): this {
91    throw new Error('Method not implemented.');
92  }
93  onPageBegin(callback: (event?: { url: string; } | undefined) => void): this {
94    throw new Error('Method not implemented.');
95  }
96  onProgressChange(callback: (event?: { newProgress: number; } | undefined) => void): this {
97    throw new Error('Method not implemented.');
98  }
99  onTitleReceive(callback: (event?: { title: string; } | undefined) => void): this {
100    throw new Error('Method not implemented.');
101  }
102  onGeolocationHide(callback: () => void): this {
103    throw new Error('Method not implemented.');
104  }
105  onGeolocationShow(callback: (event?: { origin: string; geolocation: JsGeolocation; } | undefined) => void): this {
106    throw new Error('Method not implemented.');
107  }
108  onRequestSelected(callback: () => void): this {
109    throw new Error('Method not implemented.');
110  }
111  onAlert(callback: (event?: { url: string; message: string; result: JsResult; } | undefined) => boolean): this {
112    throw new Error('Method not implemented.');
113  }
114  onBeforeUnload(callback: (event?: { url: string; message: string; result: JsResult; } | undefined) => boolean): this {
115    throw new Error('Method not implemented.');
116  }
117  onConfirm(callback: (event?: { url: string; message: string; result: JsResult; } | undefined) => boolean): this {
118    throw new Error('Method not implemented.');
119  }
120  onPrompt(callback: (event?: { url: string; message: string; value: string; result: JsResult; } | undefined) => boolean): this {
121    throw new Error('Method not implemented.');
122  }
123  onConsole(callback: (event?: { message: ConsoleMessage; } | undefined) => boolean): this {
124    throw new Error('Method not implemented.');
125  }
126  onErrorReceive(callback: (event?: { request: WebResourceRequest; error: WebResourceError; } | undefined) => void): this {
127    throw new Error('Method not implemented.');
128  }
129  onHttpErrorReceive(callback: (event?: { request: WebResourceRequest; response: WebResourceResponse; } | undefined) => void): this {
130    throw new Error('Method not implemented.');
131  }
132  onDownloadStart(callback: (event?: {
133    url: string;
134    userAgent: string; contentDisposition: string;
135    mimetype: string; contentLength: number;
136  } | undefined) => void): this {
137    throw new Error('Method not implemented.');
138  }
139  onRefreshAccessedHistory(callback: (event?: { url: string; isRefreshed: boolean; } | undefined) => void): this {
140    throw new Error('Method not implemented.');
141  }
142  onUrlLoadIntercept(callback: (event?: { data: string | WebResourceRequest; } | undefined) => boolean): this {
143    throw new Error('Method not implemented.');
144  }
145  onSslErrorReceive(callback: (event?: { handler: Function; error: object; } | undefined) => void): this {
146    throw new Error('Method not implemented.');
147  }
148  onRenderExited(callback: (event?: { renderExitReason: RenderExitReason; } | undefined) => void): this;
149  onRenderExited(callback: (event?: { detail: object; } | undefined) => boolean): this;
150  onRenderExited(callback: unknown): this {
151    throw new Error('Method not implemented.');
152  }
153  onShowFileSelector(callback: (event?: { result: FileSelectorResult; fileSelector: FileSelectorParam; } | undefined) => boolean): this {
154    throw new Error('Method not implemented.');
155  }
156  onFileSelectorShow(callback: (event?: { callback: Function; fileSelector: object; } | undefined) => void): this {
157    throw new Error('Method not implemented.');
158  }
159  onResourceLoad(callback: (event: { url: string; }) => void): this {
160    throw new Error('Method not implemented.');
161  }
162  onFullScreenExit(callback: () => void): this {
163    throw new Error('Method not implemented.');
164  }
165  onFullScreenEnter(callback: (event: { handler: FullScreenExitHandler; }) => void): this {
166    throw new Error('Method not implemented.');
167  }
168  onScaleChange(callback: (event: { oldScale: number; newScale: number; }) => void): this {
169    throw new Error('Method not implemented.');
170  }
171  onHttpAuthRequest(callback: (event?: { handler: HttpAuthHandler; host: string; realm: string; } | undefined) => boolean): this {
172    throw new Error('Method not implemented.');
173  }
174  onInterceptRequest(callback: (event?: { request: WebResourceRequest; } | undefined) => WebResourceResponse): this {
175    throw new Error('Method not implemented.');
176  }
177  onPermissionRequest(callback: (event?: { request: PermissionRequest; } | undefined) => void): this {
178    throw new Error('Method not implemented.');
179  }
180  onScreenCaptureRequest(callback: (event?: { handler: ScreenCaptureHandler; } | undefined) => void): this {
181    throw new Error('Method not implemented.');
182  }
183  onContextMenuShow(callback: (event?: { param: WebContextMenuParam; result: WebContextMenuResult; } | undefined) => boolean): this {
184    throw new Error('Method not implemented.');
185  }
186  mediaPlayGestureAccess(access: boolean): this {
187    throw new Error('Method not implemented.');
188  }
189  onSearchResultReceive(callback: (event?: { activeMatchOrdinal: number; numberOfMatches: number; isDoneCounting: boolean; } | undefined) => void): this {
190    throw new Error('Method not implemented.');
191  }
192  onScroll(callback: (event: { xOffset: number; yOffset: number; }) => void): this {
193    throw new Error('Method not implemented.');
194  }
195  onSslErrorEventReceive(callback: (event: { handler: SslErrorHandler; error: SslError; }) => void): this {
196    throw new Error('Method not implemented.');
197  }
198  onSslErrorEvent(callback: (event: { handler: SslErrorHandler; error: SslError; url: string;
199    originalUrl: string; referrer: string; isFatalError: boolean; isMainFrame: boolean; }) => void): this {
200    throw new Error('Method not implemented.');
201  }
202  onClientAuthenticationRequest(callback: (event: {
203    handler: ClientAuthenticationHandler;
204    host: string; port: number; keyTypes: string[]; issuers: string[];
205  }) => void): this {
206    throw new Error('Method not implemented.');
207  }
208  onWindowNew(callback: (event: { isAlert: boolean; isUserTrigger: boolean; targetUrl: string; handler: ControllerHandler; }) => void): this {
209    throw new Error('Method not implemented.');
210  }
211  onWindowExit(callback: () => void): this {
212    throw new Error('Method not implemented.');
213  }
214  multiWindowAccess(multiWindow: boolean): this {
215    throw new Error('Method not implemented.');
216  }
217  onInterceptKeyEvent(callback: (event: KeyEvent) => boolean): this {
218    throw new Error('Method not implemented.');
219  }
220  webStandardFont(family: string): this {
221    throw new Error('Method not implemented.');
222  }
223  webSerifFont(family: string): this {
224    throw new Error('Method not implemented.');
225  }
226  webSansSerifFont(family: string): this {
227    throw new Error('Method not implemented.');
228  }
229  webFixedFont(family: string): this {
230    throw new Error('Method not implemented.');
231  }
232  webFantasyFont(family: string): this {
233    throw new Error('Method not implemented.');
234  }
235  webCursiveFont(family: string): this {
236    throw new Error('Method not implemented.');
237  }
238  defaultFixedFontSize(size: number): this {
239    throw new Error('Method not implemented.');
240  }
241  defaultFontSize(size: number): this {
242    throw new Error('Method not implemented.');
243  }
244  minFontSize(size: number): this {
245    throw new Error('Method not implemented.');
246  }
247  minLogicalFontSize(size: number): this {
248    throw new Error('Method not implemented.');
249  }
250  blockNetwork(block: boolean): this {
251    throw new Error('Method not implemented.');
252  }
253  horizontalScrollBarAccess(horizontalScrollBar: boolean): this {
254    throw new Error('Method not implemented.');
255  }
256  verticalScrollBarAccess(verticalScrollBar: boolean): this {
257    throw new Error('Method not implemented.');
258  }
259  onTouchIconUrlReceived(callback: (event: { url: string; precomposed: boolean; }) => void): this {
260    throw new Error('Method not implemented.');
261  }
262  onFaviconReceived(callback: (event: { favicon: any; }) => void): this {
263    throw new Error('Method not implemented.');
264  }
265  onPageVisible(callback: (event: { url: string; }) => void): this {
266    throw new Error('Method not implemented.');
267  }
268  onDataResubmitted(callback: (event: { handler: DataResubmissionHandler; }) => void): this {
269    throw new Error('Method not implemented.');
270  }
271  pinchSmooth(isEnabled: boolean): this {
272    throw new Error('Method not implemented.');
273  }
274  allowWindowOpenMethod(flag: boolean): this {
275    throw new Error('Method not implemented.');
276  }
277  onAudioStateChanged(callback: (event: { playing: boolean; }) => void): this {
278    throw new Error('Method not implemented.');
279  }
280  onFirstContentfulPaint(callback: (event?: { navigationStartTick: number; firstContentfulPaintMs: number; } | undefined) => void): this {
281    throw new Error('Method not implemented.');
282  }
283  onLoadIntercept(callback: (event: { data: WebResourceRequest; }) => boolean): this {
284    throw new Error('Method not implemented.');
285  }
286  onControllerAttached(callback: () => void): this {
287    throw new Error('Method not implemented.');
288  }
289  onOverScroll(callback: (event: { xOffset: number; yOffset: number; }) => void): this {
290    throw new Error('Method not implemented.');
291  }
292  javaScriptOnDocumentStart(scripts: ScriptItem[]): this {
293    throw new Error('Method not implemented.');
294  }
295  layoutMode(mode: WebLayoutMode): this {
296    throw new Error('Method not implemented.');
297  }
298  nestedScroll(value: NestedScrollOptions): this {
299    throw new Error('Method not implemented.');
300  }
301  onOverrideUrlLoading(callback: OnOverrideUrlLoadingCallback): this {
302    throw new Error('Method not implemented.');
303  }
304  enableNativeMediaPlayer(config: NativeMediaPlayerConfig): this {
305    throw new Error('Method not implemented.');
306  }
307  onRenderProcessNotResponding(callback: OnRenderProcessNotRespondingCallback): this {
308    throw new Error('Method not implemented.');
309  }
310  onRenderProcessResponding(callback: OnRenderProcessRespondingCallback): this {
311    throw new Error('Method not implemented.');
312  }
313  onViewportFitChanged(callback: OnViewportFitChangedCallback): this {
314    throw new Error('Method not implemented.');
315  }
316  onAdsBlockedBlock(callback: (details: { url: string; adsBlocked: string[]; } | undefined) => void): this {
317    throw new Error('Method not implemented.');
318  }
319}
320
321// @ts-ignore
322globalThis.Web.attributeModifier = function (modifier: ArkComponent): void {
323  attributeModifierFunc.call(this, modifier, (nativePtr: KNode) => {
324    return new ArkWebComponent(nativePtr);
325  }, (nativePtr: KNode, classType: ModifierType, modifierJS: ModifierJS) => {
326    return new modifierJS.CommonModifier(nativePtr, classType);
327  });
328};
329