mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-03 08:40:12 +00:00
Merge pull request #22536 from plantain-00/react-native-document-picker
add types of react-native-document-picker
This commit is contained in:
28
types/react-native-document-picker/index.d.ts
vendored
Normal file
28
types/react-native-document-picker/index.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// Type definitions for react-native-document-picker 2.0
|
||||
// Project: https://github.com/Elyx0/react-native-document-picker
|
||||
// Definitions by: Jacob Baskin <https://github.com/plantain-00>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export const DocumentPicker: {
|
||||
show(options: Options, callback: (error: Error, result: Result) => void): void;
|
||||
};
|
||||
|
||||
export const DocumentPickerUtil: {
|
||||
allFiles(): string;
|
||||
pdf(): string;
|
||||
audio(): string;
|
||||
plainText(): string;
|
||||
};
|
||||
|
||||
export interface Options {
|
||||
top?: number;
|
||||
left?: number;
|
||||
filetype: string[];
|
||||
}
|
||||
|
||||
export interface Result {
|
||||
uri: string;
|
||||
type: string;
|
||||
fileName: string;
|
||||
fileSize: number;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { DocumentPicker, DocumentPickerUtil } from "react-native-document-picker";
|
||||
|
||||
DocumentPicker.show({
|
||||
filetype: [DocumentPickerUtil.allFiles()],
|
||||
}, (error, res) => {
|
||||
// do nothing
|
||||
});
|
||||
25
types/react-native-document-picker/tsconfig.json
Normal file
25
types/react-native-document-picker/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-document-picker-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-native-document-picker/tslint.json
Normal file
1
types/react-native-document-picker/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user