Skip to content

Commit 7c51e0d

Browse files
authored
fix: add missing types for text selection (#1005)
1 parent d03d18c commit 7c51e0d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

index.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ export type Source = {
2727
method?: string;
2828
};
2929

30+
export type TextSelectionChangeEvent = {
31+
nativeEvent:
32+
| {
33+
type: 'selectionCleared';
34+
}
35+
| {
36+
type: 'selectionChanged';
37+
text: string;
38+
};
39+
};
40+
3041
export interface PdfProps {
3142
style?: ReactNative.StyleProp<ReactNative.ViewStyle>,
3243
progressContainerStyle?: ReactNative.StyleProp<ReactNative.ViewStyle>,
@@ -47,6 +58,10 @@ export interface PdfProps {
4758
enableRTL?: boolean,
4859
enableAnnotationRendering?: boolean,
4960
enableDoubleTapZoom?: boolean;
61+
/**
62+
* Only works on iOS. Defaults to `true`.
63+
*/
64+
enableTextSelection?: boolean;
5065
/**
5166
* Fit policy. This will adjust the initial zoom of the PDF based on the initial size of the view and the scale factor.
5267
* 0 = fit width
@@ -63,6 +78,7 @@ export interface PdfProps {
6378
onPageSingleTap?: (page: number, x: number, y: number) => void,
6479
onScaleChanged?: (scale: number) => void,
6580
onPressLink?: (url: string) => void,
81+
onTextSelectionChange?: (event: TextSelectionChangeEvent) => void,
6682
}
6783

6884
export interface PdfRef {

0 commit comments

Comments
 (0)