import { z } from "zod"; import type { Terminal } from "../terminal.js"; /** Holds write tokens, the one thing here nothing can rebuild. */ export declare const REGISTRY_PATH: string; export declare const isCanvasId: (value: string) => boolean; export declare const mintWriteToken: () => string; declare const Entry: z.ZodObject<{ name: z.ZodString; source: z.ZodOptional; api: z.ZodString; writeToken: z.ZodOptional; pending: z.ZodOptional; rev: z.ZodNumber; live: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; declare const Registry: z.ZodObject<{ canvases: z.ZodRecord; api: z.ZodString; writeToken: z.ZodOptional; pending: z.ZodOptional; rev: z.ZodNumber; live: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>; export type CanvasEntry = z.infer; export type CanvasRegistry = z.infer; export type Registered = { id: string; entry: CanvasEntry; }; export declare const readRegistry: () => Promise; /** Asked before a canvas is minted, so a refusal costs nothing on the app. */ export declare const ensureRegistryHome: (terminal: Terminal) => Promise; /** Compared case-blind and by inode: macOS ignores case, and a link is the same file. */ export declare const isReservedRegistryTarget: (path: string) => Promise; export declare const writeRegistry: (registry: CanvasRegistry, terminal: Terminal) => Promise; /** Two commands writing the whole file at once would each keep only their own change. */ export declare const withRegistryLock: (work: () => Promise) => Promise; export declare const updateRegistry: (change: (registry: CanvasRegistry) => void, terminal: Terminal) => Promise; export declare const sourceKey: (path: string) => string; export declare const findCanvas: (registry: CanvasRegistry, ref: string) => Registered; export declare const findBySource: (registry: CanvasRegistry, path: string) => Registered | undefined; /** * Fallback after the path: a pull and the render after it write two files, * and only one can be the recorded path. A path match wins, since a title * can be edited. */ export declare const findByTitle: (registry: CanvasRegistry, title: string) => Registered | undefined; export declare const onlyCanvas: (registry: CanvasRegistry) => Registered; export declare const selectCanvas: (registry: CanvasRegistry, ref: string | undefined) => Registered; export {}; //# sourceMappingURL=registry.d.ts.map