import type { HudFrame } from '../core/hud.ts'; import type { DeviceEvent } from './events.ts'; /** Everything Hermeven needs from the glasses runtime. Implemented by the Even adapter and by test fakes. */ export interface DevicePort { /** Create the HUD page. Resolves false when the host refused it. */ init(frame: HudFrame): Promise; /** Show a frame. Calls are serialised and coalesced; only the latest pending frame is sent. */ show(frame: HudFrame): void; /** Open the glasses microphone. Resolves false when the host refused (for example no permission). */ startMic(): Promise; stopMic(): Promise; onEvent(listener: (event: DeviceEvent) => void): () => void; onConnection(listener: (connected: boolean) => void): () => void; /** Ask the OS to show its own exit confirmation. */ requestExit(): Promise; storageGet(key: string): Promise; storageSet(key: string, value: string): Promise; }