@codeleap/mobile 1.9.25 → 1.9.28

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.
Files changed (222) hide show
  1. package/CodeLeap-Mobile-Packages.code-workspace +7 -7
  2. package/dist/components/ActivityIndicator.d.ts +13 -13
  3. package/dist/components/ActivityIndicator.js +54 -54
  4. package/dist/components/ActivityIndicator.js.map +0 -0
  5. package/dist/components/Animated.d.ts +123 -15
  6. package/dist/components/Animated.js +58 -58
  7. package/dist/components/Animated.js.map +0 -0
  8. package/dist/components/Button.d.ts +132 -125
  9. package/dist/components/Button.js +93 -82
  10. package/dist/components/Button.js.map +1 -1
  11. package/dist/components/Checkbox/index.d.ts +15 -15
  12. package/dist/components/Checkbox/index.js +79 -79
  13. package/dist/components/Checkbox/index.js.map +0 -0
  14. package/dist/components/Checkbox/styles.d.ts +55 -55
  15. package/dist/components/Checkbox/styles.js +51 -51
  16. package/dist/components/Checkbox/styles.js.map +0 -0
  17. package/dist/components/ContentView.d.ts +10 -10
  18. package/dist/components/ContentView.js +50 -50
  19. package/dist/components/ContentView.js.map +0 -0
  20. package/dist/components/EmptyPlaceholder.d.ts +12 -0
  21. package/dist/components/EmptyPlaceholder.js +54 -0
  22. package/dist/components/EmptyPlaceholder.js.map +1 -0
  23. package/dist/components/FileInput.d.ts +31 -31
  24. package/dist/components/FileInput.js +230 -230
  25. package/dist/components/FileInput.js.map +0 -0
  26. package/dist/components/Gap.d.ts +8 -0
  27. package/dist/components/Gap.js +60 -0
  28. package/dist/components/Gap.js.map +1 -0
  29. package/dist/components/Icon.d.ts +12 -12
  30. package/dist/components/Icon.js +70 -70
  31. package/dist/components/Icon.js.map +0 -0
  32. package/dist/components/Image.d.ts +18 -18
  33. package/dist/components/Image.js +59 -59
  34. package/dist/components/Image.js.map +0 -0
  35. package/dist/components/List.d.ts +14 -14
  36. package/dist/components/List.js +84 -83
  37. package/dist/components/List.js.map +1 -1
  38. package/dist/components/Modal/index.d.ts +27 -26
  39. package/dist/components/Modal/index.js +113 -112
  40. package/dist/components/Modal/index.js.map +1 -1
  41. package/dist/components/Modal/styles.d.ts +64 -69
  42. package/dist/components/Modal/styles.js +59 -64
  43. package/dist/components/Modal/styles.js.map +1 -1
  44. package/dist/components/Navigation/Navigation.d.ts +3 -3
  45. package/dist/components/Navigation/Navigation.js +87 -87
  46. package/dist/components/Navigation/Navigation.js.map +0 -0
  47. package/dist/components/Navigation/constants.d.ts +5 -5
  48. package/dist/components/Navigation/constants.js +10 -10
  49. package/dist/components/Navigation/constants.js.map +0 -0
  50. package/dist/components/Navigation/index.d.ts +3 -3
  51. package/dist/components/Navigation/index.js +19 -19
  52. package/dist/components/Navigation/index.js.map +0 -0
  53. package/dist/components/Navigation/types.d.ts +26 -26
  54. package/dist/components/Navigation/types.js +7 -7
  55. package/dist/components/Navigation/types.js.map +0 -0
  56. package/dist/components/Navigation/utils.d.ts +3 -3
  57. package/dist/components/Navigation/utils.js +69 -69
  58. package/dist/components/Navigation/utils.js.map +0 -0
  59. package/dist/components/NewPager/index.d.ts +26 -0
  60. package/dist/components/NewPager/index.js +88 -0
  61. package/dist/components/NewPager/index.js.map +1 -0
  62. package/dist/components/NewPager/styles.d.ts +87 -0
  63. package/dist/components/NewPager/styles.js +70 -0
  64. package/dist/components/NewPager/styles.js.map +1 -0
  65. package/dist/components/Overlay.d.ts +16 -16
  66. package/dist/components/Overlay.js +69 -69
  67. package/dist/components/Overlay.js.map +0 -0
  68. package/dist/components/Pager/index.d.ts +20 -20
  69. package/dist/components/Pager/index.js +167 -167
  70. package/dist/components/Pager/index.js.map +0 -0
  71. package/dist/components/Pager/styles.d.ts +54 -54
  72. package/dist/components/Pager/styles.js +43 -43
  73. package/dist/components/Pager/styles.js.map +0 -0
  74. package/dist/components/RadioInput/index.d.ts +26 -26
  75. package/dist/components/RadioInput/index.js +72 -72
  76. package/dist/components/RadioInput/index.js.map +0 -0
  77. package/dist/components/RadioInput/styles.d.ts +57 -57
  78. package/dist/components/RadioInput/styles.js +44 -44
  79. package/dist/components/RadioInput/styles.js.map +0 -0
  80. package/dist/components/Scroll.d.ts +13 -13
  81. package/dist/components/Scroll.js +81 -81
  82. package/dist/components/Scroll.js.map +0 -0
  83. package/dist/components/Sections.d.ts +11 -11
  84. package/dist/components/Sections.js +80 -80
  85. package/dist/components/Sections.js.map +0 -0
  86. package/dist/components/Select/index.d.ts +5 -5
  87. package/dist/components/Select/index.js +150 -150
  88. package/dist/components/Select/index.js.map +0 -0
  89. package/dist/components/Select/styles.d.ts +9 -9
  90. package/dist/components/Select/styles.js +56 -56
  91. package/dist/components/Select/styles.js.map +0 -0
  92. package/dist/components/Select/types.d.ts +40 -40
  93. package/dist/components/Select/types.js +2 -2
  94. package/dist/components/Select/types.js.map +0 -0
  95. package/dist/components/Slider/Mark.d.ts +3 -3
  96. package/dist/components/Slider/Mark.js +31 -31
  97. package/dist/components/Slider/Mark.js.map +0 -0
  98. package/dist/components/Slider/Thumb.d.ts +7 -7
  99. package/dist/components/Slider/Thumb.js +29 -29
  100. package/dist/components/Slider/Thumb.js.map +0 -0
  101. package/dist/components/Slider/index.d.ts +3 -3
  102. package/dist/components/Slider/index.js +97 -97
  103. package/dist/components/Slider/index.js.map +0 -0
  104. package/dist/components/Slider/types.d.ts +25 -25
  105. package/dist/components/Slider/types.js +2 -2
  106. package/dist/components/Slider/types.js.map +0 -0
  107. package/dist/components/Switch.d.ts +13 -13
  108. package/dist/components/Switch.js +75 -75
  109. package/dist/components/Switch.js.map +0 -0
  110. package/dist/components/Text.d.ts +12 -12
  111. package/dist/components/Text.js +52 -52
  112. package/dist/components/Text.js.map +0 -0
  113. package/dist/components/TextInput.d.ts +183 -183
  114. package/dist/components/TextInput.js +180 -180
  115. package/dist/components/TextInput.js.map +0 -0
  116. package/dist/components/Touchable.d.ts +14 -14
  117. package/dist/components/Touchable.js +75 -75
  118. package/dist/components/Touchable.js.map +0 -0
  119. package/dist/components/View.d.ts +123 -120
  120. package/dist/components/View.js +55 -54
  121. package/dist/components/View.js.map +1 -1
  122. package/dist/components/components.d.ts +28 -25
  123. package/dist/components/components.js +44 -41
  124. package/dist/components/components.js.map +1 -1
  125. package/dist/index.d.ts +6 -5
  126. package/dist/index.js +30 -28
  127. package/dist/index.js.map +1 -1
  128. package/dist/modules/documentPicker.d.ts +3 -3
  129. package/dist/modules/documentPicker.js +11 -11
  130. package/dist/modules/documentPicker.js.map +0 -0
  131. package/dist/modules/fastImage.d.ts +1 -1
  132. package/dist/modules/fastImage.js +9 -9
  133. package/dist/modules/fastImage.js.map +0 -0
  134. package/dist/modules/reactNavigation.d.ts +3 -3
  135. package/dist/modules/reactNavigation.js +10 -10
  136. package/dist/modules/reactNavigation.js.map +0 -0
  137. package/dist/modules/textInputMask.d.ts +9 -12
  138. package/dist/modules/textInputMask.js +7 -7
  139. package/dist/modules/types/fileTypes.d.ts +138 -138
  140. package/dist/modules/types/fileTypes.js +2 -2
  141. package/dist/modules/types/fileTypes.js.map +0 -0
  142. package/dist/modules/types/textInputMask.d.ts +7 -12
  143. package/dist/modules/types/textInputMask.js +2 -2
  144. package/dist/types/utility.d.ts +2 -2
  145. package/dist/types/utility.js +2 -2
  146. package/dist/types/utility.js.map +0 -0
  147. package/dist/utils/ModalManager/components.d.ts +12 -0
  148. package/dist/utils/ModalManager/components.js +79 -0
  149. package/dist/utils/ModalManager/components.js.map +1 -0
  150. package/dist/utils/ModalManager/context.d.ts +42 -0
  151. package/dist/utils/ModalManager/context.js +172 -0
  152. package/dist/utils/ModalManager/context.js.map +1 -0
  153. package/dist/utils/ModalManager/index.d.ts +14 -0
  154. package/dist/utils/ModalManager/index.js +12 -0
  155. package/dist/utils/ModalManager/index.js.map +1 -0
  156. package/dist/utils/OSAlert.d.ts +31 -31
  157. package/dist/utils/OSAlert.js +141 -141
  158. package/dist/utils/OSAlert.js.map +0 -0
  159. package/dist/utils/misc.d.ts +2 -2
  160. package/dist/utils/misc.js +25 -25
  161. package/dist/utils/misc.js.map +0 -0
  162. package/dist/utils/styles.d.ts +1 -1
  163. package/dist/utils/styles.js +12 -12
  164. package/dist/utils/styles.js.map +0 -0
  165. package/package.json +43 -40
  166. package/src/components/ActivityIndicator.tsx +46 -46
  167. package/src/components/Animated.tsx +34 -34
  168. package/src/components/Button.tsx +117 -95
  169. package/src/components/Checkbox/index.tsx +85 -85
  170. package/src/components/Checkbox/styles.ts +76 -76
  171. package/src/components/ContentView.tsx +58 -58
  172. package/src/components/EmptyPlaceholder.tsx +53 -0
  173. package/src/components/FileInput.tsx +230 -230
  174. package/src/components/Gap.tsx +40 -0
  175. package/src/components/Icon.tsx +58 -58
  176. package/src/components/Image.tsx +61 -61
  177. package/src/components/List.tsx +116 -111
  178. package/src/components/Modal/index.tsx +162 -161
  179. package/src/components/Modal/styles.ts +126 -133
  180. package/src/components/Navigation/Navigation.tsx +58 -58
  181. package/src/components/Navigation/constants.ts +8 -8
  182. package/src/components/Navigation/index.tsx +3 -3
  183. package/src/components/Navigation/types.ts +35 -35
  184. package/src/components/Navigation/utils.tsx +59 -59
  185. package/src/components/NewPager/index.tsx +121 -0
  186. package/src/components/NewPager/styles.ts +76 -0
  187. package/src/components/Overlay.tsx +77 -77
  188. package/src/components/Pager/index.tsx +242 -242
  189. package/src/components/Pager/styles.ts +51 -51
  190. package/src/components/RadioInput/index.tsx +101 -101
  191. package/src/components/RadioInput/styles.ts +67 -67
  192. package/src/components/Scroll.tsx +106 -106
  193. package/src/components/Sections.tsx +101 -101
  194. package/src/components/Select/index.tsx +195 -195
  195. package/src/components/Select/styles.ts +81 -81
  196. package/src/components/Select/types.ts +46 -46
  197. package/src/components/Slider/Mark.tsx +46 -46
  198. package/src/components/Slider/Thumb.tsx +29 -29
  199. package/src/components/Slider/index.tsx +123 -123
  200. package/src/components/Slider/types.ts +25 -25
  201. package/src/components/Switch.tsx +81 -81
  202. package/src/components/Text.tsx +30 -30
  203. package/src/components/TextInput.tsx +247 -247
  204. package/src/components/Touchable.tsx +78 -78
  205. package/src/components/View.tsx +48 -46
  206. package/src/components/components.ts +28 -26
  207. package/src/index.ts +6 -6
  208. package/src/modules/documentPicker.ts +7 -7
  209. package/src/modules/fastImage.ts +2 -2
  210. package/src/modules/index.d.ts +496 -496
  211. package/src/modules/reactNavigation.ts +4 -4
  212. package/src/modules/textInputMask.ts +9 -9
  213. package/src/modules/types/documentPicker.d.ts +215 -215
  214. package/src/modules/types/fileTypes.ts +138 -138
  215. package/src/modules/types/textInputMask.ts +9 -13
  216. package/src/types/utility.ts +3 -3
  217. package/src/utils/ModalManager/components.tsx +58 -0
  218. package/src/utils/ModalManager/context.tsx +208 -0
  219. package/src/utils/ModalManager/index.ts +9 -0
  220. package/src/utils/OSAlert.ts +180 -180
  221. package/src/utils/misc.ts +24 -24
  222. package/src/utils/styles.ts +14 -14
