UNPKG

@push.rocks/smartbucket

Version:

A TypeScript library providing a cloud-agnostic interface for managing object storage with functionalities like bucket management, file and directory operations, and advanced features such as metadata handling and file locking.

42 lines (41 loc) 1.17 kB
import type { Bucket } from './classes.bucket.js'; export interface IListCursorOptions { pageSize?: number; } export interface IListCursorResult { keys: string[]; done: boolean; } /** * ListCursor provides explicit pagination control for listing objects in a bucket. * Useful for UI pagination, resumable operations, and manual batch processing. */ export declare class ListCursor { private bucket; private prefix; private continuationToken?; private exhausted; private pageSize; constructor(bucket: Bucket, prefix: string, options?: IListCursorOptions); /** * Fetch the next page of object keys * @returns Object with keys array and done flag */ next(): Promise<IListCursorResult>; /** * Check if there are more pages to fetch */ hasMore(): boolean; /** * Reset the cursor to start from the beginning */ reset(): void; /** * Get the current continuation token (for saving/restoring state) */ getToken(): string | undefined; /** * Set the continuation token (for resuming from a saved state) */ setToken(token: string | undefined): void; }