import { type ComputedRef, type Ref } from "vue"; import type { MulmoScriptDispatchResult } from "../../core/contract"; import type { MulmoScriptTransport, TransportResult } from "../transport"; import type { DeckScriptShape, MulmoScript } from "../viewTypes"; /** * The slice of the transport this composable uses. * * `MulmoScriptTransport["call"]` is generic in the dispatch kind, so a fake standing in for it * has to answer every kind — impossible to write without a cast. Naming the ONE call made here * is what lets the save path (and its failure) be tested; the real transport satisfies this * structurally, so the View passes the same object it always did. */ export type DeckEditorTransport = Pick & { call(kind: "updateScript", args: { filePath: string; root?: string | undefined; script: MulmoScript; origin: string; }): Promise>; }; export interface UseDeckEditorOptions { api: DeckEditorTransport; filePath: ComputedRef; /** Which registered root `filePath` is relative to; `undefined` = the host's default (#3014). */ root: ComputedRef; effectiveScript: ComputedRef; /** Persist the saved script back into the parent's toolResult so the * in-memory script and reactive beats[] stay in sync without a remount. */ commitScript: (next: MulmoScript) => void; } export declare function useDeckEditor({ api, filePath, root, effectiveScript, commitScript }: UseDeckEditorOptions): { canEditBeats: ComputedRef; deckScriptInput: ComputedRef; deckSaveError: Ref; resetForScriptChange: () => void; onDeckUpdate: (next: DeckScriptShape) => void; flushPendingDeckSave: () => void; watchForeignWrites: (reload: () => void) => () => void; }; //# sourceMappingURL=useDeckEditor.d.ts.map