Browse Source

fix(types): Fixing typing. (#167)

so happy to see there is typing in the newest release.
I added back WebViewIOSLoadRequestEvent which also exist in react-native typing and fix startInLoadingState which should be boolean.
KaFai 5 years ago
parent
commit
65bd97219a
1 changed files with 10 additions and 4 deletions
  1. 10
    4
      typings/index.d.ts

+ 10
- 4
typings/index.d.ts View File

9
   readonly canGoForward: boolean;
9
   readonly canGoForward: boolean;
10
 }
10
 }
11
 
11
 
12
+export interface WebViewIOSLoadRequestEvent extends WebViewNativeEvent {
13
+  target: number;
14
+  lockIdentifier: number;
15
+  navigationType: "click" | "formsubmit" | "backforward" | "reload" | "formresubmit" | "other";
16
+}
17
+
12
 export interface WebViewProgressEvent extends WebViewNativeEvent {
18
 export interface WebViewProgressEvent extends WebViewNativeEvent {
13
   readonly progress: number;
19
   readonly progress: number;
14
 }
20
 }
190
    * to stop loading.
196
    * to stop loading.
191
    * @platform ios
197
    * @platform ios
192
    */
198
    */
193
-  onShouldStartLoadWithRequest?: (event: WebViewNativeEvent) => any;
199
+  onShouldStartLoadWithRequest?: (event: WebViewIOSLoadRequestEvent) => any;
194
 
200
 
195
   /**
201
   /**
196
    * Boolean that determines whether HTML5 videos play inline or use the
202
    * Boolean that determines whether HTML5 videos play inline or use the
382
    * Boolean value that forces the `WebView` to show the loading view
388
    * Boolean value that forces the `WebView` to show the loading view
383
    * on the first load.
389
    * on the first load.
384
    */
390
    */
385
-  startInLoadingState?: string;
391
+  startInLoadingState?: boolean;
386
 
392
 
387
   /**
393
   /**
388
    * Set this to provide JavaScript that will be injected into the web page
394
    * Set this to provide JavaScript that will be injected into the web page
429
   public goBack: () => void;
435
   public goBack: () => void;
430
   public reload: () => void;
436
   public reload: () => void;
431
   public stopLoading: () => void;
437
   public stopLoading: () => void;
432
-  public postMessage: (msg: string) => void
433
-  public injectJavaScript: (js: string) => void
438
+  public postMessage: (msg: string) => void;
439
+  public injectJavaScript: (js: string) => void;
434
 }
440
 }