Follow Discord
Sweep 25 Sep 2026 · 19:33Z Build v2.1.283 504 read Stable v2.1.274 Latest v2.1.283 Next v2.1.283 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.

Declarations570over 12 pages
Mined from2.1.283the shipped binary

Every named declaration in the file, 570 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 13,820 lines of TypeScript mined from build 2.1.283. 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, 501 to 550 of 570

ValueOrDeny type # line 12567

Added in 2.1.265

The result of a call on $ as the hooks on its event see it: { value }, the call's answer, or { deny }, the reason the caller's promise rejects.

  type ValueOrDeny<Value> = {
      value: Value;
      deny?: undefined;
  } | {
      deny: string;
      value?: undefined;
  };

WorktreeCreateHookInput type # line 12575

Added in 2.1.265

  type WorktreeCreateHookInput = BaseHookInput & {
      hook_event_name: 'WorktreeCreate';
      name: string;
  };

WorktreeRemoveHookInput type # line 12580

Added in 2.1.265

  type WorktreeRemoveHookInput = BaseHookInput & {
      hook_event_name: 'WorktreeRemove';
      worktree_path: string;
  };

atom const # line 12593

Added in 2.1.281

A named value with its initial: read answers the initial while nothing is written, so never undefined. Pure; runs in the plugin's environment.

import { atom, read, update } from "claude-code"
const count = atom({ plugin: "counter", key: "count" } as const, 0)
  export const atom: AtomFunction

derive const # line 12601

Added in 2.1.281

A value computed from atoms and references, cached by their versions.

const busy = derive([workers], list => list.filter(w => w.isBusy).length)
  export const derive: DeriveFunction

memberOf const # line 12609

Added in 2.1.281

A family's member for the instance being drawn, keyed by e.requestId.

const open = await read($, memberOf(isOpen, e))
  export const memberOf: MemberOfFunction

read const # line 12618

Added in 2.1.281

Reads an atom, a derived value or a reference through $.state.get; while a ui.render hook draws, that subscribes the drawing.

const n = await read($, count)
  export const read: ReadFunction

update const # line 12627

Added in 2.1.281

Reads, applies fn in the plugin's environment, writes with ifVersion, and tries again on a miss: what a handler closure calls.

<Button key="more" onPress={() => update($, count, n => n + 1)} />
  export const update: UpdateFunction

h const # line 12650

In the first published surface (2.1.259)

The JSX factory (classic runtime, @jsx h; the engine prepends the pragma): a plain-data element from a string tag or a component.

JSX compiles to bare h(...) calls resolved by name, so a module (hooks or surface) never declares, imports or takes as a parameter anything named h or Fragment where it writes JSX, and carries no @jsx pragma of its own: either silently points its JSX away from this factory, and a <Client> tag written under another factory is not found when the module's surface modules are read off its source.

    const h: (
      tag: string | ((props: never) => RenderNode | null | undefined),
      props: Record<string, unknown> | null | undefined,
      ...children: unknown[]
    ) => RenderNode | null | undefined

Fragment const # line 12659

In the first published surface (2.1.259)

<>...</>: a column Box around the children.

    const Fragment: (props: { children?: RenderNode[] }) => RenderElement

JSX namespace # line 12666

In the first published surface (2.1.259) · changed in 2.1.260, 2.1.265, 2.1.267

JSX over the element table: every tag is a constructor from $.ui.resolve(e) (const { Box, Text } = $.ui.resolve(e)), typed by its props; there are no intrinsic (string) tags.

    namespace JSX {
      type Element = RenderElement
      type Children = RenderChildren
      type ElementType = (props: never) => RenderNode | null | undefined
      interface IntrinsicElements {}
      interface ElementChildrenAttribute {
        children: unknown
      }
      interface IntrinsicAttributes {
        key?: string
      }
    }

AbortSignal interface # line 12679

