Create a new RuleRegistry instance. You should normally not need to create a RuleRegistry directly, as it is managed by the Workspace.
Optionaloptions: Partial<WorkspaceOptions>Optional configuration settings for the rule registry.
Set or update the options for the registry.
an object containing the options to set or update.
Add a rule to the registry.
the rule to be added to the registry.
Add multiple rules to the registry.
the rules to be added to the registry.
Find a rule by its name.
the name of the rule to find.
the rule with the given name, or undefined if no such rule exists in the registry.
List all rules currently stored in the registry.
an unsorted array of all rules in the registry.
Retrieve all rules that have a specific annotation and optional value.
The annotation to filter rules by.
Optionalvalue: unknownThe optional value of the annotation to match.
An array of rules that match the annotation and value.
Clear all rules from the registry.
Perform type checking on all rules in the registry using the provided type checker. This method iterates through each rule, checks its types against the type checker, and returns an array of validation results.
N.B. Disabled rules are skipped during type checking, as they are not intended to be used in rule evaluation and may contain incomplete or invalid definitions.
The type checker to use for validating rules.
An array of validation results for each rule.
ProtectedpreventSort the given rules based on their salience. If strict conflict resolution is enabled, conflicts are checked and resolved before sorting.
an array of rules to be sorted.
a sorted array of rules, with higher salience rules appearing first.
RuleRegistry is responsible for storing all rules in the workspace and managing their salience and potential conflicts. It provides methods to add, retrieve, list, and clear rules, as well as to sort them based on their salience. If strict conflict resolution is enabled, it also checks for potential conflicts where multiple rules change the same output key and resolves them by keeping only the rule with the highest salience.