@@ -1,496 +1,496 @@
1
- declare module 'react-native-image-crop-picker' {
2
- /**
3
- * AVAssetExportPreset presets.
4
- *
5
- * @see https://developer.apple.com/documentation/avfoundation/avassetexportsession/export_preset_names_for_quicktime_files_of_a_given_size
6
- */
7
- type CompressVideoPresets =
8
- | '640x480'
9
- | '960x540'
10
- | '1280x720'
11
- | '1920x1080'
12
- | 'HEVC3840x2160'
13
- | 'LowQuality'
14
- | 'MediumQuality'
15
- | 'HighestQuality'
16
- | 'Passthrough'
17
-
18
- /**
19
- * iOS smart album types
20
- *
21
- * @see https://developer.apple.com/documentation/photokit/phassetcollectionsubtype
22
- */
23
- type SmartAlbums =
24
- | 'Regular'
25
- | 'SyncedEvent'
26
- | 'SyncedFaces'
27
- | 'SyncedAlbum'
28
- | 'Imported'
29
- | 'PhotoStream'
30
- | 'CloudShared'
31
- | 'Generic'
32
- | 'Panoramas'
33
- | 'Videos'
34
- | 'Favorites'
35
- | 'Timelapses'
36
- | 'AllHidden'
37
- | 'RecentlyAdded'
38
- | 'Bursts'
39
- | 'SlomoVideos'
40
- | 'UserLibrary'
41
- | 'Screenshots'
42
- | 'SelfPortraits'
43
- /** >= iOS 10.2 */
44
- | 'DepthEffect'
45
- /** >= iOS 10.3 */
46
- | 'LivePhotos'
47
- /** >= iOS 11 */
48
- | 'Animated'
49
- | 'LongExposure'
50
-
51
- export interface CommonOptions {
52
- /**
53
- * Enable or disable multiple image selection.
54
- *
55
- * @default false
56
- */
57
- multiple?: boolean
58
-
59
- /**
60
- * Min number of files to select when using `multiple` option.
61
- *
62
- * @platform iOS only
63
- * @default 1
64
- */
65
- minFiles?: number
66
-
67
- /**
68
- * Max number of files to select when using `multiple` option.
69
- *
70
- * @platform iOS only
71
- * @default 5
72
- */
73
- maxFiles?: number
74
-
75
- /**
76
- * Promise will resolve/reject once ViewController completion block is called.
77
- *
78
- * @platform iOS only
79
- * @default true
80
- */
81
- waitAnimationEnd?: boolean
82
-
83
- /**
84
- * List of smart albums to choose from.
85
- *
86
- * @platform iOS only
87
- * @default ['UserLibrary', 'PhotoStream', 'Panoramas', 'Videos', 'Bursts']
88
- */
89
- smartAlbums?: SmartAlbums[]
90
-
91
- /**
92
- * Whether to default to the front camera when opened. Please note that not all
93
- * Android devices handle this parameter, see
94
- * [issue #1058](https://github.com/ivpusic/react-native-image-crop-picker/issues/1058).
95
- *
96
- * @default false
97
- */
98
- useFrontCamera?: boolean
99
-
100
- /**
101
- * Text displayed while photo is loading in picker.
102
- *
103
- * @default 'Processing assets...'
104
- */
105
- loadingLabelText?: string
106
-
107
- /**
108
- * Whether to show the number of selected assets.
109
- *
110
- * @default true
111
- */
112
- showsSelectedCount?: boolean
113
-
114
- /**
115
- * Applies a sort order on the creation date on how media is displayed within the
116
- * albums/detail photo views when opening the image picker.
117
- *
118
- * @platform iOS only
119
- * @default 'none'
120
- */
121
- sortOrder?: 'none' | 'asc' | 'desc'
122
-
123
- /**
124
- * Whether to display bottom controls.
125
- *
126
- * @platform Android only
127
- * @default false
128
- */
129
- hideBottomControls?: boolean
130
-
131
- /**
132
- * When set to false, does not write temporary files for the selected images. This is useful
133
- * to improve performance when you are retrieving file contents with the includeBase64 option
134
- * and don't need to read files from disk.
135
- *
136
- * @platform iOS only
137
- * @default true
138
- */
139
- writeTempFile?: boolean
140
- }
141
-
142
- type ImageOptions = CommonOptions & {
143
- mediaType: 'photo'
144
-
145
- /**
146
- * Width of result image when used with `cropping` option.
147
- */
148
- width?: number
149
-
150
- /**
151
- * Height of result image when used with `cropping` option.
152
- */
153
- height?: number
154
-
155
- /**
156
- * When set to true, the image file content will be available as a base64-encoded string in
157
- * the data property. Hint: To use this string as an image source, use it like:
158
- * <Image source={{uri: `data:${image.mime};base64,${image.data}`}} />
159
- *
160
- * @default false
161
- */
162
- includeBase64?: boolean
163
-
164
- /**
165
- * Include image exif data in the response.
166
- *
167
- * @default false
168
- */
169
- includeExif?: boolean
170
-
171
- /**
172
- * Whether to convert photos to JPG. This will also convert any Live Photo into its JPG representation.
173
- *
174
- * @default false
175
- */
176
- forceJpg?: boolean
177
-
178
- /**
179
- * Enable or disable cropping.
180
- *
181
- * @default false
182
- */
183
- cropping?: boolean
184
-
185
- /**
186
- * When set to true, the image will always fill the mask space.
187
- *
188
- * @default true
189
- */
190
- avoidEmptySpaceAroundImage?: boolean
191
-
192
- /**
193
- * When cropping image, determines ActiveWidget color.
194
- *
195
- * @platform Android only
196
- * @default '#424242'
197
- */
198
- cropperActiveWidgetColor?: string
199
-
200
- /**
201
- * When cropping image, determines the color of StatusBar.
202
- *
203
- * @platform Android only
204
- * @default '#424242'
205
- */
206
- cropperStatusBarColor?: string
207
-
208
- /**
209
- * When cropping image, determines the color of Toolbar.
210
- *
211
- * @platform Android only
212
- * @default '#424242'
213
- */
214
- cropperToolbarColor?: string
215
-
216
- /**
217
- * When cropping image, determines the color of Toolbar text and buttons.
218
- *
219
- * @platform Android only
220
- * @default 'darker orange'
221
- */
222
- cropperToolbarWidgetColor?: string
223
-
224
- /**
225
- * When cropping image, determines the title of Toolbar.
226
- *
227
- * @default 'Edit Photo'
228
- */
229
- cropperToolbarTitle?: string
230
-
231
- /**
232
- * Enables user to apply custom rectangle area for cropping.
233
- *
234
- * @platform iOS only
235
- * @default false
236
- */
237
- freeStyleCropEnabled?: boolean
238
-
239
- /**
240
- * cropperTintColor
241
- */
242
- cropperTintColor?: string
243
-
244
- /**
245
- * Enable or disable circular cropping mask.
246
- *
247
- * @default false
248
- */
249
- cropperCircleOverlay?: boolean
250
-
251
- /**
252
- * Cancel button text.
253
- *
254
- * @default 'Cancel'
255
- */
256
- cropperCancelText?: string
257
-
258
- /**
259
- * Choose button text.
260
- *
261
- * @default 'Choose'
262
- */
263
- cropperChooseText?: string
264
-
265
- /**
266
- * Enable or disable cropper rotate buttons.
267
- *
268
- * @platform iOS only
269
- * @default false
270
- */
271
- cropperRotateButtonsHidden?: boolean
272
-
273
- /**
274
- * Whether to show the 3x3 grid on top of the image during cropping.
275
- *
276
- * @platform Android only
277
- * @default true
278
- */
279
- showCropGuidelines?: boolean
280
-
281
- /**
282
- * Whether to show the square crop frame during cropping
283
- *
284
- * @platform Android only
285
- * @default true
286
- */
287
- showCropFrame?: boolean
288
-
289
- /**
290
- * Whether to enable rotating the image by hand gesture.
291
- *
292
- * @platform Android only
293
- * @default false
294
- */
295
- enableRotationGesture?: boolean
296
-
297
- /**
298
- * When cropping image, disables the color setters for cropping library.
299
- *
300
- * @platform Android only
301
- * @default false
302
- */
303
- disableCropperColorSetters?: boolean
304
-
305
- /**
306
- * Compress image with maximum width.
307
- *
308
- * @default null
309
- */
310
- compressImageMaxWidth?: number
311
-
312
- /**
313
- * Compress image with maximum height.
314
- *
315
- * @default null
316
- */
317
- compressImageMaxHeight?: number
318
-
319
- /**
320
- * Compress image with quality (from 0 to 1, where 1 is best quality). On iOS, values larger
321
- * than 0.8 don't produce a noticeable quality increase in most images, while a value of 0.8
322
- * will reduce the file size by about half or less compared to a value of 1.
323
- *
324
- * @default Android: 1, iOS: 0.8
325
- */
326
- compressImageQuality?: number
327
- }
328
-
329
- type CropperOptions = ImageOptions & {
330
- /**
331
- * Selected image location
332
- */
333
- path: string
334
- }
335
-
336
- type VideoOptions = CommonOptions & {
337
- mediaType: 'video'
338
-
339
- /**
340
- * Choose which preset will be used for video compression.
341
- *
342
- * @platform iOS only
343
- * @default 'MediumQuality'
344
- */
345
- compressVideoPreset?: CompressVideoPresets
346
- }
347
-
348
- type AnyOptions = Omit<ImageOptions, 'mediaType'> & Omit<VideoOptions, 'mediaType'> & {
349
- mediaType?: 'any'
350
- }
351
-
352
- export type Options = AnyOptions | VideoOptions | ImageOptions
353
-
354
- interface ImageVideoCommon {
355
- /**
356
- * Selected image location. This is null when the `writeTempFile` option is set to `false`.
357
- */
358
- path: string
359
-
360
- /**
361
- * Selected image size in bytes.
362
- */
363
- size: number
364
-
365
- /**
366
- * Selected image/video width.
367
- */
368
- width: number
369
-
370
- /**
371
- * Selected image/video height.
372
- */
373
- height: number
374
-
375
- /**
376
- * Selected image MIME type (image/jpeg, image/png, etc).
377
- */
378
- mime: string
379
-
380
- /**
381
- * Extracted exif data from image. Response format is platform specific.
382
- */
383
- exif?: null | object
384
-
385
- /**
386
- * Selected image's localidentifier, used for PHAsset searching.
387
- *
388
- * @platform iOS only
389
- */
390
- localIdentifier?: string
391
-
392
- /**
393
- * Selected image's source path, do not have write access.
394
- *
395
- * @platform iOS only
396
- */
397
- sourceURL?: string
398
-
399
- /**
400
- * Selected image/video's filename.
401
- *
402
- * @platform iOS only
403
- */
404
- filename?: string
405
-
406
- /**
407
- * UNIX timestamp when image was created.
408
- *
409
- * @platform iOS only
410
- */
411
- creationDate?: string
412
-
413
- /**
414
- * UNIX timestamp when image was last modified.
415
- */
416
- modificationDate?: string
417
- }
418
-
419
- export interface Image extends ImageVideoCommon {
420
- /**
421
- * Optional base64 selected file representation.
422
- */
423
- data?: string | null
424
-
425
- /**
426
- * Cropped image rectangle (width, height, x, y).
427
- */
428
- cropRect?: CropRect | null
429
- }
430
-
431
- export interface Video extends ImageVideoCommon {
432
- /**
433
- * Video duration in milliseconds
434
- */
435
- duration: number | null
436
- }
437
-
438
- export type ImageOrVideo = Image | Video
439
-
440
- export interface CropRect {
441
- x: number
442
- y: number
443
- width: number
444
- height: number
445
- }
446
-
447
- type PickerErrorCodeCommon =
448
- | 'E_PICKER_CANCELLED'
449
- | 'E_NO_IMAGE_DATA_FOUND'
450
- | 'E_NO_LIBRARY_PERMISSION'
451
- | 'E_NO_CAMERA_PERMISSION'
452
- | 'E_ERROR_WHILE_CLEANING_FILES'
453
-
454
- type PickerErrorCodeIOS =
455
- | 'E_PICKER_CANNOT_RUN_CAMERA_ON_SIMULATOR'
456
- | 'E_CROPPER_IMAGE_NOT_FOUND'
457
- | 'E_CANNOT_SAVE_IMAGE'
458
- | 'E_CANNOT_PROCESS_VIDEO'
459
-
460
- type PickerErrorCodeAndroid =
461
- | 'E_ACTIVITY_DOES_NOT_EXIST'
462
- | 'E_CALLBACK_ERROR'
463
- | 'E_FAILED_TO_SHOW_PICKER'
464
- | 'E_FAILED_TO_OPEN_CAMERA'
465
- | 'E_CAMERA_IS_NOT_AVAILABLE'
466
- | 'E_CANNOT_LAUNCH_CAMERA'
467
-
468
- export type PickerErrorCode = PickerErrorCodeCommon | PickerErrorCodeIOS | PickerErrorCodeAndroid
469
-
470
- /** Change return type based on `multiple` property. */
471
- export type PossibleArray<O, T> = O extends { multiple: true } ? T[] : T
472
-
473
- /** Isolate return type based on `mediaType` property. */
474
- type MediaType<O> =
475
- O extends { mediaType: 'photo' } ? Image :
476
- O extends { mediaType: 'video' } ? Video :
477
- ImageOrVideo
478
-
479
- export function openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
480
- export function openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
481
- export function openCropper(options: CropperOptions): Promise<Image>
482
- export function clean(): Promise<void>
483
- export function cleanSingle(path: string): Promise<void>
484
-
485
- export interface ImageCropPicker {
486
- openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
487
- openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
488
- openCropper(options: CropperOptions): Promise<Image>
489
- clean(): Promise<void>
490
- cleanSingle(path: string): Promise<void>
491
- }
492
-
493
- const ImageCropPicker: ImageCropPicker
494
-
495
- export default ImageCropPicker
496
- }
1
+ declare module 'react-native-image-crop-picker' {
2
+ /**
3
+ * AVAssetExportPreset presets.
4
+ *
5
+ * @see https://developer.apple.com/documentation/avfoundation/avassetexportsession/export_preset_names_for_quicktime_files_of_a_given_size
6
+ */
7
+ type CompressVideoPresets =
8
+ | '640x480'
9
+ | '960x540'
10
+ | '1280x720'
11
+ | '1920x1080'
12
+ | 'HEVC3840x2160'
13
+ | 'LowQuality'
14
+ | 'MediumQuality'
15
+ | 'HighestQuality'
16
+ | 'Passthrough'
17
+
18
+ /**
19
+ * iOS smart album types
20
+ *
21
+ * @see https://developer.apple.com/documentation/photokit/phassetcollectionsubtype
22
+ */
23
+ type SmartAlbums =
24
+ | 'Regular'
25
+ | 'SyncedEvent'
26
+ | 'SyncedFaces'
27
+ | 'SyncedAlbum'
28
+ | 'Imported'
29
+ | 'PhotoStream'
30
+ | 'CloudShared'
31
+ | 'Generic'
32
+ | 'Panoramas'
33
+ | 'Videos'
34
+ | 'Favorites'
35
+ | 'Timelapses'
36
+ | 'AllHidden'
37
+ | 'RecentlyAdded'
38
+ | 'Bursts'
39
+ | 'SlomoVideos'
40
+ | 'UserLibrary'
41
+ | 'Screenshots'
42
+ | 'SelfPortraits'
43
+ /** >= iOS 10.2 */
44
+ | 'DepthEffect'
45
+ /** >= iOS 10.3 */
46
+ | 'LivePhotos'
47
+ /** >= iOS 11 */
48
+ | 'Animated'
49
+ | 'LongExposure'
50
+
51
+ export interface CommonOptions {
52
+ /**
53
+ * Enable or disable multiple image selection.
54
+ *
55
+ * @default false
56
+ */
57
+ multiple?: boolean
58
+
59
+ /**
60
+ * Min number of files to select when using `multiple` option.
61
+ *
62
+ * @platform iOS only
63
+ * @default 1
64
+ */
65
+ minFiles?: number
66
+
67
+ /**
68
+ * Max number of files to select when using `multiple` option.
69
+ *
70
+ * @platform iOS only
71
+ * @default 5
72
+ */
73
+ maxFiles?: number
74
+
75
+ /**
76
+ * Promise will resolve/reject once ViewController completion block is called.
77
+ *
78
+ * @platform iOS only
79
+ * @default true
80
+ */
81
+ waitAnimationEnd?: boolean
82
+
83
+ /**
84
+ * List of smart albums to choose from.
85
+ *
86
+ * @platform iOS only
87
+ * @default ['UserLibrary', 'PhotoStream', 'Panoramas', 'Videos', 'Bursts']
88
+ */
89
+ smartAlbums?: SmartAlbums[]
90
+
91
+ /**
92
+ * Whether to default to the front camera when opened. Please note that not all
93
+ * Android devices handle this parameter, see
94
+ * [issue #1058](https://github.com/ivpusic/react-native-image-crop-picker/issues/1058).
95
+ *
96
+ * @default false
97
+ */
98
+ useFrontCamera?: boolean
99
+
100
+ /**
101
+ * Text displayed while photo is loading in picker.
102
+ *
103
+ * @default 'Processing assets...'
104
+ */
105
+ loadingLabelText?: string
106
+
107
+ /**
108
+ * Whether to show the number of selected assets.
109
+ *
110
+ * @default true
111
+ */
112
+ showsSelectedCount?: boolean
113
+
114
+ /**
115
+ * Applies a sort order on the creation date on how media is displayed within the
116
+ * albums/detail photo views when opening the image picker.
117
+ *
118
+ * @platform iOS only
119
+ * @default 'none'
120
+ */
121
+ sortOrder?: 'none' | 'asc' | 'desc'
122
+
123
+ /**
124
+ * Whether to display bottom controls.
125
+ *
126
+ * @platform Android only
127
+ * @default false
128
+ */
129
+ hideBottomControls?: boolean
130
+
131
+ /**
132
+ * When set to false, does not write temporary files for the selected images. This is useful
133
+ * to improve performance when you are retrieving file contents with the includeBase64 option
134
+ * and don't need to read files from disk.
135
+ *
136
+ * @platform iOS only
137
+ * @default true
138
+ */
139
+ writeTempFile?: boolean
140
+ }
141
+
142
+ type ImageOptions = CommonOptions & {
143
+ mediaType: 'photo'
144
+
145
+ /**
146
+ * Width of result image when used with `cropping` option.
147
+ */
148
+ width?: number
149
+
150
+ /**
151
+ * Height of result image when used with `cropping` option.
152
+ */
153
+ height?: number
154
+
155
+ /**
156
+ * When set to true, the image file content will be available as a base64-encoded string in
157
+ * the data property. Hint: To use this string as an image source, use it like:
158
+ * <Image source={{uri: `data:${image.mime};base64,${image.data}`}} />
159
+ *
160
+ * @default false
161
+ */
162
+ includeBase64?: boolean
163
+
164
+ /**
165
+ * Include image exif data in the response.
166
+ *
167
+ * @default false
168
+ */
169
+ includeExif?: boolean
170
+
171
+ /**
172
+ * Whether to convert photos to JPG. This will also convert any Live Photo into its JPG representation.
173
+ *
174
+ * @default false
175
+ */
176
+ forceJpg?: boolean
177
+
178
+ /**
179
+ * Enable or disable cropping.
180
+ *
181
+ * @default false
182
+ */
183
+ cropping?: boolean
184
+
185
+ /**
186
+ * When set to true, the image will always fill the mask space.
187
+ *
188
+ * @default true
189
+ */
190
+ avoidEmptySpaceAroundImage?: boolean
191
+
192
+ /**
193
+ * When cropping image, determines ActiveWidget color.
194
+ *
195
+ * @platform Android only
196
+ * @default '#424242'
197
+ */
198
+ cropperActiveWidgetColor?: string
199
+
200
+ /**
201
+ * When cropping image, determines the color of StatusBar.
202
+ *
203
+ * @platform Android only
204
+ * @default '#424242'
205
+ */
206
+ cropperStatusBarColor?: string
207
+
208
+ /**
209
+ * When cropping image, determines the color of Toolbar.
210
+ *
211
+ * @platform Android only
212
+ * @default '#424242'
213
+ */
214
+ cropperToolbarColor?: string
215
+
216
+ /**
217
+ * When cropping image, determines the color of Toolbar text and buttons.
218
+ *
219
+ * @platform Android only
220
+ * @default 'darker orange'
221
+ */
222
+ cropperToolbarWidgetColor?: string
223
+
224
+ /**
225
+ * When cropping image, determines the title of Toolbar.
226
+ *
227
+ * @default 'Edit Photo'
228
+ */
229
+ cropperToolbarTitle?: string
230
+
231
+ /**
232
+ * Enables user to apply custom rectangle area for cropping.
233
+ *
234
+ * @platform iOS only
235
+ * @default false
236
+ */
237
+ freeStyleCropEnabled?: boolean
238
+
239
+ /**
240
+ * cropperTintColor
241
+ */
242
+ cropperTintColor?: string
243
+
244
+ /**
245
+ * Enable or disable circular cropping mask.
246
+ *
247
+ * @default false
248
+ */
249
+ cropperCircleOverlay?: boolean
250
+
251
+ /**
252
+ * Cancel button text.
253
+ *
254
+ * @default 'Cancel'
255
+ */
256
+ cropperCancelText?: string
257
+
258
+ /**
259
+ * Choose button text.
260
+ *
261
+ * @default 'Choose'
262
+ */
263
+ cropperChooseText?: string
264
+
265
+ /**
266
+ * Enable or disable cropper rotate buttons.
267
+ *
268
+ * @platform iOS only
269
+ * @default false
270
+ */
271
+ cropperRotateButtonsHidden?: boolean
272
+
273
+ /**
274
+ * Whether to show the 3x3 grid on top of the image during cropping.
275
+ *
276
+ * @platform Android only
277
+ * @default true
278
+ */
279
+ showCropGuidelines?: boolean
280
+
281
+ /**
282
+ * Whether to show the square crop frame during cropping
283
+ *
284
+ * @platform Android only
285
+ * @default true
286
+ */
287
+ showCropFrame?: boolean
288
+
289
+ /**
290
+ * Whether to enable rotating the image by hand gesture.
291
+ *
292
+ * @platform Android only
293
+ * @default false
294
+ */
295
+ enableRotationGesture?: boolean
296
+
297
+ /**
298
+ * When cropping image, disables the color setters for cropping library.
299
+ *
300
+ * @platform Android only
301
+ * @default false
302
+ */
303
+ disableCropperColorSetters?: boolean
304
+
305
+ /**
306
+ * Compress image with maximum width.
307
+ *
308
+ * @default null
309
+ */
310
+ compressImageMaxWidth?: number
311
+
312
+ /**
313
+ * Compress image with maximum height.
314
+ *
315
+ * @default null
316
+ */
317
+ compressImageMaxHeight?: number
318
+
319
+ /**
320
+ * Compress image with quality (from 0 to 1, where 1 is best quality). On iOS, values larger
321
+ * than 0.8 don't produce a noticeable quality increase in most images, while a value of 0.8
322
+ * will reduce the file size by about half or less compared to a value of 1.
323
+ *
324
+ * @default Android: 1, iOS: 0.8
325
+ */
326
+ compressImageQuality?: number
327
+ }
328
+
329
+ type CropperOptions = ImageOptions & {
330
+ /**
331
+ * Selected image location
332
+ */
333
+ path: string
334
+ }
335
+
336
+ type VideoOptions = CommonOptions & {
337
+ mediaType: 'video'
338
+
339
+ /**
340
+ * Choose which preset will be used for video compression.
341
+ *
342
+ * @platform iOS only
343
+ * @default 'MediumQuality'
344
+ */
345
+ compressVideoPreset?: CompressVideoPresets
346
+ }
347
+
348
+ type AnyOptions = Omit<ImageOptions, 'mediaType'> & Omit<VideoOptions, 'mediaType'> & {
349
+ mediaType?: 'any'
350
+ }
351
+
352
+ export type Options = AnyOptions | VideoOptions | ImageOptions
353
+
354
+ interface ImageVideoCommon {
355
+ /**
356
+ * Selected image location. This is null when the `writeTempFile` option is set to `false`.
357
+ */
358
+ path: string
359
+
360
+ /**
361
+ * Selected image size in bytes.
362
+ */
363
+ size: number
364
+
365
+ /**
366
+ * Selected image/video width.
367
+ */
368
+ width: number
369
+
370
+ /**
371
+ * Selected image/video height.
372
+ */
373
+ height: number
374
+
375
+ /**
376
+ * Selected image MIME type (image/jpeg, image/png, etc).
377
+ */
378
+ mime: string
379
+
380
+ /**
381
+ * Extracted exif data from image. Response format is platform specific.
382
+ */
383
+ exif?: null | object
384
+
385
+ /**
386
+ * Selected image's localidentifier, used for PHAsset searching.
387
+ *
388
+ * @platform iOS only
389
+ */
390
+ localIdentifier?: string
391
+
392
+ /**
393
+ * Selected image's source path, do not have write access.
394
+ *
395
+ * @platform iOS only
396
+ */
397
+ sourceURL?: string
398
+
399
+ /**
400
+ * Selected image/video's filename.
401
+ *
402
+ * @platform iOS only
403
+ */
404
+ filename?: string
405
+
406
+ /**
407
+ * UNIX timestamp when image was created.
408
+ *
409
+ * @platform iOS only
410
+ */
411
+ creationDate?: string
412
+
413
+ /**
414
+ * UNIX timestamp when image was last modified.
415
+ */
416
+ modificationDate?: string
417
+ }
418
+
419
+ export interface Image extends ImageVideoCommon {
420
+ /**
421
+ * Optional base64 selected file representation.
422
+ */
423
+ data?: string | null
424
+
425
+ /**
426
+ * Cropped image rectangle (width, height, x, y).
427
+ */
428
+ cropRect?: CropRect | null
429
+ }
430
+
431
+ export interface Video extends ImageVideoCommon {
432
+ /**
433
+ * Video duration in milliseconds
434
+ */
435
+ duration: number | null
436
+ }
437
+
438
+ export type ImageOrVideo = Image | Video
439
+
440
+ export interface CropRect {
441
+ x: number
442
+ y: number
443
+ width: number
444
+ height: number
445
+ }
446
+
447
+ type PickerErrorCodeCommon =
448
+ | 'E_PICKER_CANCELLED'
449
+ | 'E_NO_IMAGE_DATA_FOUND'
450
+ | 'E_NO_LIBRARY_PERMISSION'
451
+ | 'E_NO_CAMERA_PERMISSION'
452
+ | 'E_ERROR_WHILE_CLEANING_FILES'
453
+
454
+ type PickerErrorCodeIOS =
455
+ | 'E_PICKER_CANNOT_RUN_CAMERA_ON_SIMULATOR'
456
+ | 'E_CROPPER_IMAGE_NOT_FOUND'
457
+ | 'E_CANNOT_SAVE_IMAGE'
458
+ | 'E_CANNOT_PROCESS_VIDEO'
459
+
460
+ type PickerErrorCodeAndroid =
461
+ | 'E_ACTIVITY_DOES_NOT_EXIST'
462
+ | 'E_CALLBACK_ERROR'
463
+ | 'E_FAILED_TO_SHOW_PICKER'
464
+ | 'E_FAILED_TO_OPEN_CAMERA'
465
+ | 'E_CAMERA_IS_NOT_AVAILABLE'
466
+ | 'E_CANNOT_LAUNCH_CAMERA'
467
+
468
+ export type PickerErrorCode = PickerErrorCodeCommon | PickerErrorCodeIOS | PickerErrorCodeAndroid
469
+
470
+ /** Change return type based on `multiple` property. */
471
+ export type PossibleArray<O, T> = O extends { multiple: true } ? T[] : T
472
+
473
+ /** Isolate return type based on `mediaType` property. */
474
+ type MediaType<O> =
475
+ O extends { mediaType: 'photo' } ? Image :
476
+ O extends { mediaType: 'video' } ? Video :
477
+ ImageOrVideo
478
+
479
+ export function openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
480
+ export function openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
481
+ export function openCropper(options: CropperOptions): Promise<Image>
482
+ export function clean(): Promise<void>
483
+ export function cleanSingle(path: string): Promise<void>
484
+
485
+ export interface ImageCropPicker {
486
+ openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
487
+ openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
488
+ openCropper(options: CropperOptions): Promise<Image>
489
+ clean(): Promise<void>
490
+ cleanSingle(path: string): Promise<void>
491
+ }
492
+
493
+ const ImageCropPicker: ImageCropPicker
494
+
495
+ export default ImageCropPicker
496
+ }