From 98de57c1d25f61b29f1e522e6cae8e1cf35b1c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20M=C4=99drek?= Date: Wed, 23 Sep 2020 18:53:39 +0200 Subject: [PATCH 1/2] fix: fixed incorrect type of onPageSingleTap and onScaleChanged arguments --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]); } From cc2bcb0cef5e59bd3c10d54893d579f940032b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20M=C4=99drek?= Date: Wed, 23 Sep 2020 18:55:47 +0200 Subject: [PATCH 2/2] fix(types): included missing setPage method in TypeScript and Flow types --- index.d.ts | 1 + index.js.flow | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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.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; +}