Skip to content

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

PropertyTypeDescriptionDefined in
and(rules) => ValidationRule-validation.ts:41
blockTypeIs(name) => ValidationRuleTrue when the block at the selection head has type name.validation.ts:57
markActiveInSelection(name) => ValidationRuleTrue 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?) => ValidationRuleEscape hatch for extension-defined predicates. The optional name is used in error messages and devtools but has no runtime effect.validation.ts:46