rn-file-toolkit 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FileToolkit.podspec +22 -0
- package/LICENSE +20 -0
- package/README.md +522 -0
- package/android/build.gradle +61 -0
- package/android/src/main/AndroidManifest.xml +13 -0
- package/android/src/main/java/com/filetoolkit/FileToolkitModule.kt +1204 -0
- package/android/src/main/java/com/filetoolkit/FileToolkitPackage.kt +31 -0
- package/android/src/main/res/xml/file_provider_paths.xml +14 -0
- package/app.plugin.js +49 -0
- package/ios/FileToolkit.h +6 -0
- package/ios/FileToolkit.mm +1468 -0
- package/lib/commonjs/NativeFileToolkit.js +9 -0
- package/lib/commonjs/NativeFileToolkit.js.map +1 -0
- package/lib/commonjs/index.js +941 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/NativeFileToolkit.js +5 -0
- package/lib/module/NativeFileToolkit.js.map +1 -0
- package/lib/module/index.js +905 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeFileToolkit.d.ts +29 -0
- package/lib/typescript/commonjs/src/NativeFileToolkit.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +635 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeFileToolkit.d.ts +29 -0
- package/lib/typescript/module/src/NativeFileToolkit.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +635 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +232 -0
- package/src/NativeFileToolkit.ts +29 -0
- package/src/index.tsx +1293 -0
package/package.json
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rn-file-toolkit",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "The simplest and most reliable way to download files in React Native with progress, permissions, and file handling built-in.",
|
|
5
|
+
"main": "./lib/commonjs/index.js",
|
|
6
|
+
"module": "./lib/module/index.js",
|
|
7
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.tsx",
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
13
|
+
"default": "./lib/module/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
17
|
+
"default": "./lib/commonjs/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"src",
|
|
24
|
+
"lib",
|
|
25
|
+
"android",
|
|
26
|
+
"ios",
|
|
27
|
+
"cpp",
|
|
28
|
+
"*.podspec",
|
|
29
|
+
"react-native.config.js",
|
|
30
|
+
"app.plugin.js",
|
|
31
|
+
"!ios/build",
|
|
32
|
+
"!android/build",
|
|
33
|
+
"!android/gradle",
|
|
34
|
+
"!android/gradlew",
|
|
35
|
+
"!android/gradlew.bat",
|
|
36
|
+
"!android/local.properties",
|
|
37
|
+
"!**/__tests__",
|
|
38
|
+
"!**/__fixtures__",
|
|
39
|
+
"!**/__mocks__",
|
|
40
|
+
"!**/.*"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"example": "yarn workspace rn-file-toolkit-example",
|
|
44
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
45
|
+
"prepare": "bob build",
|
|
46
|
+
"typecheck": "tsc",
|
|
47
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
48
|
+
"test": "jest",
|
|
49
|
+
"release": "release-it --only-version"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"react-native",
|
|
53
|
+
"expo",
|
|
54
|
+
"ios",
|
|
55
|
+
"android",
|
|
56
|
+
"download",
|
|
57
|
+
"downloader",
|
|
58
|
+
"file-download",
|
|
59
|
+
"background-download",
|
|
60
|
+
"download-manager",
|
|
61
|
+
"file-upload",
|
|
62
|
+
"upload",
|
|
63
|
+
"progress",
|
|
64
|
+
"pause-resume",
|
|
65
|
+
"turbo-module",
|
|
66
|
+
"native-module",
|
|
67
|
+
"file-manager",
|
|
68
|
+
"cache",
|
|
69
|
+
"checksum",
|
|
70
|
+
"urlsession",
|
|
71
|
+
"download-progress",
|
|
72
|
+
"react-native-downloads",
|
|
73
|
+
"mobile-download",
|
|
74
|
+
"expo-plugin",
|
|
75
|
+
"base64",
|
|
76
|
+
"base64-converter",
|
|
77
|
+
"data-uri",
|
|
78
|
+
"url-to-base64",
|
|
79
|
+
"share-file",
|
|
80
|
+
"open-file",
|
|
81
|
+
"file-sharing",
|
|
82
|
+
"file-viewer",
|
|
83
|
+
"document-viewer",
|
|
84
|
+
"share-dialog",
|
|
85
|
+
"native-share",
|
|
86
|
+
"auto-retry",
|
|
87
|
+
"retry",
|
|
88
|
+
"download-queue",
|
|
89
|
+
"concurrent-downloads",
|
|
90
|
+
"queue",
|
|
91
|
+
"concurrency",
|
|
92
|
+
"priority-queue",
|
|
93
|
+
"max-concurrent",
|
|
94
|
+
"download-concurrency",
|
|
95
|
+
"batch-download",
|
|
96
|
+
"queued-download",
|
|
97
|
+
"filesystem",
|
|
98
|
+
"file-system",
|
|
99
|
+
"read-file",
|
|
100
|
+
"write-file",
|
|
101
|
+
"copy-file",
|
|
102
|
+
"move-file",
|
|
103
|
+
"file-exists",
|
|
104
|
+
"file-stat",
|
|
105
|
+
"mkdir",
|
|
106
|
+
"ls",
|
|
107
|
+
"blob-util-alternative",
|
|
108
|
+
"react-native-fs-alternative"
|
|
109
|
+
],
|
|
110
|
+
"repository": {
|
|
111
|
+
"type": "git",
|
|
112
|
+
"url": "git+https://github.com/chavan-labs/rn-file-toolkit.git"
|
|
113
|
+
},
|
|
114
|
+
"author": "Rohit Chavan <chavanrohit413@gmail.com> (https://github.com/chavan-labs)",
|
|
115
|
+
"license": "MIT",
|
|
116
|
+
"bugs": {
|
|
117
|
+
"url": "https://github.com/chavan-labs/rn-file-toolkit/issues"
|
|
118
|
+
},
|
|
119
|
+
"homepage": "https://github.com/chavan-labs/rn-file-toolkit#readme",
|
|
120
|
+
"publishConfig": {
|
|
121
|
+
"registry": "https://registry.npmjs.org/"
|
|
122
|
+
},
|
|
123
|
+
"devDependencies": {
|
|
124
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
125
|
+
"@eslint/compat": "^1.3.2",
|
|
126
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
127
|
+
"@eslint/js": "^9.35.0",
|
|
128
|
+
"@react-native/babel-preset": "0.83.0",
|
|
129
|
+
"@react-native/eslint-config": "0.83.0",
|
|
130
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
131
|
+
"@types/jest": "^29.5.14",
|
|
132
|
+
"@types/react": "^19.2.0",
|
|
133
|
+
"commitlint": "^19.8.1",
|
|
134
|
+
"del-cli": "^6.0.0",
|
|
135
|
+
"eslint": "^9.35.0",
|
|
136
|
+
"eslint-config-prettier": "^10.1.8",
|
|
137
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
138
|
+
"jest": "^29.7.0",
|
|
139
|
+
"lefthook": "^2.0.3",
|
|
140
|
+
"prettier": "^2.8.8",
|
|
141
|
+
"react": "19.2.0",
|
|
142
|
+
"react-native": "0.83.0",
|
|
143
|
+
"react-native-builder-bob": "^0.40.18",
|
|
144
|
+
"release-it": "^19.0.4",
|
|
145
|
+
"turbo": "^2.5.6",
|
|
146
|
+
"typescript": "^5.9.2"
|
|
147
|
+
},
|
|
148
|
+
"peerDependencies": {
|
|
149
|
+
"react": "*",
|
|
150
|
+
"react-native": "*"
|
|
151
|
+
},
|
|
152
|
+
"workspaces": [
|
|
153
|
+
"example"
|
|
154
|
+
],
|
|
155
|
+
"react-native-builder-bob": {
|
|
156
|
+
"source": "src",
|
|
157
|
+
"output": "lib",
|
|
158
|
+
"targets": [
|
|
159
|
+
"commonjs",
|
|
160
|
+
[
|
|
161
|
+
"module",
|
|
162
|
+
{
|
|
163
|
+
"esm": true
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
[
|
|
167
|
+
"typescript",
|
|
168
|
+
{
|
|
169
|
+
"project": "tsconfig.build.json"
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"codegenConfig": {
|
|
175
|
+
"name": "FileToolkitSpec",
|
|
176
|
+
"type": "modules",
|
|
177
|
+
"jsSrcsDir": "src",
|
|
178
|
+
"android": {
|
|
179
|
+
"javaPackageName": "com.filetoolkit"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"prettier": {
|
|
183
|
+
"quoteProps": "consistent",
|
|
184
|
+
"singleQuote": true,
|
|
185
|
+
"tabWidth": 2,
|
|
186
|
+
"trailingComma": "es5",
|
|
187
|
+
"useTabs": false
|
|
188
|
+
},
|
|
189
|
+
"jest": {
|
|
190
|
+
"preset": "react-native",
|
|
191
|
+
"modulePathIgnorePatterns": [
|
|
192
|
+
"<rootDir>/example/node_modules",
|
|
193
|
+
"<rootDir>/lib/"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"commitlint": {
|
|
197
|
+
"extends": [
|
|
198
|
+
"@commitlint/config-conventional"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"release-it": {
|
|
202
|
+
"git": {
|
|
203
|
+
"commitMessage": "chore: release ${version}",
|
|
204
|
+
"tagName": "v${version}"
|
|
205
|
+
},
|
|
206
|
+
"npm": {
|
|
207
|
+
"publish": true
|
|
208
|
+
},
|
|
209
|
+
"github": {
|
|
210
|
+
"release": true
|
|
211
|
+
},
|
|
212
|
+
"plugins": {
|
|
213
|
+
"@release-it/conventional-changelog": {
|
|
214
|
+
"preset": {
|
|
215
|
+
"name": "angular"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"create-react-native-library": {
|
|
221
|
+
"type": "turbo-module",
|
|
222
|
+
"languages": "kotlin-objc",
|
|
223
|
+
"tools": [
|
|
224
|
+
"eslint",
|
|
225
|
+
"jest",
|
|
226
|
+
"lefthook",
|
|
227
|
+
"release-it"
|
|
228
|
+
],
|
|
229
|
+
"version": "0.57.2"
|
|
230
|
+
},
|
|
231
|
+
"packageManager": "yarn@4.11.0+sha512.4e54aeace9141df2f0177c266b05ec50dc044638157dae128c471ba65994ac802122d7ab35bcd9e81641228b7dcf24867d28e750e0bcae8a05277d600008ad54"
|
|
232
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TurboModuleRegistry, type TurboModule } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface Spec extends TurboModule {
|
|
4
|
+
download(options: Object): Promise<Object>;
|
|
5
|
+
upload(options: Object): Promise<Object>;
|
|
6
|
+
pauseDownload(downloadId: string): Promise<Object>;
|
|
7
|
+
resumeDownload(downloadId: string): Promise<Object>;
|
|
8
|
+
cancelDownload(downloadId: string): Promise<Object>;
|
|
9
|
+
getCachedFiles(): Promise<Object>;
|
|
10
|
+
deleteFile(filePath: string): Promise<Object>;
|
|
11
|
+
clearCache(): Promise<Object>;
|
|
12
|
+
getBackgroundDownloads(): Promise<Object>;
|
|
13
|
+
exists(filePath: string): Promise<Object>;
|
|
14
|
+
stat(filePath: string): Promise<Object>;
|
|
15
|
+
readFile(filePath: string, encoding: string): Promise<Object>;
|
|
16
|
+
writeFile(filePath: string, data: string, encoding: string): Promise<Object>;
|
|
17
|
+
copyFile(fromPath: string, toPath: string): Promise<Object>;
|
|
18
|
+
moveFile(fromPath: string, toPath: string): Promise<Object>;
|
|
19
|
+
mkdir(dirPath: string): Promise<Object>;
|
|
20
|
+
ls(dirPath: string): Promise<Object>;
|
|
21
|
+
saveBase64AsFile(options: Object): Promise<Object>;
|
|
22
|
+
urlToBase64(options: Object): Promise<Object>;
|
|
23
|
+
shareFile(filePath: string, options: Object): Promise<Object>;
|
|
24
|
+
openFile(filePath: string, mimeType: string): Promise<Object>;
|
|
25
|
+
unzip(sourcePath: string, destDir: string): Promise<Object>;
|
|
26
|
+
zip(sourcePath: string, destPath: string): Promise<Object>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('FileToolkit');
|