Skip to content

Commit 921e05d

Browse files
committed
feat: 🎸 define .scan() CRUD method
1 parent 577ee35 commit 921e05d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎src/crud/types.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ export interface CrudApi {
4646
*/
4747
drop: (collection: CrudCollection, silent?: boolean) => Promise<void>;
4848

49+
/**
50+
* Iterates over all resources of a collection.
51+
*
52+
* @param collection Type of the resource, collection name.
53+
* @returns Iterator of resources of the given type.
54+
*/
55+
scan: (collection: CrudCollection) => AsyncIterableIterator<CrudCollectionEntry>;
56+
4957
/**
5058
* Fetches a list of resources of a collection, and sub-collections.
5159
*
@@ -84,8 +92,3 @@ export interface CrudResourceInfo extends CrudCollectionEntry {
8492
/** Timestamp when the resource was created. */
8593
created?: number;
8694
}
87-
88-
export interface CrudScanResult {
89-
cursor: string | '';
90-
list: CrudCollectionEntry[];
91-
}

0 commit comments

Comments
 (0)