Interface: RulesBuilder
Defined in: builders/rules-builder.ts:13
Fluent builder for rule registries (P.rules(id)).
Aggregates always-active GlobalRule entries (pinned in [GLOBAL_RULES]) and partition- or effect-activated ScopedRuleNode entries.
Extends
Methods
global()
global(...rules): RulesBuilder;Defined in: builders/rules-builder.ts:26
Appends inline GlobalRule records or external SourceASTNode<GlobalRule | readonly GlobalRule[]> sources.
Preserves declaration order across all .global(...) calls on this registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
...rules | readonly MaybeSource< | { directive: string; id: string; } | readonly object[]>[] | Global rules or sources. |
Returns
RulesBuilder
New immutable rules builder.
scoped()
scoped(...rules): RulesBuilder;Defined in: builders/rules-builder.ts:39
Appends ScopedRuleNode builders/nodes or external SourceASTNode<ScopedRule | readonly ScopedRule[]> sources.
Extracts .toAST() from any ScopedRuleBuilder or source builder arguments.
Parameters
| Parameter | Type | Description |
|---|---|---|
...rules | readonly ( | MaybeBuilder<ScopedRuleNode> | MaybeSource< | { checks: BuiltInCheckASTNode<unknown>[]; directive: string; id: string; when: { effects?: FsGlobMatcherNode; partitions: string[]; }; } | readonly object[]>)[] | Scoped rules or sources. |
Returns
RulesBuilder
New immutable rules builder.
toAST()
toAST(): RulesNode;Defined in: ast/ast-builder.ts:20
Compiles the current builder configuration into a deeply frozen passive AST node.
Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.
Returns
Deeply frozen passive AST node.
Inherited from
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id | readonly | string | Unique identifier of the rules registry. | builders/rules-builder.ts:15 |