Skip to main content

CheckContext

interface

What a check body gets to inspect the half-built mod with. Deliberately narrow. A check reads what the host registered and asserts on it. It cannot run actions, open UI, or change state, because it runs while the generation is still provisional.

interface CheckContext

Import

import { CheckContext } from '@modular/sdk';

Members4

assert
(condition: boolean, message: string) => void

Fails the check with `message` when `condition` is false.

describeAction
(id: string) => Promise<ModularActionDescriptorDto | null>

One action's descriptor, or `null` when nothing is registered under `id`.

listActions
() => Promise<readonly ModularActionDescriptorDto[]>

Every action the host currently offers, this mod's included.

state
<TValue>(declaration: StateDeclaration<TValue>) => State<TValue> | <TName extends 'editor.selection' | 'host.scope' | 'workbench.colorTheme' | 'workbench.layout' | 'workbench.windowState' | 'workspace.focusedEditorGroupTab'>(name: TName) => State<BuiltInStateValue<TName>>

Read a declared or built-in state value.

Notes

category
Authoring