import { z } from "zod"; import { type GraphDoc, type LiveCommand } from "@coldtea/pr-lens-schema"; import { PrLensCliError } from "../errors.js"; declare const Minted: z.ZodObject<{ id: z.ZodString; writeToken: z.ZodString; rev: z.ZodNumber; viewUrl: z.ZodString; editUrl: z.ZodString; embedUrl: z.ZodString; }, z.core.$strip>; declare const Fetched: z.ZodObject<{ id: z.ZodString; rev: z.ZodNumber; viewUrl: z.ZodString; embedUrl: z.ZodString; document: z.ZodUnknown; tiles: z.ZodArray; hero: z.ZodBoolean; width: z.ZodNumber; height: z.ZodNumber; renders: z.ZodRecord; images: z.ZodRecord; }, z.core.$strip>>; }, z.core.$strip>; declare const Pushed: z.ZodObject<{ id: z.ZodString; rev: z.ZodNumber; viewUrl: z.ZodString; editUrl: z.ZodString; embedUrl: z.ZodString; tiles: z.ZodArray; hero: z.ZodBoolean; width: z.ZodNumber; height: z.ZodNumber; renders: z.ZodRecord; images: z.ZodRecord; }, z.core.$strip>>; }, z.core.$strip>; declare const Rotated: z.ZodObject<{ id: z.ZodString; editUrl: z.ZodString; }, z.core.$strip>; export type Minted = z.infer; export type Pushed = z.infer; export type Rotated = z.infer; export type Fetched = Omit, "document"> & { document: GraphDoc; }; /** The ids the canvas would have taken, so the next attempt can copy one rather than guess again. */ export type ValidPlaces = { components: readonly string[]; messages: readonly string[]; diagrams: readonly string[]; }; export declare const unknownPlaces: (problems: readonly string[], valid: ValidPlaces) => PrLensCliError; /** The bearer is how CI attributes a mint: a runner's install id is never linked. */ export declare const mintCanvas: (api: string, install: string | undefined, token: string | undefined) => Promise; /** `token` lets an owner fetch their private canvas. */ export declare const fetchCanvas: (api: string, id: string, token?: string) => Promise; export declare const pushCanvas: (api: string, id: string, token: string, rev: number, document: GraphDoc) => Promise; /** A rotation onto itself changes nothing and is answered "rotated" only for the current token. */ export declare const verifyWriteToken: (api: string, id: string, token: string) => Promise; /** The caller mints the next token, so a lost answer can be asked for again. */ export declare const rotateCanvas: (api: string, id: string, token: string, nextToken: string) => Promise; export declare const deleteCanvas: (api: string, id: string, token: string) => Promise<{ id: string; deleted: true; }>; /** An unreadable revision must not read as an empty canvas. */ declare const Preview: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"drawn">; title: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"not_drawn">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"unreadable">; }, z.core.$strip>], "type">; declare const Owned: z.ZodObject<{ id: z.ZodString; rev: z.ZodNumber; preview: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"drawn">; title: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"not_drawn">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"unreadable">; }, z.core.$strip>], "type">; }, z.core.$strip>; export type CanvasPreview = z.infer; export type OwnedCanvas = z.infer; /** * Carries no write tokens: the app keeps only their hashes. A store without * accounts 404s here, which reads as unavailable, not as a missing canvas. */ export declare const listOwnedCanvases: (api: string, token: string) => Promise; /** * The account token takes the header, so the write tokens go in the body. * The caller mints the next token so a lost answer can be replayed. */ export declare const claimCanvas: (api: string, id: string, accountToken: string, writeToken: string, nextWriteToken: string) => Promise; declare const LiveOpened: z.ZodObject<{ session: z.ZodString; url: z.ZodString; expiresAt: z.ZodString; key: z.ZodOptional; }, z.core.$strip>; declare const TAB_STATES: readonly ["following", "stepped_out", "not_open"]; declare const LiveSent: z.ZodObject<{ seq: z.ZodNumber; tab: z.ZodEnum<{ following: "following"; not_open: "not_open"; stepped_out: "stepped_out"; }>; }, z.core.$strip>; declare const LookRead: z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodLiteral<"not_open">; }, z.core.$strip>, z.ZodObject<{ status: z.ZodLiteral<"seen">; seenAt: z.ZodString; look: z.ZodObject<{ following: z.ZodBoolean; rev: z.ZodInt; diagram: z.ZodNullable; view: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flow">; flow: z.ZodString; }, z.core.$strict>], "kind">>; title: z.ZodString; }, z.core.$strip>>; inFrame: z.ZodArray; id: z.ZodString; label: z.ZodString; }, z.core.$strip>>; scope: z.ZodNullable; place: z.ZodObject<{ kind: z.ZodEnum<{ component: "component"; diagram: "diagram"; message: "message"; }>; id: z.ZodString; label: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"region">; places: z.ZodArray; id: z.ZodString; label: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"drawn">; label: z.ZodString; within: z.ZodString; places: z.ZodArray; id: z.ZodString; label: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>], "kind">>; answer: z.ZodNullable>; fork: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; }, z.core.$strip>], "status">; export type LiveOpened = z.infer; export type TabState = (typeof TAB_STATES)[number]; export type LookRead = z.infer; /** * A session is one tab, paired by the secret in the link this answers with. * With no credential, a public canvas opens a reader's session. */ export declare const openLive: (api: string, id: string, token: string | undefined) => Promise; export declare const sendLive: (api: string, id: string, token: string, session: string, command: LiveCommand) => Promise>; export declare const readLook: (api: string, id: string, token: string, session: string) => Promise; export {}; //# sourceMappingURL=api.d.ts.map