import type { KVLike } from "../types.js"; import type { SchemaNodeDef, SchemaDef, SchemaKV } from "./types.js"; /** * Create a schema-aware KV interface. * * Provides type-safe operations with key builders and lazy tree iteration. * * @param schema - Schema definition from defineSchema() * @param kv - Underlying KV store (typically from kv.getStore()) * @returns SchemaKV interface with type-safe operations * * @example * ```ts * const schema = defineSchema("boards/", { * boards: { * pattern: "*", * value: {} as Board, * metadata: {} as BoardMeta, * children: { * columns: { * pattern: "columns/*", * value: {} as Column, * children: { * tasks: { pattern: "tasks/*", value: {} as Task } * } * } * } * } * }); * * const kv = createSchemaKV(schema, rawKV.getStore("boards/")); * * // Type-safe key builders * kv.key.boards("board-1") // → "board-1" * kv.key.columns("board-1", "col-1") // → "board-1/columns/col-1" * * // Lazy tree with batched fetching * const board = await kv.tree("boards", "board-1"); * for await (const col of board.columns) { * console.log(col.value.name); * for await (const task of col.tasks) { * console.log(task.value.title); * } * } * ``` */ export declare function createSchemaKV

>>(schema: SchemaDef, kv: KVLike): SchemaKV; //# sourceMappingURL=schema-kv.d.ts.map