diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 000000000..86858ac53 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,26 @@ +declare module 'rn-pdf-reader-js' { + import { Component } from "react"; + import { StyleProp, ViewStyle, NavState } from 'react-native'; + + interface IProps { + source: { + uri?: string, + base64?: string + }, + style?: StyleProp, + webviewStyle?: StyleProp, + onLoad?: (event: NavState) => void, + noLoader?: boolean + } + + interface IState { + ready: boolean, + android: boolean, + ios: boolean, + data?: string, + } + + export function removeFilesAsync(): Promise; + + export default class PdfReader extends Component {} +} diff --git a/package.json b/package.json index 6fadb6548..7ab0870ba 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.3.0", "description": "PDF reader for Expo", "main": "index.js", + "types": "index.d.ts", "author": "Xavier Carpentier (https://xaviercarpentier.com/)", "license": "MIT", "scripts": {