import type { MulmoScriptChangedEvent, MulmoScriptDispatchArgs, MulmoScriptDispatchResult, MulmoScriptGenerationEvent } from "../core/contract"; import type { GenerationSubscription, ScriptChangedSubscription } from "./subscription"; export type { GenerationSubscription, ScriptChangedSubscription } from "./subscription"; export type TransportResult = { ok: true; data: T; } | { ok: false; error: string; }; type ArgsFor = Omit, "kind">; export declare function parseScriptChangedEvent(payload: unknown): MulmoScriptChangedEvent | null; export declare function parseGenerationEvent(payload: unknown): MulmoScriptGenerationEvent | null; export interface MulmoScriptTransport { call(kind: K, args: ArgsFor): Promise>; /** Subscribe to the host's generation channel, pre-filtered to one script — * identified by the PAIR `(root, filePath)`, since the same wire path * exists in every registered root (#3014). Returns the unsubscribe * function. */ onGenerationEvent(subscription: GenerationSubscription): () => void; /** The pre-#3014 form: no root named, so the host's default root. Kept * because this interface is exported from `/vue` on a published package. */ onGenerationEvent(filePath: () => string, handler: (event: MulmoScriptGenerationEvent) => void): () => void; /** Subscribe to writes of one script, skipping the echo of this View's own * (`ownOrigin`). Same pair identity as above. Returns the unsubscribe * function. */ onScriptChanged(subscription: ScriptChangedSubscription): () => void; /** The pre-#3014 form — see `onGenerationEvent` above. */ onScriptChanged(filePath: () => string, ownOrigin: string, handler: () => void): () => void; } export declare function useMulmoScriptTransport(): MulmoScriptTransport; //# sourceMappingURL=transport.d.ts.map