MCPcopy Index your code
hub / github.com/NativeScript/firebase / Storage

Class Storage

packages/firebase-storage/index.android.ts:567–643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565}
566
567export class Storage implements IStorage {
568 _native: com.google.firebase.storage.FirebaseStorage;
569 _app: FirebaseApp;
570
571 constructor(app?: FirebaseApp) {
572 if (app?.native) {
573 this._native = com.google.firebase.storage.FirebaseStorage.getInstance(app.native);
574 } else {
575 if (defaultStorage) {
576 return defaultStorage;
577 }
578 defaultStorage = this;
579 this._native = com.google.firebase.storage.FirebaseStorage.getInstance();
580 }
581 }
582
583 static fromNative(storage: com.google.firebase.storage.FirebaseStorage) {
584 if (storage instanceof com.google.firebase.storage.FirebaseStorage) {
585 const store = new Storage();
586 store._native = storage;
587 return store;
588 }
589 return null;
590 }
591
592 useEmulator(host: string, port: number) {
593 this.native.useEmulator(host === 'localhost' || host === '127.0.0.1' ? '10.0.2.2' : host, port);
594 }
595
596 ref(path?: string): Reference {
597 return Reference.fromNative(this.native.getReference(path || '/'));
598 }
599
600 refFromURL(url: string): Reference {
601 return Reference.fromNative(this.native.getReferenceFromUrl(url));
602 }
603
604 get native() {
605 return this._native;
606 }
607
608 get android() {
609 return this.native;
610 }
611
612 get app(): FirebaseApp {
613 if (!this._app) {
614 // @ts-ignore
615 this._app = FirebaseApp.fromNative(this.native.app);
616 }
617 return this._app;
618 }
619
620 get maxDownloadRetryTime(): number {
621 return this.native?.getMaxDownloadRetryTimeMillis?.() ?? 0 / 1000;
622 }
623
624 set maxDownloadRetryTime(value) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…