// Ambient augmentation composed from several extensions rather than one // module surface: `avril:std` provides the `avril` brand and `Pledge`, the // web platform provides `Navigator` and `WorkerNavigator`, and workers own // `WorkerOptions`, `postMessage`, and the `import.meta` extras. It stays // handwritten because no single facade owns it. import type { avril, Pledge } from "avril:std"; declare global { interface ImportMeta { readonly main: boolean; readonly filename?: string; readonly dirname?: string; resolve(specifier: string): string; } interface Navigator { /** Isolate-local User-Agent for fetch, EventSource, and WebSocket; explicit fetch headers take precedence. */ userAgent: string; } interface WorkerNavigator { userAgent: string; } interface WorkerOptions { [avril]?: { readonly caps?: Pledge; }; } interface GlobalThis { /** Always `true` in avril; detect with `globalThis[Symbol.for("runtime:avril")]`. */ readonly [avril]: true; } function postMessage(message: unknown, transfer?: Transferable[]): void; function postMessage(message: unknown, options?: StructuredSerializeOptions): void; }