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
delete
- delete(key): Promise<void>
Returns Promise<void>
get
- get(key, options?): Promise<string>
Returns Promise<string>
- get(key, options?): Promise<string>
Returns Promise<string>
- get(key, type): Promise<string>
Returns Promise<string>
- get<ExpectedValue>(key, type): Promise<ExpectedValue>
- get(key, type): Promise<ArrayBuffer>
Parameters
- key: Key
- type: "arrayBuffer"
Returns Promise<ArrayBuffer>
- get(key, type): Promise<ReadableStream<any>>
- get(key, options?): Promise<string>
Returns Promise<string>
- get<ExpectedValue>(key, options?): Promise<ExpectedValue>
- get(key, options?): Promise<ArrayBuffer>
Returns Promise<ArrayBuffer>
- get(key, options?): Promise<ReadableStream<any>>
getWithMetadata
- 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>>
Type Parameters
- ExpectedValue = unknown
- Metadata = unknown
- getWithMetadata<Metadata>(key, type): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>
Parameters
- key: Key
- type: "arrayBuffer"
- 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>>
Type Parameters
- ExpectedValue = unknown
- Metadata = unknown
- getWithMetadata<Metadata>(key, options): Promise<KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>>
- getWithMetadata<Metadata>(key, options): Promise<KVNamespaceGetWithMetadataResult<ReadableStream<any>, Metadata>>
put
- put(key, value, options?): Promise<void>
Returns Promise<void>