@react-native-firebase/storage 24.1.1 → 25.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/{lib → dist/module}/StorageDownloadTask.js +4 -3
  3. package/dist/module/StorageDownloadTask.js.map +1 -0
  4. package/{lib → dist/module}/StorageListResult.js +13 -8
  5. package/dist/module/StorageListResult.js.map +1 -0
  6. package/dist/module/StorageReference.js +270 -0
  7. package/dist/module/StorageReference.js.map +1 -0
  8. package/{lib → dist/module}/StorageStatics.js +5 -16
  9. package/dist/module/StorageStatics.js.map +1 -0
  10. package/{lib → dist/module}/StorageTask.js +82 -71
  11. package/dist/module/StorageTask.js.map +1 -0
  12. package/{lib → dist/module}/StorageUploadTask.js +4 -3
  13. package/dist/module/StorageUploadTask.js.map +1 -0
  14. package/dist/module/index.js +29 -0
  15. package/dist/module/index.js.map +1 -0
  16. package/{lib/modular/index.js → dist/module/modular.js} +65 -79
  17. package/dist/module/modular.js.map +1 -0
  18. package/dist/module/namespaced.js +192 -0
  19. package/dist/module/namespaced.js.map +1 -0
  20. package/dist/module/package.json +1 -0
  21. package/dist/module/types/internal.js +4 -0
  22. package/dist/module/types/internal.js.map +1 -0
  23. package/dist/module/types/namespaced.js +64 -0
  24. package/dist/module/types/namespaced.js.map +1 -0
  25. package/dist/module/types/storage.js +139 -0
  26. package/dist/module/types/storage.js.map +1 -0
  27. package/dist/module/utils.js +105 -0
  28. package/dist/module/utils.js.map +1 -0
  29. package/dist/module/version.js +5 -0
  30. package/dist/module/version.js.map +1 -0
  31. package/dist/module/web/RNFBStorageModule.android.js +6 -0
  32. package/dist/module/web/RNFBStorageModule.android.js.map +1 -0
  33. package/dist/module/web/RNFBStorageModule.ios.js +6 -0
  34. package/dist/module/web/RNFBStorageModule.ios.js.map +1 -0
  35. package/{lib → dist/module}/web/RNFBStorageModule.js +115 -197
  36. package/dist/module/web/RNFBStorageModule.js.map +1 -0
  37. package/dist/typescript/lib/StorageDownloadTask.d.ts +6 -0
  38. package/dist/typescript/lib/StorageDownloadTask.d.ts.map +1 -0
  39. package/dist/typescript/lib/StorageListResult.d.ts +13 -0
  40. package/dist/typescript/lib/StorageListResult.d.ts.map +1 -0
  41. package/dist/typescript/lib/StorageReference.d.ts +87 -0
  42. package/dist/typescript/lib/StorageReference.d.ts.map +1 -0
  43. package/dist/typescript/lib/StorageStatics.d.ts +2 -0
  44. package/dist/typescript/lib/StorageStatics.d.ts.map +1 -0
  45. package/dist/typescript/lib/StorageTask.d.ts +43 -0
  46. package/dist/typescript/lib/StorageTask.d.ts.map +1 -0
  47. package/dist/typescript/lib/StorageUploadTask.d.ts +6 -0
  48. package/dist/typescript/lib/StorageUploadTask.d.ts.map +1 -0
  49. package/dist/typescript/lib/index.d.ts +6 -0
  50. package/dist/typescript/lib/index.d.ts.map +1 -0
  51. package/dist/typescript/lib/modular.d.ts +154 -0
  52. package/dist/typescript/lib/modular.d.ts.map +1 -0
  53. package/dist/typescript/lib/namespaced.d.ts +12 -0
  54. package/dist/typescript/lib/namespaced.d.ts.map +1 -0
  55. package/dist/typescript/lib/types/internal.d.ts +131 -0
  56. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  57. package/dist/typescript/lib/types/namespaced.d.ts +1122 -0
  58. package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
  59. package/dist/typescript/lib/types/storage.d.ts +338 -0
  60. package/dist/typescript/lib/types/storage.d.ts.map +1 -0
  61. package/dist/typescript/lib/utils.d.ts +20 -0
  62. package/dist/typescript/lib/utils.d.ts.map +1 -0
  63. package/dist/typescript/lib/version.d.ts +2 -0
  64. package/dist/typescript/lib/version.d.ts.map +1 -0
  65. package/dist/typescript/lib/web/RNFBStorageModule.android.d.ts +3 -0
  66. package/dist/typescript/lib/web/RNFBStorageModule.android.d.ts.map +1 -0
  67. package/dist/typescript/lib/web/RNFBStorageModule.d.ts +142 -0
  68. package/dist/typescript/lib/web/RNFBStorageModule.d.ts.map +1 -0
  69. package/dist/typescript/lib/web/RNFBStorageModule.ios.d.ts +3 -0
  70. package/dist/typescript/lib/web/RNFBStorageModule.ios.d.ts.map +1 -0
  71. package/dist/typescript/package.json +1 -0
  72. package/lib/StorageDownloadTask.ts +30 -0
  73. package/lib/StorageListResult.ts +61 -0
  74. package/lib/{StorageReference.js → StorageReference.ts} +103 -61
  75. package/lib/StorageStatics.ts +19 -0
  76. package/lib/StorageTask.ts +336 -0
  77. package/lib/StorageUploadTask.ts +30 -0
  78. package/lib/index.ts +27 -0
  79. package/lib/modular.ts +401 -0
  80. package/lib/{index.js → namespaced.ts} +70 -28
  81. package/lib/types/internal.ts +189 -0
  82. package/lib/{index.d.ts → types/namespaced.ts} +111 -49
  83. package/lib/types/storage.ts +417 -0
  84. package/lib/{utils.js → utils.ts} +62 -15
  85. package/lib/version.ts +2 -0
  86. package/lib/web/RNFBStorageModule.android.ts +3 -0
  87. package/lib/web/RNFBStorageModule.ios.ts +3 -0
  88. package/lib/web/RNFBStorageModule.ts +557 -0
  89. package/package.json +41 -7
  90. package/tsconfig.json +23 -0
  91. package/typedoc.json +1 -1
  92. package/lib/modular/index.d.ts +0 -276
  93. package/lib/version.js +0 -2
  94. package/lib/web/RNFBStorageModule.android.js +0 -2
  95. package/lib/web/RNFBStorageModule.ios.js +0 -2
