---
title: "TypeShade compiler API reference for host applications"
description: "Every public export of the TypeShade compiler on its own page: syntax, parameters, return value, examples and which targets support it."
url: https://typeshade.dev/api/
language: en
---

# Compiler API reference

Every export of the typeshade package, generated from the compiler at commit af54ddad5. One page per function, type, interface and class.

This API is for host applications and the [`fn()`](https://typeshade.dev/api/fn/) builder. Shader authors can use the [language reference](https://typeshade.dev/reference/).

**[Authoring](https://typeshade.dev/api/authoring/) 48 members**

The builder a shader is written with: modules, functions, variables and control flow.

**[Builtins](https://typeshade.dev/api/builtins/) 96 members**

IR builder functions for math, vector and texture operations. Each returns an IR node. A shader file calls the builtins that the language reference lists.

**[Values](https://typeshade.dev/api/values/) 15 members**

Literals, typed references and the constructors that turn a JavaScript value into a node.

**[Types](https://typeshade.dev/api/types/) 85 members**

The type keys and type descriptors the authoring surface is typed by.

**[IR](https://typeshade.dev/api/ir/) 43 members**

The intermediate representation every backend reads: nodes, statements and declarations.

**[Layout](https://typeshade.dev/api/layout/) 24 members**

The declarators that state a struct or a bound resource once, for the host and both targets.

**[Emit](https://typeshade.dev/api/emit/) 30 members**

The WGSL and GLSL ES 3.00 writers, module fragments and the passes that run before them.

**[Reflection](https://typeshade.dev/api/reflection-api/) 27 members**

What `reflect()` recovers from a module: bind groups, byte layouts and entry points.

**[CPU oracle](https://typeshade.dev/api/cpu-oracle/) 10 members**

The CPU backend that runs a module in `f64` and gives the reference values to compare against.

**[Console](https://typeshade.dev/api/console/) 8 members**

What a shader says through console.log: the events the CPU delivers, and the decoder for the ones the GPU records.

**[Runtime](https://typeshade.dev/api/runtime-api/) 92 members**

The program runtime that runs compiled programs on WebGPU, the array a kernel call keeps on the device, and the host types a host view spells values with.

**[Diagnostics](https://typeshade.dev/api/diagnostics/) 5 members**

The coded error class and the validation gate every emit goes through.

**[Emulated f64](https://typeshade.dev/api/emulated-f64/) 10 members**

Double precision on targets that have none, carried in pairs of `f32` lanes.

**[Variants](https://typeshade.dev/api/variants/) 17 members**

Feature axes as one family of modules, compiled and linked point by point.

**[Backends](https://typeshade.dev/api/backends/) 30 members**

The backend contract, the capability model and the registry that spells an intrinsic.

**[Tooling](https://typeshade.dev/api/tooling/) 20 members**

Registry generation, semantic comparison, emit identity and size measurement.

**[Editor](https://typeshade.dev/api/editor/) 12 members**

What an editor asks the compiler for: diagnostics, completion and hover, at a source position.
