Libraries v5.0.0
    Preparing search index...

    Interface ObjectStorage

    Server-side, provider-neutral object storage. Keys are relative logical names; provider prefixes never appear in results. Operations on one key replace its current value; they do not provide database transactions or version history. Owners can use await using to close the instance when leaving its scope.

    interface ObjectStorage {
        "[asyncDispose]"(): Promise<void>;
        close(): Promise<void>;
        copy(
            source: string,
            destination: string,
            options?: StorageOptions,
        ): Promise<StoredObject>;
        delete(key: string, options?: StorageOptions): Promise<void>;
        get(key: string, options?: StorageOptions): Promise<StorageReadResult>;
        publicUrl(key: string): string | undefined;
        put(
            key: string,
            body: StorageBody,
            options?: PutOptions,
        ): Promise<StoredObject>;
        stat(
            key: string,
            options?: StorageOptions,
        ): Promise<ObjectMetadata | undefined>;
    }

    Hierarchy

    • AsyncDisposable
      • ObjectStorage

    Implemented by

    Index
    • Delegate to close(), awaiting the same cleanup on scope exit.

      Returns Promise<void>

    • Cancel active work, await cleanup and permanently close this instance. Idempotent.

      Returns Promise<void>

    • Stable URL only when a public base URL was explicitly configured.

      Parameters

      • key: string

      Returns string | undefined