@@ -0,0 +1,189 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import type { ModuleConfig } from '@react-native-firebase/app/dist/module/types/internal';
19
+ import type {
20
+ FirebaseStorage,
21
+ StorageReference,
22
+ EmulatorMockTokenOptions,
23
+ SettableMetadata,
24
+ UploadMetadata,
25
+ Task,
26
+ TaskSnapshot,
27
+ FullMetadata,
28
+ ListResult,
29
+ ListOptions,
30
+ } from './storage';
31
+ import type EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
32
+
33
+ /**
34
+ * Internal Storage type with access to private properties.
35
+ * Used internally by StorageReference and other internal classes.
36
+ */
37
+ export type StorageInternal = FirebaseStorage & {
38
+ native: RNFBStorageModule;
39
+ _customUrlOrRegion: string | null;
40
+ emitter: EventEmitter;
41
+ eventNameForApp: (...args: Array<string | number>) => string;
42
+ _config: ModuleConfig;
43
+ /**
44
+ * Returns a reference to the object at the specified path.
45
+ *
46
+ * @param path - An optional string pointing to a location on the storage bucket. If no path
47
+ * is provided, the returned reference will be the bucket root path.
48
+ */
49
+ ref(path?: string): StorageReference;
50
+
51
+ /**
52
+ * Returns a reference to the object at the specified URL.
53
+ *
54
+ * @param url - A storage bucket URL pointing to a single file or location. Must be either a `gs://` url or an `http` url.
55
+ */
56
+ refFromURL(url: string): StorageReference;
57
+
58
+ /**
59
+ * Sets the maximum time in milliseconds to retry operations if a failure occurs.
60
+ *
61
+ * @param time - The new maximum operation retry time in milliseconds.
62
+ */
63
+ setMaxOperationRetryTime(time: number): Promise<void>;
64
+
65
+ /**
66
+ * Sets the maximum time in milliseconds to retry an upload if a failure occurs.
67
+ *
68
+ * @param time - The new maximum upload retry time in milliseconds.
69
+ */
70
+ setMaxUploadRetryTime(time: number): Promise<void>;
71
+
72
+ /**
73
+ * Sets the maximum time in milliseconds to retry a download if a failure occurs.
74
+ *
75
+ * @param time - The new maximum download retry time in milliseconds.
76
+ */
77
+ setMaxDownloadRetryTime(time: number): Promise<void>;
78
+
79
+ /**
80
+ * Changes this instance to point to a Cloud Storage emulator running locally.
81
+ *
82
+ * @param host - The host of the emulator, e.g. "localhost" or "10.0.2.2" for Android.
83
+ * @param port - The port of the emulator, e.g. 9199.
84
+ * @param options - Optional settings for the emulator connection (web only).
85
+ * @returns {void} - Undocumented return, just used to unit test android host remapping.
86
+ */
87
+ useEmulator(host: string, port: number, options?: EmulatorMockTokenOptions): void;
88
+ };
89
+
90
+ /**
91
+ * Internal Reference type with access to private properties.
92
+ * Used internally by StorageTask and other internal classes.
93
+ */
94
+ export type StorageReferenceInternal = StorageReference & {
95
+ _storage: StorageInternal;
96
+ child(path: string): StorageReference;
97
+ delete(): Promise<void>;
98
+ getDownloadURL(): Promise<string>;
99
+ getMetadata(): Promise<FullMetadata>;
100
+ list(options?: ListOptions): Promise<ListResult>;
101
+ listAll(): Promise<ListResult>;
102
+ put(data: Blob | Uint8Array | ArrayBuffer, metadata?: UploadMetadata): Task;
103
+ putString(
104
+ string: string,
105
+ format?: 'raw' | 'base64' | 'base64url' | 'data_url',
106
+ metadata?: UploadMetadata,
107
+ ): Task;
108
+ updateMetadata(metadata: SettableMetadata): Promise<FullMetadata>;
109
+ writeToFile(filePath: string): Task;
110
+ putFile(filePath: string, metadata?: UploadMetadata): Task;
111
+ };
112
+
113
+ /**
114
+ * Internal ListResult type with access to private properties.
115
+ * Used internally by StorageListResult and other internal classes.
116
+ */
117
+ export type ListResultInternal = {
118
+ nextPageToken?: string | null;
119
+ items: string[];
120
+ prefixes: string[];
121
+ };
122
+
123
+ /**
124
+ * Wrapped native module interface for Storage.
125
+ *
126
+ * Note: React Native Firebase internally wraps native methods and auto-prepends the app name
127
+ * when `hasMultiAppSupport` is enabled. This interface represents the *wrapped* module shape
128
+ * that is exposed as `this.native` within FirebaseModule subclasses.
129
+ */
130
+ export interface RNFBStorageModule {
131
+ /**
132
+ * Native constants exposed on the module.
133
+ * These are read during module construction to seed the JS-side values.
134
+ */
135
+ maxUploadRetryTime?: number;
136
+ maxDownloadRetryTime?: number;
137
+ maxOperationRetryTime?: number;
138
+
139
+ setMaxOperationRetryTime(time: number): Promise<void>;
140
+ setMaxUploadRetryTime(time: number): Promise<void>;
141
+ setMaxDownloadRetryTime(time: number): Promise<void>;
142
+
143
+ delete(url: string): Promise<void>;
144
+ getDownloadURL(url: string): Promise<string>;
145
+ getMetadata(url: string): Promise<FullMetadata>;
146
+ updateMetadata(url: string, metadata: SettableMetadata): Promise<FullMetadata>;
147
+
148
+ list(
149
+ url: string,
150
+ options: { maxResults: number; pageToken?: string },
151
+ ): Promise<ListResultInternal>;
152
+ listAll(url: string): Promise<ListResultInternal>;
153
+
154
+ putString(
155
+ url: string,
156
+ data: string,
157
+ format: string,
158
+ metadata: UploadMetadata | undefined,
159
+ taskId: number,
160
+ ): Promise<TaskSnapshot>;
161
+ putFile(
162
+ url: string,
163
+ filePath: string,
164
+ metadata: UploadMetadata | undefined,
165
+ taskId: number,
166
+ ): Promise<TaskSnapshot>;
167
+ writeToFile(url: string, filePath: string, taskId: number): Promise<TaskSnapshot>;
168
+
169
+ /**
170
+ * Set a running task status.
171
+ * - 0: pause
172
+ * - 1: resume
173
+ * - 2: cancel
174
+ */
175
+ setTaskStatus(taskId: number, status: number): Promise<boolean>;
176
+
177
+ /**
178
+ * Configure storage emulator.
179
+ *
180
+ * iOS does not persist emulator state between calls, so JS sends bucket/customUrlOrRegion through.
181
+ */
182
+ useEmulator(host: string, port: number, customUrlOrRegion?: string | null): void;
183
+ }
184
+
185
+ declare module '@react-native-firebase/app/dist/module/internal/NativeModules' {
186
+ interface ReactNativeFirebaseNativeModules {
187
+ RNFBStorageModule: RNFBStorageModule;
188
+ }
189
+ }
@@ -15,7 +15,7 @@
15
15
  *
