Skip to content

Commit

Permalink
Feat/types (#64)
Browse files Browse the repository at this point in the history
* Added typings for rn-pdf-reader-js

* Added types property in package.json
  • Loading branch information
azuy212 authored and xcarpentier committed Aug 8, 2019
1 parent 8ffac1b commit 6f6afd1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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<ViewStyle>,
webviewStyle?: StyleProp<ViewStyle>,
onLoad?: (event: NavState) => void,
noLoader?: boolean
}

interface IState {
ready: boolean,
android: boolean,
ios: boolean,
data?: string,
}

export function removeFilesAsync(): Promise<void>;

export default class PdfReader extends Component<IProps, IState> {}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.3.0",
"description": "PDF reader for Expo",
"main": "index.js",
"types": "index.d.ts",
"author": "Xavier Carpentier <xcapetir@gmail.com> (https://xaviercarpentier.com/)",
"license": "MIT",
"scripts": {
Expand Down

0 comments on commit 6f6afd1

Please sign in to comment.