In the first published surface (2.1.259)

    interface AbortSignal {
      readonly aborted: boolean
      readonly reason: unknown
      throwIfAborted(): void
      addEventListener(
        type: 'abort',
        listener: () => void,
        options?: { once?: boolean },
      ): void
      removeEventListener(type: 'abort', listener: () => void): void
    }

AbortController interface # line 12696

In the first published surface (2.1.259)

    interface AbortController {
      readonly signal: AbortSignal
      abort(reason?: unknown): void
    }

TextEncoder interface # line 12704

In the first published surface (2.1.259)

    interface TextEncoder {
      readonly encoding: string
      encode(input?: string): Uint8Array
    }

TextDecoder interface # line 12709

In the first published surface (2.1.259)

    interface TextDecoder {
      readonly encoding: string
      decode(input?: ArrayBufferView | ArrayBuffer): string
    }

URLSearchParams interface # line 12714

In the first published surface (2.1.259)

    interface URLSearchParams {
      append(name: string, value: string): void
      delete(name: string): void
      get(name: string): string | null
      getAll(name: string): string[]
      has(name: string): boolean
      set(name: string, value: string): void
      toString(): string
      forEach(callback: (value: string, key: string) => void): void
    }

URL interface # line 12728

In the first published surface (2.1.259)

16 lines
    interface URL {
      hash: string
      host: string
      hostname: string
      href: string
      readonly origin: string
      password: string
      pathname: string
      port: string
      protocol: string
      search: string
      readonly searchParams: URLSearchParams
      username: string
      toString(): string
      toJSON(): string
    }

atob function # line 12749

In the first published surface (2.1.259)

    function atob(data: string): string
    function btoa(data: string): string

structuredClone function # line 12751

In the first published surface (2.1.259)

    function structuredClone<T>(value: T): T
    var crypto: {
      readonly subtle: {
        digest(
          algorithm: string | { name: string },
          data: ArrayBufferView | ArrayBuffer,
        ): Promise<ArrayBuffer>
      }
      randomUUID(): string
      getRandomValues<T extends ArrayBufferView>(array: T): T
    }

AsymmetricMatcher type # line 12799

Added in 2.1.271

A value that matches by a rule inside toEqual and its kin (expect.any, expect.objectContaining), known by its text in a failure.

  export type AsymmetricMatcher = {
      readonly text: string;
  };

AsyncMatchers type # line 12807

Added in 2.1.271

The same checks on what a promise received settles with, each resolving once the promise has settled and the check passed.

  export type AsyncMatchers = {
      [K in keyof Matchers]: (...args: Parameters<Matchers[K]>) => Promise<void>;
  };

ClassicEvent type # line 12815

Added in 2.1.280

A classic hook event the engine raises on its own, by its own name (SessionStart, Stop): all but PreToolUse, which rides tool.call.

  export type ClassicEvent = Exclude<ClassicEventName, 'classic.PreToolUse'> extends `classic.${infer E}` ? E : never;

ClassicFields type # line 12825

Added in 2.1.280

What $.classic.<Event> takes: the event's own fields as its hook sees them on e, less what the engine stamps at every call site.

hook_event_name is the call's; session_id, transcript_path and cwd are the session's unless the test gives them (the test session's id, '' for no local transcript, the plugin's folder).

  export type ClassicFields<E extends ClassicEvent> = Omit<ClassicEventOf[`classic.${E}`], 'hook_event_name' | 'session_id' | 'transcript_path' | 'cwd'> & Partial<Pick<ClassicEventOf[`classic.${E}`], 'session_id' | 'transcript_path' | 'cwd'>>;

ClientScope type # line 12831

Added in 2.1.277

Which Client of a mounted drawing an act or a read means, by the key its element carries; optional while the drawing holds exactly one.

  export type ClientScope = {
      in?: string;
  };

Constructor type # line 12838

Added in 2.1.271

A class, as toThrow, toBeInstanceOf and expect.any take it.

  export type Constructor = abstract new (...args: never[]) => unknown;

