// generated by diplomat-tool import type { NucleationError } from "./NucleationError.mjs" import type { Schematic } from "./Schematic.mjs" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** * A key/value store opened from a URL (e.g. `mem://`, `file:///path`, * `ssh://user@host/path`, `s3://bucket/prefix`, `redis://…`, `postgres://…`). */ export class Store { /** @internal */ get ffiValue(): pointer; /** @internal */ constructor(); /** * Open a store from a URL. Errors with `Store` on an unknown scheme or * connection failure. */ static open(url: string): Store; /** * Fetch `key`, writing the value as base64 (PORTING rule 6). Errors with * `NotFound` when the key is absent. */ getB64(key: string): string; /** * Store `data` at `key`. */ put(key: string, data: Array): void; /** * Whether `key` exists. */ exists(key: string): boolean; /** * Delete `key` (idempotent). */ delete_(key: string): void; /** * List keys under `prefix`, written as a JSON array string. */ list(prefix: string): string; /** * Atomically write `data` at `key` only if it does not already exist. * Returns `true` if written, `false` if the key existed. */ putIfAbsent(key: string, data: Array): boolean; /** * A keyset page of keys under `prefix`. `after` is the exclusive cursor * (empty string for the first page); at most `limit` keys are returned. * Writes a JSON object string `{"keys":[...],"next":"…"|null}`. */ listPaginated(prefix: string, after: string, limit: number): string; /** * Health check: `Ok` when the store is usable. */ health(): void; /** * Open a schematic stored at `key` in this store. Works for every * backend, including `redis://`/`postgres://`/`mem://` that the * single-string URI form (`StoreIo::open`) rejects. */ openSchematic(key: string): Schematic; /** * Save a schematic at `key` in this store. `version` selects the format * version (empty string = format default). Works for every backend, * including `redis://`/`postgres://`/`mem://` that the single-string URI * form (`StoreIo::save`) rejects. */ saveSchematic(schematic: Schematic, key: string, version: string): void; }