import type { PartialSettings } from '../settings'; import type { ThemeName } from '../theme'; import type { TrajectoryFrame, TrajectoryMetadata, TrajectoryRunSummary } from '../trajectory'; export interface FileData { filename: string; content: string; is_base64: boolean; } export interface WebviewBootstrapData { data: FileData; theme: ThemeName; defaults?: PartialSettings; moyo_wasm_url?: string; } type HostFileRequest = { file_path: string; filename: string; }; export type HostRequest = ({ command: `request_large_file`; } & HostFileRequest) | ({ command: `request_frame`; frame_index: number; } & HostFileRequest); export type FileChangeMessage = { command: `fileUpdated`; file_path: string; data: FileData; theme?: ThemeName; } | { command: `fileDeleted`; file_path: string; }; export type SettingsChangedMessage = { command: `settingsChanged`; theme: ThemeName; defaults: PartialSettings; }; export type WebviewToHostMessage = { command: `info` | `error`; text: string; } | (HostRequest & { request_id: string; }) | { command: `saveAs`; filename: string; content: string; is_binary: boolean; }; export type HostToWebviewMessage = FileChangeMessage | SettingsChangedMessage | { command: `error`; text: string; } | { command: `large_file_response`; request_id: string; run_summary?: TrajectoryRunSummary; error?: string; } | { command: `frame_response`; request_id: string; frame_index?: number; frame?: TrajectoryFrame | null; error?: string; } | { command: `plot_metadata_stream`; file_path: string; rows: TrajectoryMetadata[]; complete: boolean; }; export {};