ValidationBuilders
type ValidationBuilders = { and: (rules) => ValidationRule; blockTypeIs: (name) => ValidationRule; markActiveInSelection: (name) => ValidationRule; not: (rule) => ValidationRule; or: (rules) => ValidationRule; predicate: (predicate, name?) => ValidationRule;};Defined in: validation.ts:40
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
and | (rules) => ValidationRule | - | validation.ts:41 |
blockTypeIs | (name) => ValidationRule | True when the block at the selection head has type name. | validation.ts:57 |
markActiveInSelection | (name) => ValidationRule | True when every text-bearing block in the current selection range is fully covered by mark name over its overlapping portion. For a collapsed selection this is always false (use selectionNotEmpty to gate visibility). Mirrors the semantics that tx.toggleMark uses to decide whether the toggle adds or removes — so the toolbar’s “active” highlight matches what clicking the button would do. | validation.ts:55 |
not | (rule) => ValidationRule | - | validation.ts:43 |
or | (rules) => ValidationRule | - | validation.ts:42 |
predicate | (predicate, name?) => ValidationRule | Escape hatch for extension-defined predicates. The optional name is used in error messages and devtools but has no runtime effect. | validation.ts:46 |