Condition
interfaceA named yes/no rule the host re-evaluates as state changes. Pass one to a command's or keybinding's `when` to control whether it is enabled and visible. The host watches whatever the predicate reads, so a command greys out on its own when the selection empties.
Import
import { Condition } from '@modular/sdk';Members4
- id
TIdIdentifier, unique within the mod.
- kind
'condition'- titleoptional
stringLabel shown where the host explains why something is disabled.
- when
ConditionPredicateEvaluated synchronously whenever the state it reads changes. Return `true` to enable or reveal whatever this condition gates. Keep it pure, the host may call it often.
Notes
- category
- State