describe const # line 12847

Added in 2.1.271

A group of tests: its name leads the title of each test declared inside, and its body runs at once, while the file loads.

name
the group's name
body
declares the group's tests
  export const describe: (name: string, body: () => void) => void;

ElementOfAct type # line 12857

Added in 2.1.277

The element each surface-dependent act of a mounted drawing reaches: a handle carries the act only where the surface's table has the element.

input needs Input and select needs Select (every surface but mobile today); key, pointer, post, advance and resize reach a Client (terminal and desktop today). The rest need nothing but a tree.

  export type ElementOfAct = {
      input: 'Input';
      select: 'Select';
      key: 'Client';
      pointer: 'Client';
      post: 'Client';
      advance: 'Client';
      resize: 'Client';
  };

ElementQuery type # line 12878

Added in 2.1.277

What a mounted drawing's find and findAll match an element on, every field given at once: its tag, its key, and the text it shows.

text matches the element's whole shown text (string children, a Button or Link's label, a Markdown's text, a Code's source, an Input's value): a string by inclusion, a RegExp by test.

await ui.findAll({ type: 'Text', text: /overdue/, in: 'board' })
  export type ElementQuery = {
      type?: string;
      key?: string;
      text?: string | RegExp;
      /**
       * Searches what this `Client`'s surface module drew (by the `Client`'s
       * key) instead of the plugin's own tree.
       */
      in?: string;
  };

Engine type # line 12897

Added in 2.1.271 · changed in 2.1.275, 2.1.280

What a test holds as $, the engine's own: every call on it is made as the REPL, the query loop and the render sites make theirs, over every plugin.

next.origin is the engine, the chain every plugin loaded. $.ui.mount is a surface drawing an instance; press, input and select a person acting on an element the test drew; $.classic the classic hook events.

  export type Engine = {
      [N in keyof EventCalls]: N extends 'ui' ? EngineNoun<N> & EnginePress & EngineInput & EngineSelect & EngineMount : EngineNoun<N>;
  } & {
      classic: EngineClassic;
  };

EngineCall type # line 12907

Added in 2.1.271

One call on the engine's $: the event's input whole, as an engine call site passes it, to its result, or for a streaming event to its stream.

  export type EngineCall<E extends EventName> = E extends StreamingEventName ? (e: Args<E>) => HookStream<Chunk<E>, ResultOf[E]> : (e: Args<E>) => Promise<ResultOf[E]>;

EngineClassic type # line 12920

Added in 2.1.280

The classic (settings) hook events as the engine raises them: each a call running the classic.<Event> chain over every plugin hooked on it.

No settings hook runs beneath, so the test's on('classic.<Event>') is the bottom; the envelope (hook_event_name, session_id, transcript_path, cwd) is stamped unless given. PreToolUse rides $.tool.call instead.

await $.classic.SessionStart({ source: 'clear' })
  export type EngineClassic = {
      [E in ClassicEvent]: (e: ClassicFields<E>) => Promise<ClassicResultOf[`classic.${E}`]>;
  };

EngineInput type # line 12928

Added in 2.1.280

A surface typing into an Input a test rendered: the ui.input chain over every plugin hooked on it, the Input's own handler last.

18 lines
  export type EngineInput = {
      /**
       * Types into the Input, as an edit (`kind` `change`, reaching `onInput`) or
       * Enter (`submit`, the default, reaching `onSubmit`) with that text.
       *
       * Resolves once the chain, the handler and the work it started settled.
       * `e.surface` is the surface of the drawing that holds it.
       *
       * @param target whose Input, its key, the text, the kind, and the instance
       *               and surface when several hold it
       * @returns what the chain settled on; rejects when no such Input is drawn, or
       *          several are and neither instance nor surface tells them apart
       * @example
       * await $.ui.input({ plugin: 'notes', key: 'q', text: 'g', kind: 'change' })
       * await $.ui.input({ plugin: 'notes', key: 'q', text: 'groceries' })
       */
      input: (target: InputTarget) => Promise<UiInputResult | undefined>;
  };

