diff --git a/src/crud/types.ts b/src/crud/types.ts index 13a100c8d..1f39554c9 100644 --- a/src/crud/types.ts +++ b/src/crud/types.ts @@ -46,6 +46,14 @@ export interface CrudApi { */ drop: (collection: CrudCollection, silent?: boolean) => Promise; + /** + * Iterates over all resources of a collection. + * + * @param collection Type of the resource, collection name. + * @returns Iterator of resources of the given type. + */ + scan: (collection: CrudCollection) => AsyncIterableIterator; + /** * Fetches a list of resources of a collection, and sub-collections. * @@ -84,8 +92,3 @@ export interface CrudResourceInfo extends CrudCollectionEntry { /** Timestamp when the resource was created. */ created?: number; } - -export interface CrudScanResult { - cursor: string | ''; - list: CrudCollectionEntry[]; -}