16
16
  */
17
17
 
18
- import { ReactNativeFirebase } from '@react-native-firebase/app';
18
+ import type { ReactNativeFirebase } from '@react-native-firebase/app';
19
19
 
20
20
  /**
21
21
  * Firebase Cloud Storage package for React Native.
@@ -53,13 +53,20 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
53
53
  *
54
54
  * @firebase storage
55
55
  */
56
+ /**
57
+ * @deprecated Use the exported types directly instead.
58
+ * FirebaseStorageTypes namespace is kept for backwards compatibility.
59
+ */
60
+ /* eslint-disable @typescript-eslint/no-namespace */
56
61
  export namespace FirebaseStorageTypes {
57
- import FirebaseModule = ReactNativeFirebase.FirebaseModule;
58
- import NativeFirebaseError = ReactNativeFirebase.NativeFirebaseError;
62
+ type FirebaseModule = ReactNativeFirebase.FirebaseModule;
63
+ type NativeFirebaseError = ReactNativeFirebase.NativeFirebaseError;
59
64
 
60
65
  /**
61
66
  * Possible string formats used for uploading via `StorageReference.putString()`
62
67
  *
68
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
69
+ *
63
70
  * ```js
64
71
  * firebase.storage.StringFormat;
65
72
  * ```
@@ -143,19 +150,26 @@ export namespace FirebaseStorageTypes {
143
150
  *
144
151
  * Event subscription is created via `StorageTask.on()`.
145
152
  *
153
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
154
+ *
146
155
  * ```js
147
156
  * firebase.storage.TaskEvent;
148
157
  * ```
149
158
  */
150
- export interface TaskEvent {
151
- /**
152
- * An event that indicates that the tasks state has changed.
153
- *
154
- * ```js
155
- * firebase.storage.TaskEvent.STATE_CHANGED;
156
- * ```
157
- */
158
- STATE_CHANGED: 'state_changed';
159
+ /**
160
+ * An event that is triggered on a task.
161
+ *
162
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
163
+ */
164
+ export type TaskEvent = 'state_changed';
165
+
166
+ /**
167
+ * Static properties for task events (runtime object).
168
+ *
169
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
170
+ */
171
+ export interface TaskEventStatic {
172
+ STATE_CHANGED: TaskEvent;
159
173
  }
160
174
 
161
175
  /**
@@ -163,6 +177,8 @@ export namespace FirebaseStorageTypes {
163
177
  *
164
178
  * An event subscription is created via `StorageTask.on()`.
165
179
  *
180
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
181
+ *
166
182
  * ```js
167
183
  * firebase.storage.TaskEvent;
168
184
  * ```
@@ -171,7 +187,7 @@ export namespace FirebaseStorageTypes {
171
187
  /**
172
188
  * Task has been cancelled by the user.
173
189
  */
174
- CANCELLED: 'cancelled';
190
+ CANCELLED: 'canceled';
175
191
 
176
192
  /**
177
193
  * An Error occurred, see TaskSnapshot.error for details.
@@ -194,9 +210,20 @@ export namespace FirebaseStorageTypes {
194
210
  SUCCESS: 'success';
195
211
  }
196
212
 
213
+ /**
214
+ * Represents the current state of a running upload.
215
+ *
216
+ * Note: The Firebase JS SDK uses "canceled" (one L). React Native Firebase historically used "cancelled" (two L).
217
+ *
218
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
219
+ */
220
+ export type TaskStateType = 'running' | 'paused' | 'success' | 'canceled' | 'error';
221
+
197
222
  /**
198
223
  * Cloud Storage statics.
199
224
  *
225
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
226
+ *
200
227
  * #### Example
201
228
  *
202
229
  * ```js
@@ -235,14 +262,16 @@ export namespace FirebaseStorageTypes {
235
262
  * firebase.storage.TaskEvent;
236
263
  * ```
237
264
  */
238
- TaskEvent: TaskEvent;
265
+ TaskEvent: TaskEventStatic;
239
266
  SDK_VERSION: string;
240
267
  }
241
268
 
242
269
  /**
243
- * An interface representing all the metadata properties that can be set.
270
+ * Object metadata that can be set at any time.
244
271
  *
245
272
  * This is used in updateMetadata, put, putString & putFile.
273
+ *
274
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
246
275
  */
247
276
  export interface SettableMetadata {
248
277
  /**
@@ -270,28 +299,28 @@ export namespace FirebaseStorageTypes {
270
299
  *
271
300
  * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control)
272
301
  */
273
- cacheControl?: string | null;
302
+ cacheControl?: string | undefined;
274
303
 
275
304
  /**
276
305
  * The 'Content-Disposition' HTTP header that will be set on the storage object when it's requested.
277
306
  *
278
307
  * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
279
308
  */
280
- contentDisposition?: string | null;
309
+ contentDisposition?: string | undefined;
281
310
 
282
311
  /**
283
312
  * The 'Content-Encoding' HTTP header that will be used on the storage object when it's requested.
284
313
  *
285
314
  * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding)
286
315
  */
287
- contentEncoding?: string | null;
316
+ contentEncoding?: string | undefined;
288
317
 
289
318
  /**
290
319
  * The 'Content-Language' HTTP header that will be set on the storage object when it's requested.
291
320
  *
292
321
  * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language)
293
322
  */
294
- contentLanguage?: string | null;
323
+ contentLanguage?: string | undefined;
295
324
 
296
325
  /**
297
326
  * The 'Content-Type' HTTP header that will be set on the object when it's requested.
@@ -314,17 +343,12 @@ export namespace FirebaseStorageTypes {
314
343
  *
315
344
  * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type)
316
345
  */
317
- contentType?: string | null;
318
-
319
- /**
320
- * You may specify the md5hash of the file in metadata on upload only. It may not be updated via updateMetadata
321
- */
322
- md5hash?: string | null;
346
+ contentType?: string | undefined;
323
347
 
324
348
  /**
325
349
  * Additional user-defined custom metadata for this storage object.
326
350
  *
327
- * All values must be strings. Set to null to delete all. Any keys ommitted during update will be removed.
351
+ * All values must be strings.
328
352
  *
329
353
  * #### Example
330
354
  *
@@ -337,20 +361,31 @@ export namespace FirebaseStorageTypes {
337
361
  * },
338
362
  * }
339
363
  */
340
- customMetadata?: {
341
- [key: string]: string;
342
- } | null;
364
+ customMetadata?:
365
+ | {
366
+ [key: string]: string;
367
+ }
368
+ | undefined;
343
369
  }
344
370
 
345
371
  /**
346
- * The full readable metadata returned by `TaskSnapshot.metadata` or `StorageReference.getMetadata()`.
372
+ * Object metadata that can be set at upload.
373
+ *
374
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
347
375
  */
348
- export interface FullMetadata extends SettableMetadata {
376
+ export interface UploadMetadata extends SettableMetadata {
349
377
  /**
350
- * A Base64-encoded MD5 hash of the storage object being uploaded.
378
+ * A Base64-encoded MD5 hash of the object being uploaded.
351
379
  */
352
- md5Hash: string | null;
380
+ md5Hash?: string | undefined;
381
+ }
353
382
 
383
+ /**
384
+ * The full readable metadata returned by `TaskSnapshot.metadata` or `StorageReference.getMetadata()`.
385
+ *
386
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
387
+ */
388
+ export interface FullMetadata extends UploadMetadata {
354
389
  /**
355
390
  * The bucket this storage object is contained in.
356
391
  *
@@ -424,6 +459,16 @@ export namespace FirebaseStorageTypes {
424
459
  * ```
425
460
  */
426
461
  updated: string;
462
+
463
+ /**
464
+ * Tokens to allow access to the download URL.
465
+ */
466
+ downloadTokens: string[] | undefined;
467
+
468
+ /**
469
+ * `StorageReference` associated with this upload.
470
+ */
471
+ ref?: Reference | undefined;
427
472
  }
428
473
 
429
474
  /**
@@ -431,6 +476,8 @@ export namespace FirebaseStorageTypes {
431
476
  *
432
477
  * A reference can be used to upload and download storage objects, get/set storage object metadata, retrieve storage object download urls and delete storage objects.
433
478
  *
479
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
480
+ *
434
481
  * #### Example 1
435
482
  *
436
483
  * Get a reference to a specific storage path.
@@ -594,9 +641,9 @@ export namespace FirebaseStorageTypes {
594
641
  * ```
595
642
  *
596
643
  * @param localFilePath The local file path to upload to the bucket at the reference location.
597
- * @param metadata Any additional `SettableMetadata` for this task.
644
+ * @param metadata Any additional `UploadMetadata` for this task.
598
645
  */
599
- putFile(localFilePath: string, metadata?: SettableMetadata): Task;
646
+ putFile(localFilePath: string, metadata?: UploadMetadata): Task;
600
647
 
601
648
  /**
602
649
  * Downloads a file to the specified local file path on the device.
@@ -629,7 +676,7 @@ export namespace FirebaseStorageTypes {
629
676
  * @param data The data to upload to the storage bucket at the reference location.
630
677
  * @param metadata
631
678
  */
632
- put(data: Blob | Uint8Array | ArrayBuffer, metadata?: SettableMetadata): Task;
679
+ put(data: Blob | Uint8Array | ArrayBuffer, metadata?: UploadMetadata): Task;
633
680
 
634
681
  /**
635
682
  * Puts a string on the storage bucket. Depending on the string type, set a {@link StringFormat} type.
@@ -645,12 +692,12 @@ export namespace FirebaseStorageTypes {
645
692
  *
646
693
  * @param data The string data, must match the format provided.
647
694
  * @param format The format type of the string, e.g. a Base64 format string.
648
- * @param metadata Any additional `SettableMetadata` for this task.
695
+ * @param metadata Any additional `UploadMetadata` for this task.
649
696
  */
650
697
  putString(
651
698
  data: string,
652
699
  format?: 'raw' | 'base64' | 'base64url' | 'data_url',
653
- metadata?: SettableMetadata,
700
+ metadata?: UploadMetadata,
654
701
  ): Task;
655
702
 
656
703
  /**
@@ -677,6 +724,8 @@ export namespace FirebaseStorageTypes {
677
724
  *
678
725
  * #### Example
679
726
  *
727
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
728
+ *
680
729
  * ```js
681
730
  * const ref = firebase.storage().ref(...);
682
731
  * const task = ref.put(...)
@@ -700,19 +749,19 @@ export namespace FirebaseStorageTypes {
700
749
  *
701
750
  * @param taskSnapshot A `TaskSnapshot` for the event.
702
751
  */
703
- next: (taskSnapshot: TaskSnapshot) => void;
752
+ next?: (taskSnapshot: TaskSnapshot) => void;
704
753
 
705
754
  /**
706
755
  * Called when the task errors.
707
756
  *
708
757
  * @param error A JavaScript error.
709
758
  */
710
- error: (error: NativeFirebaseError) => void;
759
+ error?: (error: NativeFirebaseError) => void;
711
760
 
712
761
  /**
713
762
  * Called when the task has completed successfully.
714
763
  */
715
- complete: () => void;
764
+ complete?: () => void;
716
765
  }
717
766
 
718
767
  /**
@@ -720,6 +769,8 @@ export namespace FirebaseStorageTypes {
720
769
  *
721
770
  * #### Example 1
722
771
  *
772
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
773
+ *
723
774
  * Get a Upload Storage task to upload a string:
724
775
  *
725
776
  * ```js
@@ -859,6 +910,8 @@ export namespace FirebaseStorageTypes {
859
910
  *
860
911
  * #### Example 1
861
912
  *
913
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
914
+ *
862
915
  * ```js
863
916
  * firebase
864
917
  * .storage()
@@ -906,7 +959,7 @@ export namespace FirebaseStorageTypes {
906
959
  /**
907
960
  * The current state of the task snapshot.
908
961
  */
909
- state: 'cancelled' | 'error' | 'paused' | 'running' | 'success';
962
+ state: TaskState;
910
963
 
911
964
  /**
912
965
  * The parent {@link Task} of this snapshot.
@@ -927,6 +980,8 @@ export namespace FirebaseStorageTypes {
927
980
 
928
981
  /**
929
982
  * Result returned from a non-resumable upload.
983
+ *
984
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
930
985
  */
931
986
  export interface TaskResult {
932
987
  /**
@@ -942,6 +997,8 @@ export namespace FirebaseStorageTypes {
942
997
 
943
998
  /**
944
999
  * The options `list()` accepts.
1000
+ *
1001
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
945
1002
  */
946
1003
  export interface ListOptions {
947
1004
  /**
@@ -952,11 +1009,13 @@ export namespace FirebaseStorageTypes {
952
1009
  /**
953
1010
  * The `nextPageToken` from a previous call to `list()`. If provided, listing is resumed from the previous position.
954
1011
  */
955
- pageToken?: string;
1012
+ pageToken?: string | null;
956
1013
  }
957
1014
 
958
1015
  /**
959
1016
  * Result returned by `list()`.
1017
+ *
1018
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
960
1019
  */
961
1020
  export interface ListResult {
962
1021
  /**
@@ -979,6 +1038,8 @@ export namespace FirebaseStorageTypes {
979
1038
 
980
1039
  /**
981
1040
  * Storage Emulator options. Web only.
1041
+ *
1042
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
982
1043
  */
983
1044
  export interface EmulatorMockTokenOptions {
984
1045
  /**
@@ -992,6 +1053,8 @@ export namespace FirebaseStorageTypes {
992
1053
  *
993
1054
  * #### Example 1
994
1055
  *
1056
+ * @deprecated Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
1057
+ *
995
1058
  * Get the storage instance for the **default app**:
996
1059
  *
997
1060
  * ```js
@@ -1020,7 +1083,7 @@ export namespace FirebaseStorageTypes {
1020
1083
  * ```
1021
1084
  *
1022
1085
  */
1023
- export class Module extends FirebaseModule {
1086
+ export interface Module extends FirebaseModule {
1024
1087
  /**
1025
1088
  * The current `FirebaseApp` instance for this Firebase service.
1026
1089
  */
@@ -1141,8 +1204,8 @@ export namespace FirebaseStorageTypes {
1141
1204
  * If you want to use the emulator on a real android device, you will need to specify the actual host
1142
1205
  * computer IP address.
1143
1206
  *
1144
- * @param host: emulator host (eg, 'localhost')
1145
- * @param port: emulator port (eg, 9199)
1207
+ * @param host emulator host (eg, 'localhost')
1208
+ * @param port emulator port (eg, 9199)
1146
1209
  */
1147
1210
  useEmulator(host: string, port: number): void;
1148
1211
  }
@@ -1158,7 +1221,7 @@ type StorageNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<
1158
1221
 
1159
1222
  declare const defaultExport: StorageNamespace;
1160
1223
 
1161
- export const firebase: ReactNativeFirebase.Module & {
1224
+ export declare const firebase: ReactNativeFirebase.Module & {
1162
1225
  storage: typeof defaultExport;
1163
1226
  app(name?: string): ReactNativeFirebase.FirebaseApp & { storage(): FirebaseStorageTypes.Module };
1164
1227
  };
@@ -1168,6 +1231,7 @@ export default defaultExport;
1168
1231
  /**
1169
1232
  * Attach namespace to `firebase.` and `FirebaseApp.`.
1170
1233
  */
1234
+
1171
1235
  declare module '@react-native-firebase/app' {
1172
1236
  namespace ReactNativeFirebase {
1173
1237
  import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;
@@ -1182,5 +1246,3 @@ declare module '@react-native-firebase/app' {
1182
1246
  }
1183
1247
  }
1184
1248
  }
1185
-
1186
- export * from './modular';