EngineMount type # line 12958

Added in 2.1.275 · changed in 2.1.277

A surface drawing a component instance through the plugins, then driven by key through a handle typed by that surface (Mounted).

ui.render raised there for those props, the tree validated by that table, its Clients running; the reads and press on every surface, input where the table has Input, the Client acts where Client.

for (const surface of SURFACES) run(await $.ui.mount({ ...HINT, surface }))
16 lines
  export type EngineMount = {
      /**
       * Raises the plugins' drawing of the component on the surface and holds
       * it, as that surface showing the instance does.
       *
       * Resolves once the tree validated and every `Client` in it drew once.
       *
       * @param target whose elements, the surface, the component, its props,
       *   the instance's requestId, and what the surface measured
       * @returns the mounted drawing; rejects when no `surface` (or an unknown
       *   one) is named, when the surface cannot draw the tree the chain
       *   returned (with the reason: an element its table lacks, a prop not
       *   allowed), or when a `Client`'s module failed or drew nothing
       */
      mount: <P extends RenderSurface, C extends RenderComponent>(target: MountTarget<P, C>) => Promise<Mounted<P, C>>;
  };

EngineNoun type # line 12979

Added in 2.1.271

One noun of the engine's $: each of its events as the engine calls it, tool.call and ui.render typed per tool and component, ui.resolve out.

  export type EngineNoun<N extends keyof EventCalls> = {
      [V in EngineNounEvent<N>]: `${N}.${V}` extends 'tool.call' | 'ui.render' ? EventCalls[N][V] : EngineCall<`${N}.${V}` & EventName>;
  };

EngineNounEvent type # line 12987

Added in 2.1.271

The events of one noun a test's $ carries: every one but ui.resolve, which a render hook calls on its own $ and the engine never raises.

  export type EngineNounEvent<N extends keyof EventCalls> = Exclude<keyof EventCalls[N] & string, `${N}.resolve` extends 'ui.resolve' ? 'resolve' : never>;

EnginePress type # line 12993

Added in 2.1.271

A surface pressing a Button a test rendered, or a Markdown's link: the ui.press chain over every plugin hooked on it, its own closure last.

16 lines
  export type EnginePress = {
      /**
       * Presses the Button, as a click or its hotkey does; with `link`, the
       * Markdown's link, as a click on it does.
       *
       * Resolves once the chain, `onPress` and any work `onPress` left running
       * unawaited have settled (work asleep on `mock.clock` waits for the test
       * to advance it). `e.surface` is the surface of the drawing that holds it.
       *
       * @param target whose element, its key, the instance and surface when
       *   several hold it, and for a Markdown the link
       * @returns what the chain settled on; rejects when no such element is
       *   drawn, or several are and neither instance nor surface tells them apart
       */
      press: (target: PressTarget) => Promise<UiPressResult | undefined>;
  };

EngineSelect type # line 13014

Added in 2.1.280

A surface picking an option of a Select a test rendered: the ui.select chain over every plugin hooked on it, the Select's own onSelect last.

16 lines
  export type EngineSelect = {
      /**
       * Picks the option, as choosing it on the surface does; resolves once the
       * chain, `onSelect` and the work it started have settled.
       *
       * `e.surface` is the surface of the drawing that holds it.
       *
       * @param target whose Select, its key, the option's value, and the
       *   instance and surface when several hold it
       * @returns what the chain settled on; rejects when no such Select is
       *   drawn, or several are and neither instance nor surface tells them apart
       * @example
       * await $.ui.select({ plugin: 'notes', key: 'sort', value: 'date' })
       */
      select: (target: SelectTarget) => Promise<UiSelectResult | undefined>;
  };

Expect type # line 13035

Added in 2.1.271

