Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
Mods API · 03 of 03

Types

Every declaration in the file, verbatim, with the doc comment above it.

Declarations833over 17 pages
Mined from2.1.330the shipped binary

Every named declaration in the file, 833 of them, verbatim and in the order Claude Code wrote them, 50 to a page. This is the page to land on from a signature: a verb that returns ToolCallResult links here, at whichever page it is on, and what you get is the declaration itself rather than a description of it.

The source is 22,468 lines of TypeScript mined from build 2.1.330. Anything longer than 12 lines is folded; click the line count to open it. To find a name on another page, search every symbol.

Names on this page, 751 to 800 of 833

MountPointerEvent type # line 21905

Added in 2.1.277

What a mounted drawing's pointer takes: the event as a Client's onPointer listener receives it, in its region's cells, and which one.

  export type MountPointerEvent = ClientPointerEvent & ClientScope;

MountPressTarget type # line 21911

Added in 2.1.277

What a mounted drawing's press takes: the Button's key, another plugin's name when the Button is not the mounted plugin's, a link.

  export type MountPressTarget = {
      key: string;
      plugin?: string;
      /**
       * Presses this link of the Markdown keyed `key` instead of a Button.
       */
      link?: PressedLink;
  };

MountResizeTarget type # line 21924

Added in 2.1.277

What a mounted drawing's resize takes: a Client region's size in cells, as the surface measuring it hands it, and which Client.

  export type MountResizeTarget = {
      columns: number;
      rows: number;
      in?: string;
  };

MountSelectTarget type # line 21934

Added in 2.1.277

What a mounted drawing's select takes: the Select's key, the picked option's value, another plugin's name when the Select is not its own.

  export type MountSelectTarget = {
      key: string;
      value: string;
      plugin?: string;
  };

MountTarget type # line 21951

Added in 2.1.275 · changed in 2.1.277

What $.ui.mount takes: whose elements the test will act on, the surface that draws, and the component instance the engine asks the plugins for.

The envelope a ui.render hook sees as e (surface, component, requestId, viewport, props) plus plugin. surface is never defaulted: one body run over several surfaces is what shows independence.

$.ui.mount({ plugin: 'notes', surface, component: 'Pane', props: PANE })
37 lines
  export type MountTarget<P extends RenderSurface = RenderSurface, C extends RenderComponent = RenderComponent> = {
      /**
       * Whose elements the handle's acts address by bare `key`: the plugin
       * under test, usually. An act names another plugin to reach its element.
       */
      plugin: string;
      /**
       * What draws: its element table validates every tree the plugins
       * return, and every dispatch the handle raises carries it as `e.surface`.
       *
       * One of `terminal`, `desktop`, `vscode`, `mobile`.
       */
      surface: P;
      /**
       * Which component the engine asks the plugins to draw (`Pane`,
       * `AbovePrompt`, `ToolUse`, ...): what a `ui.render` matcher narrows on.
       */
      component: C;
      /**
       * The component's props, what the hook reads as `e.props`.
       */
      props: RenderPropsOf[C];
      /**
       * The instance drawn (a pane's id, a tool row's tool_use_id); one is
       * minted when absent. Two mounts of one component are two instances.
       */
      requestId?: string;
      /**
       * What the surface measured, as the hook reads it under `e.viewport`;
       * absent when the surface has not measured, as on `e`.
       *
       * Cells across and down in the surface's monospace metric and whether it
       * docks a pane. A `Client` in the drawing starts laid out at this size
       * (0 by 0 when absent) until the handle's `resize` lays its region out.
       */
      viewport?: RenderViewport;
  };

Negatable type # line 21992

Added in 2.1.271

A set of checks and, under not, the same set passing where they fail.

  export type Negatable<M> = M & {
      /**
       * The checks negated.
       */
      not: M;
  };

Plugin type # line 22006

Added in 2.1.271

Written inline in a test and loaded as a plugin folder is: its name, the tier it loads in (user when not given), and its hooks module's register.

register is written register(on) { ... } and is self-contained, as a module's is: it closes over nothing of the test file.

  export type Plugin = {
      name: string;
      tier?: PluginTier;
      register: Register;
  };

PluginTier type # line 22015

Added in 2.1.271

A tier a plugin loads in: every tier but the engine's own.

  export type PluginTier = Exclude<Tier, 'core'>;

PressTarget type # line 22021

Added in 2.1.271 · changed in 2.1.274, 2.1.277

