Skip to content

Commit

Permalink
Merge pull request #506 from mateusz1913/fix/incorrect-args-types
Browse files Browse the repository at this point in the history
Fix/incorrect args types
  • Loading branch information
wonday authored Sep 24, 2020
2 parents 5a691a2 + cc2bcb0 commit dd966fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface Props {
}

declare class Pdf extends React.Component<Props, any> {
setPage: (pageNumber: number) => void;
}

export default Pdf;
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
4 changes: 3 additions & 1 deletion index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ export type Props = {
testID?: string
};

declare export default class Pdf extends Component<Props> {}
declare export default class Pdf extends Component<Props> {
setPage: (pageNumber: number) => void;
}

0 comments on commit dd966fc

Please sign in to comment.