The checks on a value (expect(received)), and with them the matchers that stand inside an expected value (expect.any(Number)).

  export type Expect = Expecting & Matching;

expect const # line 13044

Added in 2.1.271

Checks a value: expect(received).toEqual(expected) throws an AssertionError naming both sides when it fails, a message given leading.

.not negates; .resolves and .rejects check what a promise settles with; expect.any(Number) and its kin stand inside an expected value.

  export const expect: Expect;

Expectation type # line 13050

Added in 2.1.271

What expect(received) answers: the checks, their negation, and the checks on what a promise received resolves or rejects with.

  export type Expectation = Negatable<Matchers> & {
      /**
       * The checks on what the promise received resolves with; a rejection
       * fails them.
       */
      resolves: Negatable<AsyncMatchers>;
      /**
       * The checks on what the promise received rejects with; a resolution
       * fails them.
       */
      rejects: Negatable<AsyncMatchers>;
  };

Expecting type # line 13067

Added in 2.1.271

expect(received, message?): the checks on a value, a message of the test's own leading a failure's.

  export type Expecting = (received: unknown, message?: string) => Expectation;

FoundElement type # line 13076

Added in 2.1.277

One element of a mounted drawing as find returns it: the description the plugin's hook (or a Client's module) built, read as plain data.

What every surface is handed to draw, not what any surface painted: the same on the terminal, the desktop, VS Code and mobile.

24 lines
  export type FoundElement = {
      /**
       * The element's tag: `Box`, `Text`, `Button`, `Input`, `Client`, ...
       */
      type: string;
      /**
       * What its props carry as `key`, when they do.
       */
      key: string | undefined;
      /**
       * Its props, plain data: a Button's `label`, a Text's `color`, ...;
       * handlers never cross (a Button's `onPress` is not here).
       */
      props: Record<string, unknown>;
      /**
       * What it shows: its string children in document order and, for the
       * leaves that draw a prop as text, that prop (ElementQuery `text`).
       */
      text: string;
      /**
       * Its children as drawn: strings and element descriptions.
       */
      children: unknown[];
  };

InputTarget type # line 13105

Added in 2.1.280

What $.ui.input takes: the plugin whose hook drew the Input, its key, the field's text, which input it is, instance and surface when several.

24 lines
  export type InputTarget = {
      plugin: string;
      key: string;
      /**
       * The field's whole text at that moment: `e.value` for the chain.
       */
      text: string;
      /**
       * `submit` (the default) is Enter with that text and reaches `onSubmit`;
       * `change` is one edit left in the field and reaches `onInput`.
       *
       * A person typing is a run of `change`s, then a `submit`.
       */
      kind?: UiInputArgument['kind'];
      /**
       * 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
       * input carries the surface of the drawing it lands in either way.
       */
      surface?: RenderSurface;
  };

Matchers type # line 13134

Added in 2.1.271

The checks expect(received) offers; each throws an AssertionError when it fails, naming what was expected and what was received.

