File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
``` ts
6
6
7
- import { FirebaseApp } from ' @firebase/app' ;
7
+ import { FirebaseApp } from ' @firebase/app-types ' ;
8
8
import { FirebaseStorageError } from ' @firebase/storage-types/exp' ;
9
9
import { FullMetadata } from ' @firebase/storage-types/exp' ;
10
10
import { ListOptions } from ' @firebase/storage-types/exp' ;
@@ -33,7 +33,7 @@ export function getDownloadURL(ref: StorageReference): Promise<string>;
33
33
export function getMetadata(ref : StorageReference ): Promise <FullMetadata >;
34
34
35
35
// @public
36
- export function getStorage(app : FirebaseApp , url ? : string ): StorageService ;
36
+ export function getStorage(app : FirebaseApp , bucketUrl ? : string ): StorageService ;
37
37
38
38
// @public
39
39
export function list(ref : StorageReference , options ? : ListOptions ): Promise <ListResult >;
Original file line number Diff line number Diff line change @@ -294,15 +294,22 @@ const STORAGE_TYPE = 'storage-exp';
294
294
* Gets a Firebase StorageService instance for the given Firebase app.
295
295
* @public
296
296
* @param app - Firebase app to get Storage instance for.
297
+ * @param bucketUrl - The gs:// url to your Firebase Storage Bucket.
298
+ * If not passed, uses the app's default Storage Bucket.
297
299
* @returns A Firebase StorageService instance.
298
300
*/
299
- export function getStorage ( app : FirebaseApp , url ?: string ) : StorageService {
301
+ export function getStorage (
302
+ app : FirebaseApp ,
303
+ bucketUrl ?: string
304
+ ) : StorageService {
300
305
// Dependencies
301
306
const storageProvider : Provider < 'storage-exp' > = _getProvider (
302
307
app ,
303
308
STORAGE_TYPE
304
309
) ;
305
- const storageInstance = storageProvider . getImmediate ( { identifier : url } ) ;
310
+ const storageInstance = storageProvider . getImmediate ( {
311
+ identifier : bucketUrl
312
+ } ) ;
306
313
return storageInstance ;
307
314
}
308
315
You can’t perform that action at this time.
0 commit comments