/** * The link every tool holds: whichever of the two Aseprites this session is * working with, switched only by an explicit `preflight mode=…`. * * Both links are created on first use and kept for the life of the server, so * switching never loses anything: the user's window keeps its documents, and * the headless process keeps its own unsaved ones for when the session comes * back to it. Nothing here switches on its own — a live call that fails still * fails (docs/adr/0008-headless-mode.md). */ import type { HelloFrame } from "../lib/protocol.js"; import type { LiveClient } from "./client.js"; import type { HeadlessClient } from "./headless.js"; import type { AsepriteLink, CallOptions } from "./link.js"; export type LinkMode = AsepriteLink["mode"]; export interface LinkFactory { live(): LiveClient; headless(): HeadlessClient; } export declare class LinkSelector implements AsepriteLink { private readonly factory; private liveLink; private headlessLink; private current; constructor(factory: LinkFactory, initial: LinkMode); /** Makes `mode` the link every later call goes to. Returns whether it changed. */ use(mode: LinkMode): boolean; get mode(): LinkMode; get bridgeConnected(): boolean; get pluginConnected(): boolean; get hello(): HelloFrame | null; get features(): string[]; hasFeature(name: string): boolean; waitForBridge(ms?: number): Promise; waitForPlugin(ms?: number): Promise; call(cmd: string, args?: Record, opts?: CallOptions): Promise; close(): void; private link; }