134 lines
  export type Matchers = {
      /**
       * Passes when received is the value, by `Object.is`.
       *
       * @param expected the value
       */
      toBe: (expected: unknown) => void;
      /**
       * Passes when received equals the value in structure, properties holding
       * undefined ignored; `expect.any` and its kin match inside it.
       *
       * @param expected the value
       */
      toEqual: (expected: unknown) => void;
      /**
       * As `toEqual`, but undefined properties and prototypes count.
       *
       * @param expected the value
       */
      toStrictEqual: (expected: unknown) => void;
      /**
       * Passes when received holds at least the object's properties, equal.
       *
       * @param expected the object
       */
      toMatchObject: (expected: object) => void;
      /**
       * Passes when a string received includes the item, or an iterable
       * received has an element that is it.
       *
       * @param item the substring or element
       */
      toContain: (item: unknown) => void;
      /**
       * Passes when an iterable received has an element equal to the item.
       *
       * @param item the element
       */
      toContainEqual: (item: unknown) => void;
      /**
       * Passes when received's `length` is the number.
       *
       * @param length the number
       */
      toHaveLength: (length: number) => void;
      /**
       * Passes when received holds a property at the path (`a.b`, or the keys
       * in order), equal to the value when one is given.
       *
       * @param path the property's path
       * @param value what it must equal, when given
       */
      toHaveProperty: (path: string | readonly string[], value?: unknown) => void;
      /**
       * Passes when received is undefined.
       */
      toBeUndefined: () => void;
      /**
       * Passes when received is anything but undefined.
       */
      toBeDefined: () => void;
      /**
       * Passes when received is null.
       */
      toBeNull: () => void;
      /**
       * Passes when received is truthy.
       */
      toBeTruthy: () => void;
      /**
       * Passes when received is falsy.
       */
      toBeFalsy: () => void;
      /**
       * Passes when received is NaN.
       */
      toBeNaN: () => void;
      /**
       * Passes when received is greater than the bound.
       *
       * @param bound the bound
       */
      toBeGreaterThan: (bound: number | bigint) => void;
      /**
       * Passes when received is the bound or greater.
       *
       * @param bound the bound
       */
      toBeGreaterThanOrEqual: (bound: number | bigint) => void;
      /**
       * Passes when received is less than the bound.
       *
       * @param bound the bound
       */
      toBeLessThan: (bound: number | bigint) => void;
      /**
       * Passes when received is the bound or less.
       *
       * @param bound the bound
       */
      toBeLessThanOrEqual: (bound: number | bigint) => void;
      /**
       * Passes when a string received includes the text, or the pattern matches
       * it.
       *
       * @param pattern the text or pattern
       */
      toMatch: (pattern: string | RegExp) => void;
      /**
       * Passes when a string received starts with the prefix.
       *
       * @param prefix the prefix
       */
      toStartWith: (prefix: string) => void;
      /**
       * Passes when a string received ends with the suffix.
       *
       * @param suffix the suffix
       */
      toEndWith: (suffix: string) => void;
      /**
       * Passes when received is an instance of the class.
       *
       * @param expected the class
       */
      toBeInstanceOf: (expected: Constructor) => void;
      /**
       * Passes when calling received throws (or, under `rejects`, the rejection
       * is) an error as described: by substring, pattern, class or message.
       *
       * @param expected the description; any throw passes without one
       */
      toThrow: (expected?: ThrowExpectation) => void;
  };

Matching type # line 13273

Added in 2.1.271

The matchers that stand inside an expected value, each matching received there by a rule instead of by equality.

44 lines
  export type Matching = {
      /**
       * Matches any instance of the class, a primitive by its wrapper
       * (`expect.any(Number)`).
       *
       * @param expected the class
       * @returns the matcher
       */
      any: (expected: Constructor) => AsymmetricMatcher;
      /**
       * Matches anything but null and undefined.
       *
       * @returns the matcher
       */
      anything: () => AsymmetricMatcher;
      /**
       * Matches a string that includes the text.
       *
       * @param text the substring
       * @returns the matcher
       */
      stringContaining: (text: string) => AsymmetricMatcher;
      /**
       * Matches a string the pattern matches.
       *
       * @param pattern the pattern, or the source of one
       * @returns the matcher
       */
      stringMatching: (pattern: string | RegExp) => AsymmetricMatcher;
      /**
       * Matches an object holding at least the shape's properties, equal.
       *
       * @param shape the properties
       * @returns the matcher
       */
      objectContaining: (shape: object) => AsymmetricMatcher;
      /**
       * Matches an array holding an element equal to each of the items.
       *
       * @param items the elements
       * @returns the matcher
       */
      arrayContaining: (items: readonly unknown[]) => AsymmetricMatcher;
  };

Mock type # line 13322

Added in 2.1.271

The world beneath the plugins, mocked noun by noun: each member registers hooks of the test's on on, visible where the test calls it.