What $.ui.press takes: the plugin whose ui.render hook drew the element, the key it gave it, the instance and surface when several, a link.

17 lines
  export type PressTarget = {
      plugin: string;
      key: string;
      /**
       * Which instance holds it, when the plugin drew the key in several.
       */
      requestId?: string;
      /**
       * Which surface's drawing, when the key is drawn on more than one; the
       * press carries the surface of the drawing it lands in either way.
       */
      surface?: RenderSurface;
      /**
       * For a Markdown answering its links: which of them the press lands on.
       */
      link?: PressedLink;
  };

SelectTarget type # line 22043

Added in 2.1.280

What $.ui.select takes: the plugin whose hook drew the Select, its key, the picked option's value, instance and surface when several.

17 lines
  export type SelectTarget = {
      plugin: string;
      key: string;
      /**
       * Which option is picked, by the `value` the Select listed it under.
       */
      value: string;
      /**
       * Which instance holds it, when the plugin drew the key in several.
       */
      requestId?: string;
      /**
       * Which surface's drawing, when the key is drawn on more than one; the
       * pick carries the surface of the drawing it lands in either way.
       */
      surface?: RenderSurface;
  };

test const # line 22072

Added in 2.1.271

One test: it passes when its body returns or resolves, and fails when it throws, rejects or outlasts its time (5000 ms, or timeoutMs).

The body gets the engine's $ and an on whose hooks sit beneath every plugin; plugins load inline plugins beside the one under test. A failure carries what the engine reported meanwhile: each hook it skipped, and why.

name
the test's name, led in its title by the describes around it
rest
the body, ($, on) => ..., or the options then the body
  export const test: (name: string, ...rest: TestRest) => void;

TestBody type # line 22082

Added in 2.1.271

A test: the engine's $, and on, a plugin's registrar, whose hooks sit beneath every plugin; beneath them the bottom hook throws, naming its event.

It registers hooks before its first call on $, which loads the plugins. Beneath $.state, ui.render, its $.ui.invalidate and session.append the kit answers. A check that fails in a hook, or a refused answer, fails it.

  export type TestBody = ($: Engine, on: On) => unknown;

TestOptions type # line 22090

Added in 2.1.271 · changed in 2.1.284

What test takes beside its name: the inline plugins it loads beside the one under test, and how long it may run (5000 ms when not given).

Also the plugin under test's userConfig values.

16 lines
  export type TestOptions = {
      plugins?: readonly Plugin[];
      timeoutMs?: number;
      /**
       * The plugin under test's `userConfig` values, standing as the ones
       * stored in settings.
       *
       * `register(on, options)` receives them as a load does: unlisted values
       * unset, defaults filled in, then validated, a bad required field failing
       * the load. Left out: the manifest's defaults. Inline plugins get none.
       *
       * @example
       * test('greets', { options: { greeting: 'yo' } }, body)
       */
      options?: PluginOptions;
  };

TestRest type # line 22110

Added in 2.1.271

What follows a test's name: its body, or its options then its body.

  export type TestRest = readonly [body: TestBody] | readonly [options: TestOptions, body: TestBody];

ThrowExpectation type # line 22116

Added in 2.1.271

What toThrow compares the thrown error with: a substring or pattern of its message, its class, a value carrying the whole message, or nothing.

  export type ThrowExpectation = string | RegExp | Constructor | WithMessage;

tier const # line 22124

Added in 2.1.271

Says which tier the plugin under test loads in, once, at the top of the file: prepend, user (when unsaid), append or builtin.

tier
the tier
  export const tier: (tier: PluginTier) => void;

WithMessage type # line 22129

Added in 2.1.271

An error-like value toThrow compares by its whole message.

  export type WithMessage = {
      message: string;
  };

Lanes type # line 22164

Added in 2.1.326

  type Lanes<L extends string> = {
    [K in L | `${L}${L}` | `${L}${L}${L}` | `${L}${L}${L}${L}`]: K extends L
      ? number
      : K extends `${L}${L}`
        ? vec2
        : K extends `${L}${L}${L}`
          ? vec3
          : vec4
  }

Lanes2 interface # line 22173

Added in 2.1.326

  interface Lanes2 extends Lanes<'x' | 'y'>, Lanes<'r' | 'g'> {
    readonly ' width': 2
    [lane: number]: number
  }

Lanes3 interface # line 22177

Added in 2.1.326

  interface Lanes3 extends Lanes<'x' | 'y' | 'z'>, Lanes<'r' | 'g' | 'b'> {
    readonly ' width': 3
    [lane: number]: number
  }

