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.

51 lines (50 loc) 1.53 kB
import type { Directory } from "./classes.directory.js"; export interface IPathDecriptor { path?: string; directory?: Directory; } /** * Internal state tracking for a storage object */ export interface IStorageObjectState { key: string; etag: string; size: number; lastModified: Date; } /** * Change event emitted by BucketWatcher */ export interface IStorageChangeEvent { type: 'add' | 'modify' | 'delete'; key: string; size?: number; etag?: string; lastModified?: Date; bucket: string; } /** * Watcher mode - 'poll' is the default, 'websocket' reserved for future implementation */ export type TBucketWatcherMode = 'poll' | 'websocket'; /** * Options for creating a BucketWatcher */ export interface IBucketWatcherOptions { /** Watcher mode: 'poll' (default) or 'websocket' (future) */ mode?: TBucketWatcherMode; /** Prefix to filter objects (default: '' for all objects) */ prefix?: string; /** Polling interval in milliseconds (default: 5000, poll mode only) */ pollIntervalMs?: number; /** Optional RxJS buffering time in milliseconds */ bufferTimeMs?: number; /** Emit initial state as 'add' events (default: false) */ includeInitial?: boolean; /** Page size for listing operations (default: 1000) */ pageSize?: number; } /** @deprecated Use IStorageObjectState instead */ export type IS3ObjectState = IStorageObjectState; /** @deprecated Use IStorageChangeEvent instead */ export type IS3ChangeEvent = IStorageChangeEvent;