The object store bucket interface.

interface IObjectStoreBucket {
    close(): void;
    get(path: string, options?: IFileOptions): Promise<IFile>;
    getName(): string;
    getOwnerId(): string;
    getSize(path?: string): Promise<number>;
    list(path: string, options?: IObjectStoreListOptions): Promise<ObjectDescriptor[]>;
    publish(payload: Payload): Promise<void>;
    subscribe(label: string, callback: ((data: StorageEvent) => void)): void;
    unpublish(path: string): Promise<void>;
    unsubscribe(label: string): void;
}

Hierarchy (view full)

Methods

  • Close the bucket.

    Returns void

  • Get an object from the bucket.

    Parameters

    • path: string

      The path of the object.

    • Optionaloptions: IFileOptions

      The optional options for getting the object.

    Returns Promise<IFile>

    The object.

  • Get the storage size of the bucket.

    Parameters

    • Optionalpath: string

      Optionnally takes a path to get the size of a specific object or folder.

    Returns Promise<number>

    The storage size.

  • Publish an action to the bucket.

    Parameters

    • payload: Payload

      The object store payload.

    Returns Promise<void>

    A promise that resolves when the action is published.

  • Subscribe to the bucket events.

    Parameters

    • label: string

      The label of the subscriber.

    • callback: ((data: StorageEvent) => void)

      The callback function.

    Returns void

  • Unpublish an object from the bucket. It also permanently deletes the object.

    Parameters

    • path: string

      The path of the object.

    Returns Promise<void>

    A promise that resolves when the object is unpublished.

  • Unsubscribe from the bucket.

    Parameters

    • label: string

      The label of the subscriber.

    Returns void