Skip to main content
Go to Latest
class Store
import { Store } from "https://deno.land/x/darkflare@v5.0.0/mod.ts";

Constructors

new
Store(namespace: KVNamespace, prefix?: string)

Type Parameters

Schema extends Record<string, unknown> | string

Properties

private
namespace: KVNamespace
private
prefix: string | undefined

Methods

delete(key: string)
get<T extends GetWithOrWithoutMetadata = undefined>(key: string, options?: T): Promise<(T extends { metadata: true; } ? { value: Schema; metadata: { [key: string]: any; } | undefined; } : Schema) | undefined>
has(key: string)
list(options?: { prefix?: string; limit?: number; cursor?: string; }): Promise<{ keys: { [key: string]: { expiresAt?: Date; metadata?: { [key: string]: any; }; }; }; cursor: undefined; isComplete: true; } | { keys: { [key: string]: { expiresAt?: number; metadata?: { [key: string]: any; }; }; }; cursor: string; isComplete: false; }>
set(
key: string,
value: Schema,
options?: { expiresIn?: string; expiresAt?: Date; metadata?: Record<string, unknown>; },
)
update(key: string, value: Schema extends object ? PartialKey<Schema> : string): Promise<Schema | undefined>