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:
Sergei Butko 2019-03-21 16:29:57 +02:00 committed by Thibault Malbranche
parent c32f947362
commit 54268ff469
1 changed files with 33 additions and 3 deletions

36
index.d.ts vendored
View File

@ -1,8 +1,38 @@
import { ComponentType } from 'react';
import { Component } from 'react';
// eslint-disable-next-line
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;