We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 282f289 commit 3e3521eCopy full SHA for 3e3521e
__tests__/typescript/index.test.ts
@@ -63,3 +63,13 @@ DocumentPicker.pickMultiple({
63
DocumentPicker.pickMultiple({
64
type: [DocumentPicker.types.video,DocumentPicker.types.pdf, 'public.audio']
65
})
66
+
67
+try {
68
+ throw new Error('test')
69
+} catch (e) {
70
+ if(DocumentPicker.isCancel(e)){
71
72
+ } else {
73
74
+ }
75
+}
index.d.ts
@@ -49,6 +49,6 @@ declare module 'react-native-document-picker' {
49
static pickMultiple<OS extends keyof PlatformTypes = Platform>(
50
options: DocumentPickerOptions<OS>
51
): Promise<DocumentPickerResponse>;
52
- static isCancel(err: any): void;
+ static isCancel<IError extends {code?: string}>(err?: IError): boolean;
53
}
54
0 commit comments