diff --git a/index.d.ts b/index.d.ts index ac48a0e1..571c2aba 100644 --- a/index.d.ts +++ b/index.d.ts @@ -45,6 +45,7 @@ interface Props { } declare class Pdf extends React.Component { + setPage: (pageNumber: number) => void; } export default Pdf; diff --git a/index.js b/index.js index 5cc9f192..edd49e82 100644 --- a/index.js +++ b/index.js @@ -375,9 +375,9 @@ export default class Pdf extends Component { } else if (message[0] === 'error') { this._onError(new Error(message[1])); } else if (message[0] === 'pageSingleTap') { - this.props.onPageSingleTap && this.props.onPageSingleTap(message[1], message[2], message[3]); + this.props.onPageSingleTap && this.props.onPageSingleTap(Number(message[1]), Number(message[2]), Number(message[3])); } else if (message[0] === 'scaleChanged') { - this.props.onScaleChanged && this.props.onScaleChanged(message[1]); + this.props.onScaleChanged && this.props.onScaleChanged(Number(message[1])); } else if (message[0] === 'linkPressed') { this.props.onPressLink && this.props.onPressLink(message[1]); } diff --git a/index.js.flow b/index.js.flow index 1957e5f3..148edcd8 100644 --- a/index.js.flow +++ b/index.js.flow @@ -58,4 +58,6 @@ export type Props = { testID?: string }; -declare export default class Pdf extends Component {} +declare export default class Pdf extends Component { + setPage: (pageNumber: number) => void; +}