Interface KVNamespace<Key>

interface KVNamespace<Key> {
    delete(key): Promise<void>;
    get(key, options?): Promise<string>;
    get(key, options?): Promise<string>;
    get(key, type): Promise<string>;
    get<ExpectedValue>(key, type): Promise<ExpectedValue>;
    get(key, type): Promise<ArrayBuffer>;
    get(key, type): Promise<ReadableStream<any>>;
    get(key, options?): Promise<string>;
    get<ExpectedValue>(key, options?): Promise<ExpectedValue>;
    get(key, options?): Promise<ArrayBuffer>;
    get(key, options?): Promise<ReadableStream<any>>;
    getWithMetadata<Metadata>(key, options?): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
    getWithMetadata<Metadata>(key, type): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
    getWithMetadata<ExpectedValue, Metadata>(key, type): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
    getWithMetadata<Metadata>(key, type): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
    getWithMetadata<Metadata>(key, type): Promise<KVNamespaceGetWithMetadataResult<ReadableStream<any>, Metadata>>;
    getWithMetadata<Metadata>(key, options): Promise<KVNamespaceGetWithMetadataResult<string, Metadata>>;
    getWithMetadata<ExpectedValue, Metadata>(key, options): Promise<KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>;
    getWithMetadata<Metadata>(key, options): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>;
    getWithMetadata<Metadata>(key, options): Promise<KVNamespaceGetWithMetadataResult<ReadableStream<any>, Metadata>>;
    list<Metadata>(options?): Promise<KVNamespaceListResult<Metadata, Key>>;
    put(key, value, options?): Promise<void>;
}

Type Parameters

  • Key extends string = string

Methods

  • Parameters

    Returns Promise<void>

  • Parameters

    Returns Promise<string>

  • Parameters

    Returns Promise<string>

  • Parameters

    • key: Key
    • type: "text"

    Returns Promise<string>

  • Type Parameters

    • ExpectedValue = unknown

    Parameters

    • key: Key
    • type: "json"

    Returns Promise<ExpectedValue>

  • Parameters

    • key: Key
    • type: "arrayBuffer"

    Returns Promise<ArrayBuffer>

  • Parameters

    • key: Key
    • type: "stream"

    Returns Promise<ReadableStream<any>>

  • Parameters

    Returns Promise<string>

  • Type Parameters

    • ExpectedValue = unknown

    Parameters

    Returns Promise<ExpectedValue>

  • Parameters

    Returns Promise<ArrayBuffer>

  • Parameters

    Returns Promise<ReadableStream<any>>

  • Parameters

    Returns Promise<void>