Skip to content

Commit 2e052ea

Browse files
committed
doc
1 parent 31fe235 commit 2e052ea

File tree

2 files changed

+40
-13
lines changed

2 files changed

+40
-13
lines changed

packages/firebase/index.d.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5435,7 +5435,24 @@ declare namespace firebase.storage {
54355435
*/
54365436
updateMetadata(metadata: firebase.storage.SettableMetadata): Promise<any>;
54375437
/**
5438-
* List items(files) and prefixes(folders) with this prefix of ref.name+'/'.
5438+
* List all items (files) and prefixes (folders) under this storage reference.
5439+
*
5440+
* It is a helper method for calling list() recursively until there is no
5441+
* more results. The default pagination size is 200.
5442+
*
5443+
* Note: the results may not be a consistent snapshot if objects are changed
5444+
* between paginating requests.
5445+
*
5446+
* Warning: If there are
5447+
*
5448+
* @return A promise that resolves with all the items and prefixes under
5449+
* the current storage reference. `prefixes` contains references to
5450+
* sub-directories and `items` contains references to objects in this
5451+
* folder. `nextPageToken` is never returned.
5452+
*/
5453+
listAll(): Promise<ListResult>;
5454+
/**
5455+
* List items (files) and prefixes (folders) under this storage reference.
54395456
*
54405457
* GCS is a key-blob store. Firebase storage impose the semantic of '/'
54415458
* delimited folder structure.
@@ -5468,10 +5485,10 @@ declare namespace firebase.storage {
54685485
*/
54695486
interface ListResult {
54705487
/**
5471-
* References to sub-folders. You can call list() on them to get its contents.
5472-
* GCS's
5488+
* References to prefixes (sub-folders). You can call list() on them to
5489+
* get its contents.
54735490
*
5474-
* Folders are implict based on '/' in the object paths.
5491+
* Folders are implicit based on '/' in the object paths.
54755492
* For example, if a bucket has two objects '/a/b/1' and '/a/b/2', list('/a')
54765493
* will return '/a/b' as a prefix.
54775494
*/
@@ -5492,7 +5509,7 @@ declare namespace firebase.storage {
54925509
*/
54935510
interface ListOptions {
54945511
/**
5495-
* The maximum number of results (items+prefixs) returned.
5512+
* The maximum number of results (items and prefixes) returned.
54965513
*/
54975514
maxResults?: number | null;
54985515
/**

packages/storage/src/reference.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class Reference {
204204
}
205205

206206
/**
207-
* List all items and prefixes under the current storage reference.
207+
* List all items (files) and prefixes (folders) under this storage reference.
208208
*
209209
* It is a helper method for calling list() recursively until there is no
210210
* more results. The default pagination size is 200.
@@ -245,20 +245,30 @@ export class Reference {
245245
}
246246

247247
/**
248-
* List items and prefixes within this directory.
248+
* List items (files) and prefixes (folders) under this storage reference.
249249
*
250-
* "/" is treated as a path delimiter. Firebase storage does not support
251-
* invalid object path that ends with "/" or contains two consecutive "//".
252-
* All invalid objects in GCS will be filtered.
250+
* GCS is a key-blob store. Firebase storage impose the semantic of '/'
251+
* delimited folder structure.
252+
* Objects whose paths, aside from the prefix, contain '/' will have
253+
* their path, truncated after the '/', returned in prefixes.
254+
* Duplicate prefixes are omitted.
255+
* Objects whose paths, aside from the prefix, do not contain '/' will
256+
* be returned in items.
257+
*
258+
* Firebase storage does not support invalid object paths that end with
259+
* "/" or contain two consecutive "/"s. All invalid objects in GCS will be
260+
* filtered by GCS.
261+
* list() may fail if there are too many invalid objects in the bucket.
253262
*
254263
* @param options.maxResults If set, limits the total number of `prefixes`
255-
* and `items` to return.
264+
* and `items` to return. The default and maximum maxResults is 1000.
265+
* Use the nextPageToken to retrieve more objects.
256266
* @param options.pageToken The `nextPageToken` from a previous call to
257267
* list(). If provided, listing is resumed from the previous position.
258268
* @return A promise that resolves with the items and prefixes.
259-
* `prefixes` contains references to prefixes and `items`
269+
* `prefixes` contains references to sub-folders and `items`
260270
* contains references to objects in this folder. `nextPageToken`
261-
* can be passed as `options.pageToken` to get the rest of results.
271+
* can be used to get the rest of the results.
262272
*/
263273
list(options?: ListOptions | null): Promise<ListResult> {
264274
args.validate('list', [listOptionSpec(true)], arguments);

0 commit comments

Comments
 (0)