|
4 | 4 |
|
5 | 5 | ```ts
|
6 | 6 |
|
7 |
| -import { FirebaseApp } from '@firebase/app-types-exp'; |
| 7 | +import { FirebaseApp } from '@firebase/app-types'; |
8 | 8 | import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
|
9 | 9 | import { FirebaseError } from '@firebase/util';
|
10 |
| -import { _FirebaseService } from '@firebase/app-types-exp'; |
| 10 | +import { _FirebaseService } from '@firebase/app-types'; |
11 | 11 | import { Provider } from '@firebase/component';
|
12 | 12 | import * as types from '@firebase/storage-types';
|
13 | 13 |
|
14 |
| -// Warning: (ae-forgotten-export) The symbol "StorageReference" needs to be exported by the entry point index.d.ts |
15 |
| -// |
16 | 14 | // @public
|
17 | 15 | export function deleteObject(ref: StorageReference): Promise<void>;
|
18 | 16 |
|
19 | 17 | // @public
|
20 | 18 | export function getDownloadURL(ref: StorageReference): Promise<string>;
|
21 | 19 |
|
22 |
| -// Warning: (ae-forgotten-export) The symbol "Metadata" needs to be exported by the entry point index.d.ts |
23 |
| -// |
24 | 20 | // @public
|
25 | 21 | export function getMetadata(ref: StorageReference): Promise<Metadata>;
|
26 | 22 |
|
27 |
| -// Warning: (ae-forgotten-export) The symbol "StorageService" needs to be exported by the entry point index.d.ts |
28 |
| -// |
29 | 23 | // @public
|
30 | 24 | export function getStorage(app: FirebaseApp): StorageService;
|
31 | 25 |
|
32 |
| -// Warning: (ae-forgotten-export) The symbol "ListOptions" needs to be exported by the entry point index.d.ts |
33 |
| -// Warning: (ae-forgotten-export) The symbol "ListResult" needs to be exported by the entry point index.d.ts |
34 |
| -// |
35 | 26 | // @public
|
36 | 27 | export function list(ref: StorageReference, options?: ListOptions | null): Promise<ListResult>;
|
37 | 28 |
|
38 | 29 | // @public
|
39 | 30 | export function listAll(ref: StorageReference): Promise<ListResult>;
|
40 | 31 |
|
| 32 | +// @public |
| 33 | +export interface ListOptions extends types.ListOptions { |
| 34 | +} |
| 35 | + |
| 36 | +// @public |
| 37 | +export interface ListResult { |
| 38 | + // (undocumented) |
| 39 | + items: StorageReference[]; |
| 40 | + // (undocumented) |
| 41 | + nextPageToken?: string; |
| 42 | + // (undocumented) |
| 43 | + prefixes: StorageReference[]; |
| 44 | +} |
| 45 | + |
| 46 | +// @public |
| 47 | +export interface Metadata extends types.FullMetadata { |
| 48 | + // (undocumented) |
| 49 | + [prop: string]: unknown; |
| 50 | + // (undocumented) |
| 51 | + cacheControl: string | undefined; |
| 52 | + // (undocumented) |
| 53 | + contentDisposition: string | undefined; |
| 54 | + // (undocumented) |
| 55 | + contentEncoding: string | undefined; |
| 56 | + // (undocumented) |
| 57 | + contentLanguage: string | undefined; |
| 58 | + // (undocumented) |
| 59 | + contentType: string | undefined; |
| 60 | + // (undocumented) |
| 61 | + customMetadata: { |
| 62 | + [key: string]: string; |
| 63 | + } | undefined; |
| 64 | + // (undocumented) |
| 65 | + downloadTokens: string[] | undefined; |
| 66 | + // (undocumented) |
| 67 | + md5Hash: string | undefined; |
| 68 | + // (undocumented) |
| 69 | + ref: StorageReference | undefined; |
| 70 | + // (undocumented) |
| 71 | + type: string | undefined; |
| 72 | +} |
| 73 | + |
41 | 74 | // @public
|
42 | 75 | export function ref(storage: StorageService, url?: string): StorageReference;
|
43 | 76 |
|
44 | 77 | // @public
|
45 | 78 | export function ref(storageOrRef: StorageService | StorageReference, path?: string): StorageReference;
|
46 | 79 |
|
| 80 | +// @public |
| 81 | +export class StorageReference { |
| 82 | + constructor(_service: StorageService, location: string | Location_2); |
| 83 | + // (undocumented) |
| 84 | + get bucket(): string; |
| 85 | + // (undocumented) |
| 86 | + get fullPath(): string; |
| 87 | + // Warning: (ae-forgotten-export) The symbol "Location" needs to be exported by the entry point index.d.ts |
| 88 | + // |
| 89 | + // @internal (undocumented) |
| 90 | + _location: Location_2; |
| 91 | + // (undocumented) |
| 92 | + get name(): string; |
| 93 | + // (undocumented) |
| 94 | + protected newRef(service: StorageService, location: Location_2): StorageReference; |
| 95 | + // (undocumented) |
| 96 | + get parent(): StorageReference | null; |
| 97 | + // (undocumented) |
| 98 | + get root(): StorageReference; |
| 99 | + // (undocumented) |
| 100 | + get storage(): StorageService; |
| 101 | + // (undocumented) |
| 102 | + _throwIfRoot(name: string): void; |
| 103 | + // @override (undocumented) |
| 104 | + toString(): string; |
| 105 | +} |
| 106 | + |
| 107 | +// @public |
| 108 | +export class StorageService implements _FirebaseService { |
| 109 | + constructor(app: FirebaseApp, |
| 110 | + _authProvider: Provider<FirebaseAuthInternalName>, |
| 111 | + _pool: XhrIoPool, |
| 112 | + _url?: string | undefined, |
| 113 | + _firebaseVersion?: string | undefined); |
| 114 | + // (undocumented) |
| 115 | + readonly app: FirebaseApp; |
| 116 | + // (undocumented) |
| 117 | + protected readonly _appId: string | null; |
| 118 | + // @internal (undocumented) |
| 119 | + readonly _authProvider: Provider<FirebaseAuthInternalName>; |
| 120 | + // @internal (undocumented) |
| 121 | + readonly _bucket: Location_2 | null; |
| 122 | + // @internal |
| 123 | + _delete(): Promise<void>; |
| 124 | + // @internal (undocumented) |
| 125 | + readonly _firebaseVersion?: string | undefined; |
| 126 | + // (undocumented) |
| 127 | + getAuthToken(): Promise<string | null>; |
| 128 | + // Warning: (ae-forgotten-export) The symbol "RequestInfo" needs to be exported by the entry point index.d.ts |
| 129 | + // Warning: (ae-forgotten-export) The symbol "Request" needs to be exported by the entry point index.d.ts |
| 130 | + // |
| 131 | + // @internal (undocumented) |
| 132 | + makeRequest<T>(requestInfo: RequestInfo_2<T>, authToken: string | null): Request_2<T>; |
| 133 | + makeStorageReference(loc: Location_2): StorageReference; |
| 134 | + // (undocumented) |
| 135 | + get maxOperationRetryTime(): number; |
| 136 | + set maxOperationRetryTime(time: number); |
| 137 | + // (undocumented) |
| 138 | + get maxUploadRetryTime(): number; |
| 139 | + set maxUploadRetryTime(time: number); |
| 140 | + // Warning: (ae-forgotten-export) The symbol "XhrIoPool" needs to be exported by the entry point index.d.ts |
| 141 | + // |
| 142 | + // @internal (undocumented) |
| 143 | + readonly _pool: XhrIoPool; |
| 144 | + // @internal (undocumented) |
| 145 | + readonly _url?: string | undefined; |
| 146 | +} |
| 147 | + |
| 148 | +// @public |
| 149 | +export type StringFormat = string; |
| 150 | + |
| 151 | +// @public |
| 152 | +export const StringFormat: { |
| 153 | + RAW: string; |
| 154 | + BASE64: string; |
| 155 | + BASE64URL: string; |
| 156 | + DATA_URL: string; |
| 157 | +}; |
| 158 | + |
47 | 159 | // @public
|
48 | 160 | export function updateMetadata(ref: StorageReference, metadata: Record<string, unknown>): Promise<Metadata>;
|
49 | 161 |
|
50 |
| -// Warning: (ae-forgotten-export) The symbol "UploadTaskSnapshot" needs to be exported by the entry point index.d.ts |
51 |
| -// |
52 | 162 | // @public
|
53 |
| -export function uploadBytes(ref: StorageReference, data: Blob | Uint8Array | ArrayBuffer, metadata?: Metadata): Promise<UploadTaskSnapshot>; |
| 163 | +export function uploadBytes(ref: StorageReference, data: Blob | Uint8Array | ArrayBuffer, metadata?: Metadata): Promise<UploadResult>; |
54 | 164 |
|
55 |
| -// Warning: (ae-forgotten-export) The symbol "UploadTask" needs to be exported by the entry point index.d.ts |
56 |
| -// |
57 | 165 | // @public
|
58 | 166 | export function uploadBytesResumable(ref: StorageReference, data: Blob | Uint8Array | ArrayBuffer, metadata?: Metadata): UploadTask;
|
59 | 167 |
|
60 |
| -// Warning: (ae-forgotten-export) The symbol "StringFormat" needs to be exported by the entry point index.d.ts |
61 |
| -// |
62 | 168 | // @public
|
63 |
| -export function uploadString(ref: StorageReference, value: string, format?: StringFormat, metadata?: Metadata): Promise<UploadTaskSnapshot>; |
| 169 | +export interface UploadResult { |
| 170 | + // (undocumented) |
| 171 | + readonly metadata: Metadata; |
| 172 | + // (undocumented) |
| 173 | + readonly ref: StorageReference; |
| 174 | +} |
| 175 | + |
| 176 | +// @public |
| 177 | +export function uploadString(ref: StorageReference, value: string, format?: StringFormat, metadata?: Metadata): Promise<UploadResult>; |
| 178 | + |
| 179 | +// @public |
| 180 | +export class UploadTask { |
| 181 | + constructor(ref: StorageReference, blob: FbsBlob, metadata?: Metadata | null); |
| 182 | + // Warning: (ae-forgotten-export) The symbol "FbsBlob" needs to be exported by the entry point index.d.ts |
| 183 | + // |
| 184 | + // @internal (undocumented) |
| 185 | + _blob: FbsBlob; |
| 186 | + cancel(): boolean; |
| 187 | + catch<T>(onRejected: (p1: FirebaseStorageError) => T | Promise<T>): Promise<T>; |
| 188 | + // @internal (undocumented) |
| 189 | + _metadata: Metadata | null; |
| 190 | + // Warning: (ae-forgotten-export) The symbol "TaskEvent" needs to be exported by the entry point index.d.ts |
| 191 | + // Warning: (ae-forgotten-export) The symbol "StorageObserver" needs to be exported by the entry point index.d.ts |
| 192 | + // Warning: (ae-forgotten-export) The symbol "ErrorFn" needs to be exported by the entry point index.d.ts |
| 193 | + // Warning: (ae-forgotten-export) The symbol "CompleteFn" needs to be exported by the entry point index.d.ts |
| 194 | + // Warning: (ae-forgotten-export) The symbol "Unsubscribe" needs to be exported by the entry point index.d.ts |
| 195 | + // Warning: (ae-forgotten-export) The symbol "Subscribe" needs to be exported by the entry point index.d.ts |
| 196 | + on(type: TaskEvent, nextOrObserver?: StorageObserver<UploadTaskSnapshot> | ((a: UploadTaskSnapshot) => unknown), error?: ErrorFn, completed?: CompleteFn): Unsubscribe | Subscribe<UploadTaskSnapshot>; |
| 197 | + pause(): boolean; |
| 198 | + resume(): boolean; |
| 199 | + // (undocumented) |
| 200 | + get snapshot(): UploadTaskSnapshot; |
| 201 | + // Warning: (ae-forgotten-export) The symbol "InternalTaskState" needs to be exported by the entry point index.d.ts |
| 202 | + // |
| 203 | + // @internal (undocumented) |
| 204 | + _state: InternalTaskState; |
| 205 | + // Warning: (ae-forgotten-export) The symbol "FirebaseStorageError" needs to be exported by the entry point index.d.ts |
| 206 | + then<U>(onFulfilled?: ((value: UploadTaskSnapshot) => U | Promise<U>) | null, onRejected?: ((error: FirebaseStorageError) => U | Promise<U>) | null): Promise<U>; |
| 207 | + // @internal (undocumented) |
| 208 | + _transferred: number; |
| 209 | + } |
| 210 | + |
| 211 | +// @public |
| 212 | +export interface UploadTaskSnapshot { |
| 213 | + // (undocumented) |
| 214 | + readonly bytesTransferred: number; |
| 215 | + // (undocumented) |
| 216 | + readonly metadata: Metadata; |
| 217 | + // (undocumented) |
| 218 | + readonly ref: StorageReference; |
| 219 | + // Warning: (ae-forgotten-export) The symbol "TaskState" needs to be exported by the entry point index.d.ts |
| 220 | + // |
| 221 | + // (undocumented) |
| 222 | + readonly state: TaskState; |
| 223 | + // (undocumented) |
| 224 | + readonly task: UploadTask; |
| 225 | + // (undocumented) |
| 226 | + readonly totalBytes: number; |
| 227 | +} |
64 | 228 |
|
65 | 229 |
|
66 | 230 | // (No @packageDocumentation comment for this package)
|
|
0 commit comments