Targets · TypeScript · Capabilities

Capabilities

Which high-level features a Program can use when it renders to TypeScript — the same reach as JavaScript, in the browser or on Node, with types checked ahead of time.

Contents

How a Program becomes TypeScript, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.

Two homes: browser and Node

TypeScript compiles to JavaScript, so a program can run in exactly the same places — the browser and Node — and reach the same capabilities. What TypeScript adds is not new reach but compile-time checking: Program's types are carried through, so a mistake in wiring the interface, a driver, or a native signature is caught by tsc before the program runs.

FeatureStatusHow
User interfaceBuilt in (browser)The DOM interface driver renders Ui; on Node there is no DOM, so a headless or terminal driver is used instead.
NetworkingBuilt inNetwork uses fetch in the browser and Node alike.
AsynchronyBuilt inA LOCKED state models an in-flight value; the driver resolves it and re-enters the cycle.
AnimationBuilt in (browser)The Animate driver shares one requestAnimationFrame ticker; on the server it has no visible effect.
Storage & filesBy hostBrowser: localStorage/IndexedDB and the file picker. Node: real filesystem access via Storage natives.
TypesBuilt inEvery carried type becomes a TypeScript annotation or generic, so the whole rendered program type-checks.
Background threadsLimitedWeb Workers (browser) or worker threads (Node) behind a native module; reactive state does not cross the boundary.

Because the emitted body is the same as JavaScript, any JavaScript library is reachable from a NATIVE function, now with its type declarations honoured.