Lanes4 interface # line 22181

Added in 2.1.326

  interface Lanes4
    extends Lanes<'x' | 'y' | 'z' | 'w'>, Lanes<'r' | 'g' | 'b' | 'a'> {
    readonly ' width': 4
    [lane: number]: number
  }

Wide type # line 22186

Added in 2.1.326

  type Wide<A, Else = number> = A extends vec4
    ? vec4

One type # line 22193

Added in 2.1.326

  type One = <A extends number>(x: A) => Wide<A>
  type Two = <A extends number, B extends number>(a: A, b: B) => Wide<A, Wide<B>>

Three type # line 22195

Added in 2.1.326

  type Three = <A extends number, B extends number, C extends number>(
    a: A,
    b: B,
    c: C,
  ) => Wide<A, Wide<B, Wide<C>>>

vec2 type # line 22208

Added in 2.1.326

A vector is a number with lanes, so + - * / type-check, lane by lane, and a plain number goes to every lane. The result reads as number: name its width again with vec2(a + b), which the compiler proves. Lanes are xyzw or rgba, read and written in any order (c.rgb = vec3(0)), or by index (v[i]). Vectors copy.

  export type vec2 = number & Lanes2
  export type vec3 = number & Lanes3

vec4 type # line 22210

Added in 2.1.326

  export type vec4 = number & Lanes4

vec2 function # line 22213

Added in 2.1.326

Builds a vector from parts whose lanes add up, or from one number.

  export function vec2(...parts: number[]): vec2
  export function vec3(...parts: number[]): vec3

vec4 function # line 22215

Added in 2.1.326

  export function vec4(...parts: number[]): vec4

PI const # line 22217

Added in 2.1.326

  export const PI: number
  export const abs: One

sign const # line 22219

Added in 2.1.326

  export const sign: One
  export const floor: One

trunc const # line 22221

Added in 2.1.326

  export const trunc: One
  export const fract: One

sqrt const # line 22223

Added in 2.1.326

  export const sqrt: One
  export const sin: One

cos const # line 22225

Added in 2.1.326

  export const cos: One
  export const exp: One

log const # line 22227

Added in 2.1.326

  export const log: One
  export const tanh: One

normalize const # line 22229

Added in 2.1.326

  export const normalize: One
  export function length(v: number): number

dot function # line 22231

Added in 2.1.326

  export function dot(a: number, b: number): number
  export const min: Two

max const # line 22233

Added in 2.1.326

  export const max: Two
  /** The remainder with the sign of `b`. `%` keeps the sign of `a`, as in JS. */

mod const # line 22235

Added in 2.1.326

  export const mod: Two
  /** `a / b`, cut toward zero. */

quot const # line 22237

Added in 2.1.326

  export const quot: Two
  export const pow: Two

step const # line 22240

Added in 2.1.326

step(edge, x): 0 below the edge, else 1.

  export const step: Two
  /** `atan(y, x)`: the angle of (x, y), from -PI to PI. */

atan const # line 22242

Added in 2.1.326

  export const atan: Two
  /** `mix(a, b, t)` */

mix const # line 22244

Added in 2.1.326

  export const mix: Three
  /** `clamp(x, low, high)` */

clamp const # line 22246

Added in 2.1.326

  export const clamp: Three
  /** `smoothstep(from, to, x)`: the edges go in either order. */

smoothstep const # line 22248

Added in 2.1.326

  export const smoothstep: Three
  /** The change to the next pixel across, up, and the two added without sign. */

dx const # line 22250

Added in 2.1.326

  export const dx: One
  export const dy: One

fwidth const # line 22252

Added in 2.1.326

  export const fwidth: One

int type # line 22259

Added in 2.1.326

A 32-bit int that wraps: + - * & | ^ ~ << >> >>> with their JS meaning, * as Math.imul, shifts masked to 0..31. A whole number written beside an int is an int. int(a + b) names the result again.

  export type int = number & { readonly ' int': true }

int function # line 22261

Added in 2.1.326

Cuts toward zero and wraps, as x | 0 does.

  export function int(x: number): int
  /** The int as a number, from -2^31. */

signed function # line 22263

Added in 2.1.326

  export function signed(i: number): number
  /** The int as a number, from 0 to 2^32. */

unsigned function # line 22265

Added in 2.1.326

  export function unsigned(i: number): number
Feedback