char/avril
(wip) why'd you have to go and make things so complicaaaaated?
git clone https://git.t4t.associates/char/avril
38d7f6c
main
1// Ambient augmentation composed from several extensions rather than one 2// module surface: `avril:std` provides the `avril` brand and `Pledge`, the 3// web platform provides `Navigator` and `WorkerNavigator`, and workers own 4// `WorkerOptions`, `postMessage`, and the `import.meta` extras. It stays 5// handwritten because no single facade owns it. 6import type { avril , Pledge } from "avril:std" ; 7 8declare global{ 9interface ImportMeta { 10readonly main :boolean ; 11readonly filename ?:string ; 12readonly dirname ?:string ; 13resolve ( specifier :string ) :string ; 14} 15 16interface Navigator { 17/** Isolate-local User-Agent for fetch, EventSource, and WebSocket; explicit fetch headers take precedence. */ 18userAgent :string ; 19} 20 21interface WorkerNavigator { 22userAgent :string ; 23} 24 25interface WorkerOptions { 26[ avril ] ?:{ 27readonly caps ?:Pledge ; 28}; 29} 30 31interface GlobalThis { 32/** Always `true` in avril; detect with `globalThis[Symbol.for("runtime:avril")]`. */ 33readonly [ avril ] :true ; 34} 35 36function postMessage ( message :unknown , transfer ?:Transferable []) :void ; 37function postMessage ( message :unknown , options ?:StructuredSerializeOptions ) :void ; 38}