30 lines
  export type Mock = {
      /**
       * Answers `$.clock` from a clock in memory that moves only when the test
       * moves it: `clock.now` reads it, and each wait is held.
       *
       * A held wait resolves when an advance crosses the time it is due, and is
       * dropped when its dispatch aborts; one held past a hook's budget (ten
       * seconds of real time) is let go, as a hook that overran.
       *
       * @param on the test's `on`
       * @param options where the clock starts (`now`, 0 when not given)
       * @returns the clock: its time, and the calls that move it
       */
      clock: (on: On, options?: MockClockOptions) => MockClock;
      /**
       * Answers `$.store` from a store in memory: `get`, `set`, `delete` and
       * `keys` over it, as the engine keeps a plugin's own.
       *
       * @param on the test's `on`
       * @param entries what the store holds at the start (nothing when not given)
       */
      store: (on: On, entries?: Readonly<Record<string, unknown>>) => void;
      /**
       * Answers `$.env.get` from a set of variables; one not listed is unset.
       *
       * @param on the test's `on`
       * @param variables the environment the plugins read
       */
      env: (on: On, variables: Readonly<Record<string, string>>) => void;
  };

mock const # line 13360

Added in 2.1.271

The world beneath the plugins, mocked noun by noun: mock.clock, mock.store and mock.env.

Each registers hooks of the test's on the on it is handed, visible where the test calls it, and answers its noun from memory.

  export const mock: Mock;

MockClock type # line 13366

Added in 2.1.271

The clock mock.clock hands back: the time its hooks answer, and the only ways it moves.

45 lines
  export type MockClock = {
      /**
       * The time now, in milliseconds: what `$.clock.now()` resolves beneath the
       * plugins.
       *
       * @returns the time
       */
      now: () => number;
      /**
       * Moves the clock on, resolving each wait due on the way (`$.clock.sleep`,
       * `after`, `every`, this clock's `sleep`) in the order it comes due.
       *
       * The clock reads each wait's time as it resolves, and what one started
       * runs before the next resolves.
       *
       * @param ms how far to move, in milliseconds
       * @returns resolves once the clock is there and the event loop settled
       */
      advance: (ms: number) => Promise<void>;
      /**
       * Moves the clock to a time at or past now, as `advance` would.
       *
       * @param ms the time, in milliseconds
       * @returns resolves once the clock is there and the event loop settled
       */
      set: (ms: number) => Promise<void>;
      /**
       * Lets what is already under way run as far as it can without the clock
       * moving: every wait due now resolves and the event loop settles.
       *
       * The same as `advance(0)`; the name for the step between starting a
       * dispatch unawaited and looking at what it did.
       *
       * @returns resolves once the event loop settled, the time where it was
       */
      settle: () => Promise<void>;
      /**
       * Resolves once the clock has moved this far past now: how a hook of the
       * test's answers late.
       *
       * @param ms how far, in milliseconds
       * @returns resolves when an advance crosses that time
       */
      sleep: (ms: number) => Promise<void>;
  };

MockClockOptions type # line 13415

Added in 2.1.271

Where a mocked clock starts: now, in milliseconds (0 when not given).

  export type MockClockOptions = {
      now?: number;
  };

Mounted type # line 13427

Added in 2.1.277

A drawing of component C the test mounted on surface P: reads over its description, acts on its elements by key, Client acts where P has one.

Narrowed by the surface the test passed, as e.surface narrows $.ui.resolve(e): no input on mobile, no key on vscode, whose tables (Elements) lack Input and Client; over a union, their meet.

  export type Mounted<P extends RenderSurface = RenderSurface, C extends RenderComponent = RenderComponent> = {
      [K in keyof MountedMembers<P, C> as K extends keyof ElementOfAct ? ElementOfAct[K] extends keyof Elements[P] ? K : never : K]: MountedMembers<P, C>[K];
  };
Feedback