/** * The mapping between the page runtime's channel messages and the * definition's {@link TimelineSink}, written once for every carrier. * * It rides a {@link PageTransport}: `server.hot` on a Vite dev server, * devframe RPC events under `lit-devtools dev`, a port in the extension. The * codec owns everything above that: channel names, * validation of inbound payloads, the layers wire format and sink dispatch. * Like `source.ts` it imports nothing from Vite, so the Vite-free standalone * source and the Vite-side source can share it. */ import type { InspectorCommand } from '../../types/inspector.js'; import type { SettingsOverride, TimelineLayersState } from '../../types/timeline.js'; import type { PageTransport } from '../runtime/page-transport.js'; import type { TimelineSink, TimelineSource } from './source.js'; export interface TimelineChannelCodecOptions { /** * Called with the picked element's id when the page reports an overlay * pick, before the message reaches the sink. How the Vite host brings its * dock forward; omitted where there is no dock to activate. */ onPick?: (id: number) => void; } /** * The {@link TimelineSource} every host hands its definition, over a * {@link PageTransport}. Inbound messages are * untrusted in shape, so each is checked before it reaches the sink; * anything unrecognised is ignored rather than thrown, which keeps a * misbehaving page from taking the session down. * * Calls made before {@link connect} are dropped, not buffered: nothing can * reach the page until a carrier exists. Page messages that arrive before a * sink attaches are dropped too, except the last runtime announcement, * which {@link attach} replays: without it the session would not know a page * exists until that page reloads. */ export declare class TimelineChannelCodec implements TimelineSource { #private; constructor(options?: TimelineChannelCodecOptions); /** Subscribe to the page's channels on `carrier`. Call once. */ connect(carrier: PageTransport): void; attach(sink: TimelineSink): () => void; toggleOverlay(): void; sendInspector(cmd: InspectorCommand): void; setRecording(recording: boolean): void; setLayers(layers: TimelineLayersState): void; setSettingsOverride(override: SettingsOverride): void; } //# sourceMappingURL=page-codec.d.ts.map