Skip to content

Commit 22b8c67

Browse files
committed
deps: Upgrade react-native-document-picker to v8.1.3, the latest
Because it's been a while since we upgraded it, and because upgrading came up in a not-so-recent discussion of opting into the iOS side of this library, in #4586. The release notes announce some breaking changes, but those shouldn't affect us: - A few changes to `fileCopyUri`, but we don't use that - A change to `pick`, which we don't use (we use `pickMultiple`) - Desupport Android <5 (which we've already done) Changelog: https://github.com/rnmods/react-native-document-picker/releases
1 parent 3e4f50c commit 22b8c67

File tree

8 files changed

+488
-32
lines changed

8 files changed

+488
-32
lines changed

flow-typed/react-native-document-picker_v3.x.x.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"react-intl": "5.24.6",
5858
"react-native": "0.68.5",
5959
"react-native-device-info": "^8.1.7",
60-
"react-native-document-picker": "^3.2.4",
60+
"react-native-document-picker": "^8.1.3",
6161
"react-native-gesture-handler": "^2.8.0",
6262
"react-native-image-picker": "4.10.2",
6363
"react-native-open-notification": "^0.1.4",

tools/tsflower

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ run_only()
147147
# TODO get list of packages from data... better yet, make it
148148
# one tsflower command, reading a TsFlower config file
149149

150+
package=react-native-document-picker
151+
run_on_package "${package}"
152+
format_dir "${rootdir}"/types/"${package}"
153+
150154
package=react-native-open-notification
151155
run_on_package "${package}"
152156
format_dir "${rootdir}"/types/"${package}"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Chris Bobbe <[email protected]>
3+
Date: Tue, 10 Jan 2023 10:40:01 -0800
4+
Subject: [tsflower] Fill in simple types from @types/react-native; rewrite TS
5+
`Pick`
6+
7+
For more discussion of how to translate TS's `Pick` helper, see a
8+
previous patch that manually translated it to SubsetProperties in
9+
the @react-navigation types.
10+
---
11+
.../lib/typescript/index.js.flow | 17 ++++++++++++-----
12+
1 file changed, 12 insertions(+), 5 deletions(-)
13+
14+
diff --git types/react-native-document-picker/lib/typescript/index.js.flow types/react-native-document-picker/lib/typescript/index.js.flow
15+
index e73492740..c605dae3e 100644
16+
--- types/react-native-document-picker/lib/typescript/index.js.flow
17+
+++ types/react-native-document-picker/lib/typescript/index.js.flow
18+
@@ -2,7 +2,6 @@
19+
* @generated by TsFlower
20+
*/
21+
import type { Readonly } from 'tsflower/subst/lib';
22+
-import { type ModalPropsIOS } from 'react-native';
23+
import { type PlatformTypes, type SupportedPlatforms } from './fileTypes';
24+
25+
export type DocumentPickerResponse = {
26+
@@ -80,12 +79,20 @@ export type DocumentPickerOptions<OS: SupportedPlatforms> = {
27+
copyTo?: 'cachesDirectory' | 'documentDirectory',
28+
allowMultiSelection?: boolean,
29+
transitionStyle?: TransitionStyle,
30+
+
31+
+ // TODO(tsflower): Add ModalPropsIOS to tsflower/subst/react-native and
32+
+ // add macro to rewrite `Pick`.
33+
+ presentationStyle?: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen' | void,
34+
...
35+
-} & Pick<ModalPropsIOS, 'presentationStyle'>;
36+
+};
37+
38+
-declare export function pickDirectory<OS: SupportedPlatforms>(
39+
- params?: Pick<DocumentPickerOptions<OS>, 'presentationStyle' | 'transitionStyle'>,
40+
-): Promise<DirectoryPickerResponse | null>;
41+
+declare export function pickDirectory<OS: SupportedPlatforms>(params?: {
42+
+ // TODO(tsflower): Add ModalPropsIOS to tsflower/subst/react-native and
43+
+ // add macro to rewrite `Pick`.
44+
+ presentationStyle?: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen' | void,
45+
+ transitionStyle?: DocumentPickerOptions<OS>['transitionStyle'],
46+
+ ...
47+
+}): Promise<DirectoryPickerResponse | null>;
48+
49+
declare export function pickMultiple<OS: SupportedPlatforms>(
50+
opts?: DocumentPickerOptions<OS>,
51+
--
52+
2.32.0
53+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* @flow
2+
* @generated
3+
*/
4+
export * from './lib/typescript/index.js.flow';
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
/* @flow
2+
* @generated by TsFlower
3+
*/
4+
import type { Readonly } from 'tsflower/subst/lib';
5+
6+
declare var mimeTypes: Readonly<{
7+
+allFiles: '*/*',
8+
+audio: 'audio/*',
9+
+csv: 'text/csv',
10+
+doc: 'application/msword',
11+
+docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
12+
+images: 'image/*',
13+
+pdf: 'application/pdf',
14+
+plainText: 'text/plain',
15+
+ppt: 'application/vnd.ms-powerpoint',
16+
+pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
17+
+video: 'video/*',
18+
+xls: 'application/vnd.ms-excel',
19+
+xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
20+
+zip: 'application/zip',
21+
...
22+
}>;
23+
24+
declare var utis: Readonly<{
25+
+allFiles: 'public.item',
26+
+audio: 'public.audio',
27+
+csv: 'public.comma-separated-values-text',
28+
+doc: 'com.microsoft.word.doc',
29+
+docx: 'org.openxmlformats.wordprocessingml.document',
30+
+images: 'public.image',
31+
+pdf: 'com.adobe.pdf',
32+
+plainText: 'public.plain-text',
33+
+ppt: 'com.microsoft.powerpoint.ppt',
34+
+pptx: 'org.openxmlformats.presentationml.presentation',
35+
+video: 'public.movie',
36+
+xls: 'com.microsoft.excel.xls',
37+
+xlsx: 'org.openxmlformats.spreadsheetml.sheet',
38+
+zip: 'public.zip-archive',
39+
...
40+
}>;
41+
42+
declare var extensions: Readonly<{
43+
+allFiles: '*',
44+
+audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',
45+
+csv: '.csv',
46+
+doc: '.doc',
47+
+docx: '.docx',
48+
+images: '.jpeg .jpg .png',
49+
+pdf: '.pdf',
50+
+plainText: '.txt',
51+
+ppt: '.ppt',
52+
+pptx: '.pptx',
53+
+video: '.mp4',
54+
+xls: '.xls',
55+
+xlsx: '.xlsx',
56+
+zip: '.zip .gz',
57+
...
58+
}>;
59+
60+
export type PlatformTypes = {
61+
android: typeof mimeTypes,
62+
ios: typeof utis,
63+
windows: typeof extensions,
64+
...
65+
};
66+
67+
export type SupportedPlatforms = 'ios' | 'android' | 'windows';
68+
69+
declare export var perPlatformTypes: {
70+
android: Readonly<{
71+
+allFiles: '*/*',
72+
+audio: 'audio/*',
73+
+csv: 'text/csv',
74+
+doc: 'application/msword',
75+
+docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
76+
+images: 'image/*',
77+
+pdf: 'application/pdf',
78+
+plainText: 'text/plain',
79+
+ppt: 'application/vnd.ms-powerpoint',
80+
+pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
81+
+video: 'video/*',
82+
+xls: 'application/vnd.ms-excel',
83+
+xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
84+
+zip: 'application/zip',
85+
...
86+
}>,
87+
ios: Readonly<{
88+
+allFiles: 'public.item',
89+
+audio: 'public.audio',
90+
+csv: 'public.comma-separated-values-text',
91+
+doc: 'com.microsoft.word.doc',
92+
+docx: 'org.openxmlformats.wordprocessingml.document',
93+
+images: 'public.image',
94+
+pdf: 'com.adobe.pdf',
95+
+plainText: 'public.plain-text',
96+
+ppt: 'com.microsoft.powerpoint.ppt',
97+
+pptx: 'org.openxmlformats.presentationml.presentation',
98+
+video: 'public.movie',
99+
+xls: 'com.microsoft.excel.xls',
100+
+xlsx: 'org.openxmlformats.spreadsheetml.sheet',
101+
+zip: 'public.zip-archive',
102+
...
103+
}>,
104+
windows: Readonly<{
105+
+allFiles: '*',
106+
+audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',
107+
+csv: '.csv',
108+
+doc: '.doc',
109+
+docx: '.docx',
110+
+images: '.jpeg .jpg .png',
111+
+pdf: '.pdf',
112+
+plainText: '.txt',
113+
+ppt: '.ppt',
114+
+pptx: '.pptx',
115+
+video: '.mp4',
116+
+xls: '.xls',
117+
+xlsx: '.xlsx',
118+
+zip: '.zip .gz',
119+
...
120+
}>,
121+
macos: Readonly<{
122+
+allFiles: '*',
123+
+audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',
124+
+csv: '.csv',
125+
+doc: '.doc',
126+
+docx: '.docx',
127+
+images: '.jpeg .jpg .png',
128+
+pdf: '.pdf',
129+
+plainText: '.txt',
130+
+ppt: '.ppt',
131+
+pptx: '.pptx',
132+
+video: '.mp4',
133+
+xls: '.xls',
134+
+xlsx: '.xlsx',
135+
+zip: '.zip .gz',
136+
...
137+
}>,
138+
web: Readonly<{
139+
+allFiles: '*',
140+
+audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',
141+
+csv: '.csv',
142+
+doc: '.doc',
143+
+docx: '.docx',
144+
+images: '.jpeg .jpg .png',
145+
+pdf: '.pdf',
146+
+plainText: '.txt',
147+
+ppt: '.ppt',
148+
+pptx: '.pptx',
149+
+video: '.mp4',
150+
+xls: '.xls',
151+
+xlsx: '.xlsx',
152+
+zip: '.zip .gz',
153+
...
154+
}>,
155+
...
156+
};
157+
158+
declare export var typesAreEqual: true;
159+
export {};

0 commit comments

Comments
 (0)