mirror of
https://github.com/status-im/react-native-webview.git
synced 2025-02-23 09:18:38 +00:00
fix(types): Add missing type definitions of the methods (#442)
Also made the exported component a class (to add methods) and made him extend Component instead of ComponentType.
This commit is contained in:
parent
c32f947362
commit
54268ff469
36
index.d.ts
vendored
36
index.d.ts
vendored
@ -1,8 +1,38 @@
|
|||||||
import { ComponentType } from 'react';
|
import { Component } from 'react';
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
import { IOSWebViewProps, AndroidWebViewProps } from './lib/WebViewTypes';
|
import { IOSWebViewProps, AndroidWebViewProps } from './lib/WebViewTypes';
|
||||||
|
|
||||||
declare const WebView: ComponentType<IOSWebViewProps & AndroidWebViewProps>;
|
class WebView extends Component<IOSWebViewProps & AndroidWebViewProps> {
|
||||||
|
/**
|
||||||
|
* Go back one page in the webview's history.
|
||||||
|
*/
|
||||||
|
goBack: () => void;
|
||||||
|
|
||||||
export { WebView };
|
/**
|
||||||
|
* Go forward one page in the webview's history.
|
||||||
|
*/
|
||||||
|
goForward: () => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reloads the current page.
|
||||||
|
*/
|
||||||
|
reload: () => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop loading the current page.
|
||||||
|
*/
|
||||||
|
stopLoading(): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra Native Component Config.
|
||||||
|
*/
|
||||||
|
extraNativeComponentConfig: () => any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes the JavaScript string.
|
||||||
|
*/
|
||||||
|
injectJavaScript: (script: string) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export {WebView};
|
||||||
export default WebView;
|
export default WebView;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user