trilean 1.6.1 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,12 +12,11 @@ type ComplexValue = Extract<ComputedValue, {
12
12
  type NumberValue = Extract<ComputedValue, {
13
13
  kind: "number";
14
14
  }>;
15
- declare const complexFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexValue;
15
+ export declare const complexFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexValue;
16
16
  /** The `complexLiteral` node counterpart of `complexFromPolar`, for authoring a tree in polar terms; the conversion itself is done once, there, rather than repeated here. */
17
- declare const complexLiteralFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexLiteralNode;
17
+ export declare const complexLiteralFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexLiteralNode;
18
18
  /** |z|, as a real number in the same unit the complex value itself carries -- the magnitude of an impedance in ohms is a real quantity in ohms. */
19
- declare const complexMagnitude: (value: ComplexValue) => NumberValue;
19
+ export declare const complexMagnitude: (value: ComplexValue) => NumberValue;
20
20
  /** arg(z), as a dimensionless real number of radians: an angle is a ratio of two lengths, so it carries no unit of its own regardless of what the value it was read from carried. */
21
- declare const complexPhase: (value: ComplexValue) => NumberValue;
22
- //#endregion
23
- export { complexFromPolar, complexLiteralFromPolar, complexMagnitude, complexPhase };
21
+ export declare const complexPhase: (value: ComplexValue) => NumberValue;
22
+ //#endregion
package/dist/complex.d.ts CHANGED
@@ -12,12 +12,11 @@ type ComplexValue = Extract<ComputedValue, {
12
12
  type NumberValue = Extract<ComputedValue, {
13
13
  kind: "number";
14
14
  }>;
15
- declare const complexFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexValue;
15
+ export declare const complexFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexValue;
16
16
  /** The `complexLiteral` node counterpart of `complexFromPolar`, for authoring a tree in polar terms; the conversion itself is done once, there, rather than repeated here. */
17
- declare const complexLiteralFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexLiteralNode;
17
+ export declare const complexLiteralFromPolar: (magnitude: number, phase: number, unit?: Unit) => ComplexLiteralNode;
18
18
  /** |z|, as a real number in the same unit the complex value itself carries -- the magnitude of an impedance in ohms is a real quantity in ohms. */
19
- declare const complexMagnitude: (value: ComplexValue) => NumberValue;
19
+ export declare const complexMagnitude: (value: ComplexValue) => NumberValue;
20
20
  /** arg(z), as a dimensionless real number of radians: an angle is a ratio of two lengths, so it carries no unit of its own regardless of what the value it was read from carried. */
21
- declare const complexPhase: (value: ComplexValue) => NumberValue;
22
- //#endregion
23
- export { complexFromPolar, complexLiteralFromPolar, complexMagnitude, complexPhase };
21
+ export declare const complexPhase: (value: ComplexValue) => NumberValue;
22
+ //#endregion
@@ -4,9 +4,8 @@ import { ExpressionNode, PredicateNode } from "./tree.cjs";
4
4
  /**
5
5
  * `sum`, `count`, and `average` are never their own `FoldCombiner` mode -- each is a builder function that assembles an ordinary `fold` (and, for `average`, one `arithmetic` division of two ordinary folds), exactly the same treatment `derived-connectives.ts` already gives `xor`/`nand`/`nor`/`implies`/`iff`/`none` (see the "Derived aggregates" section of README.md).
6
6
  */
7
- declare const sum: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
8
- declare const presenceOf: (probe: ExpressionNode) => ExpressionNode;
9
- declare const count: (collection: JsonValue, filter?: PredicateNode, probe?: ExpressionNode) => ExpressionNode;
10
- declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
11
- //#endregion
12
- export { average, count, presenceOf, sum };
7
+ export declare const sum: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
8
+ export declare const presenceOf: (probe: ExpressionNode) => ExpressionNode;
9
+ export declare const count: (collection: JsonValue, filter?: PredicateNode, probe?: ExpressionNode) => ExpressionNode;
10
+ export declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
11
+ //#endregion
@@ -4,9 +4,8 @@ import { ExpressionNode, PredicateNode } from "./tree.js";
4
4
  /**
5
5
  * `sum`, `count`, and `average` are never their own `FoldCombiner` mode -- each is a builder function that assembles an ordinary `fold` (and, for `average`, one `arithmetic` division of two ordinary folds), exactly the same treatment `derived-connectives.ts` already gives `xor`/`nand`/`nor`/`implies`/`iff`/`none` (see the "Derived aggregates" section of README.md).
6
6
  */
7
- declare const sum: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
8
- declare const presenceOf: (probe: ExpressionNode) => ExpressionNode;
9
- declare const count: (collection: JsonValue, filter?: PredicateNode, probe?: ExpressionNode) => ExpressionNode;
10
- declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
11
- //#endregion
12
- export { average, count, presenceOf, sum };
7
+ export declare const sum: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
8
+ export declare const presenceOf: (probe: ExpressionNode) => ExpressionNode;
9
+ export declare const count: (collection: JsonValue, filter?: PredicateNode, probe?: ExpressionNode) => ExpressionNode;
10
+ export declare const average: (collection: JsonValue, item: ExpressionNode, filter?: PredicateNode) => ExpressionNode;
11
+ //#endregion
@@ -4,14 +4,13 @@ import { PredicateNode } from "./tree.cjs";
4
4
  /**
5
5
  * `not`/`and`/`or` are the primitive `PredicateNode` object-constructors -- everything else in this file is built purely by composing these three, so its three-valued correctness is inherited from the already-verified AND/OR/NOT tables rather than requiring a separate proof (see the "Derived connectives" section of README.md).
6
6
  */
7
- declare const not: (a: PredicateNode) => PredicateNode;
8
- declare const and: (a: PredicateNode, b: PredicateNode) => PredicateNode;
9
- declare const or: (a: PredicateNode, b: PredicateNode) => PredicateNode;
10
- declare const xor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
11
- declare const nand: (a: PredicateNode, b: PredicateNode) => PredicateNode;
12
- declare const nor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
13
- declare const implies: (a: PredicateNode, b: PredicateNode) => PredicateNode;
14
- declare const iff: (a: PredicateNode, b: PredicateNode) => PredicateNode;
15
- declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
16
- //#endregion
17
- export { and, iff, implies, nand, none, nor, not, or, xor };
7
+ export declare const not: (a: PredicateNode) => PredicateNode;
8
+ export declare const and: (a: PredicateNode, b: PredicateNode) => PredicateNode;
9
+ export declare const or: (a: PredicateNode, b: PredicateNode) => PredicateNode;
10
+ export declare const xor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
11
+ export declare const nand: (a: PredicateNode, b: PredicateNode) => PredicateNode;
12
+ export declare const nor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
13
+ export declare const implies: (a: PredicateNode, b: PredicateNode) => PredicateNode;
14
+ export declare const iff: (a: PredicateNode, b: PredicateNode) => PredicateNode;
15
+ export declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
16
+ //#endregion
@@ -4,14 +4,13 @@ import { PredicateNode } from "./tree.js";
4
4
  /**
5
5
  * `not`/`and`/`or` are the primitive `PredicateNode` object-constructors -- everything else in this file is built purely by composing these three, so its three-valued correctness is inherited from the already-verified AND/OR/NOT tables rather than requiring a separate proof (see the "Derived connectives" section of README.md).
6
6
  */
7
- declare const not: (a: PredicateNode) => PredicateNode;
8
- declare const and: (a: PredicateNode, b: PredicateNode) => PredicateNode;
9
- declare const or: (a: PredicateNode, b: PredicateNode) => PredicateNode;
10
- declare const xor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
11
- declare const nand: (a: PredicateNode, b: PredicateNode) => PredicateNode;
12
- declare const nor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
13
- declare const implies: (a: PredicateNode, b: PredicateNode) => PredicateNode;
14
- declare const iff: (a: PredicateNode, b: PredicateNode) => PredicateNode;
15
- declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
16
- //#endregion
17
- export { and, iff, implies, nand, none, nor, not, or, xor };
7
+ export declare const not: (a: PredicateNode) => PredicateNode;
8
+ export declare const and: (a: PredicateNode, b: PredicateNode) => PredicateNode;
9
+ export declare const or: (a: PredicateNode, b: PredicateNode) => PredicateNode;
10
+ export declare const xor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
11
+ export declare const nand: (a: PredicateNode, b: PredicateNode) => PredicateNode;
12
+ export declare const nor: (a: PredicateNode, b: PredicateNode) => PredicateNode;
13
+ export declare const implies: (a: PredicateNode, b: PredicateNode) => PredicateNode;
14
+ export declare const iff: (a: PredicateNode, b: PredicateNode) => PredicateNode;
15
+ export declare const none: (collection: JsonValue, item: PredicateNode, filter?: PredicateNode) => PredicateNode;
16
+ //#endregion
@@ -1,7 +1,6 @@
1
1
  import { ExpressionNode, PredicateNode } from "./tree.cjs";
2
2
  //#region src/derived-patterns.d.ts
3
- declare const prefixPattern: (text: ExpressionNode, prefix: string) => PredicateNode;
4
- declare const wildcardPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
5
- declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
6
- //#endregion
7
- export { hierarchicalGlobPattern, prefixPattern, wildcardPattern };
3
+ export declare const prefixPattern: (text: ExpressionNode, prefix: string) => PredicateNode;
4
+ export declare const wildcardPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
5
+ export declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
6
+ //#endregion
@@ -1,7 +1,6 @@
1
1
  import { ExpressionNode, PredicateNode } from "./tree.js";
2
2
  //#region src/derived-patterns.d.ts
3
- declare const prefixPattern: (text: ExpressionNode, prefix: string) => PredicateNode;
4
- declare const wildcardPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
5
- declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
6
- //#endregion
7
- export { hierarchicalGlobPattern, prefixPattern, wildcardPattern };
3
+ export declare const prefixPattern: (text: ExpressionNode, prefix: string) => PredicateNode;
4
+ export declare const wildcardPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
5
+ export declare const hierarchicalGlobPattern: (text: ExpressionNode, pattern: string) => PredicateNode;
6
+ //#endregion
@@ -5,6 +5,5 @@ import { ExpressionNode } from "./tree.cjs";
5
5
  *
6
6
  * Built right-to-left over the full `[first, second, ...rest]` candidate list via `reduceRight`, which needs no seed value here -- `first`/`second` being required arguments (rather than accepting a single `ExpressionNode[]`) guarantees the list always has at least two elements, so the no-initial-value overload of `reduceRight` never hits an empty array.
7
7
  */
8
- declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
9
- //#endregion
10
- export { coalesce };
8
+ export declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
9
+ //#endregion
@@ -5,6 +5,5 @@ import { ExpressionNode } from "./tree.js";
5
5
  *
6
6
  * Built right-to-left over the full `[first, second, ...rest]` candidate list via `reduceRight`, which needs no seed value here -- `first`/`second` being required arguments (rather than accepting a single `ExpressionNode[]`) guarantees the list always has at least two elements, so the no-initial-value overload of `reduceRight` never hits an empty array.
7
7
  */
8
- declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
9
- //#endregion
10
- export { coalesce };
8
+ export declare const coalesce: (first: ExpressionNode, second: ExpressionNode, ...rest: readonly ExpressionNode[]) => ExpressionNode;
9
+ //#endregion
@@ -3,14 +3,14 @@ import { z } from "zod";
3
3
  /**
4
4
  * Every evaluation -- of a predicate node or an expression node -- produces exactly one of two outcomes: a definite result, or an indeterminate result carrying a reason. Never a bare boolean/number, and never a thrown exception for a data-quality problem.
5
5
  */
6
- type Evaluation<T> = {
6
+ export type Evaluation<T> = {
7
7
  status: "definite";
8
8
  value: T;
9
9
  } | {
10
10
  status: "indeterminate";
11
11
  reason: IndeterminateReason;
12
12
  };
13
- declare const IndeterminateReasonSchema: z.ZodObject<{
13
+ export declare const IndeterminateReasonSchema: z.ZodObject<{
14
14
  code: z.ZodEnum<{
15
15
  "not-found": "not-found";
16
16
  "wrong-type": "wrong-type";
@@ -18,12 +18,11 @@ declare const IndeterminateReasonSchema: z.ZodObject<{
18
18
  }>;
19
19
  message: z.ZodString;
20
20
  }, z.core.$strip>;
21
- type IndeterminateReason = z.infer<typeof IndeterminateReasonSchema>;
22
- declare function definite<T>(value: T): Evaluation<T>;
23
- declare function indeterminate(code: IndeterminateReason["code"], message: string): Evaluation<never>;
21
+ export type IndeterminateReason = z.infer<typeof IndeterminateReasonSchema>;
22
+ export declare function definite<T>(value: T): Evaluation<T>;
23
+ export declare function indeterminate(code: IndeterminateReason["code"], message: string): Evaluation<never>;
24
24
  /**
25
25
  * Implements the tie-break rule from "The evaluation model": when several sub-evaluations could each independently be indeterminate for a different reason, take the first indeterminate reason encountered in the node's own declared operand order. Entries that are `undefined` (an operand not yet evaluated, or not applicable to this node kind) are skipped rather than treated as indeterminate.
26
26
  */
27
- declare function firstIndeterminate(...results: readonly (Evaluation<unknown> | undefined)[]): IndeterminateReason | undefined;
28
- //#endregion
29
- export { Evaluation, IndeterminateReason, IndeterminateReasonSchema, definite, firstIndeterminate, indeterminate };
27
+ export declare function firstIndeterminate(...results: readonly (Evaluation<unknown> | undefined)[]): IndeterminateReason | undefined;
28
+ //#endregion
@@ -3,14 +3,14 @@ import { z } from "zod";
3
3
  /**
4
4
  * Every evaluation -- of a predicate node or an expression node -- produces exactly one of two outcomes: a definite result, or an indeterminate result carrying a reason. Never a bare boolean/number, and never a thrown exception for a data-quality problem.
5
5
  */
6
- type Evaluation<T> = {
6
+ export type Evaluation<T> = {
7
7
  status: "definite";
8
8
  value: T;
9
9
  } | {
10
10
  status: "indeterminate";
11
11
  reason: IndeterminateReason;
12
12
  };
13
- declare const IndeterminateReasonSchema: z.ZodObject<{
13
+ export declare const IndeterminateReasonSchema: z.ZodObject<{
14
14
  code: z.ZodEnum<{
15
15
  "not-found": "not-found";
16
16
  "wrong-type": "wrong-type";
@@ -18,12 +18,11 @@ declare const IndeterminateReasonSchema: z.ZodObject<{
18
18
  }>;
19
19
  message: z.ZodString;
20
20
  }, z.core.$strip>;
21
- type IndeterminateReason = z.infer<typeof IndeterminateReasonSchema>;
22
- declare function definite<T>(value: T): Evaluation<T>;
23
- declare function indeterminate(code: IndeterminateReason["code"], message: string): Evaluation<never>;
21
+ export type IndeterminateReason = z.infer<typeof IndeterminateReasonSchema>;
22
+ export declare function definite<T>(value: T): Evaluation<T>;
23
+ export declare function indeterminate(code: IndeterminateReason["code"], message: string): Evaluation<never>;
24
24
  /**
25
25
  * Implements the tie-break rule from "The evaluation model": when several sub-evaluations could each independently be indeterminate for a different reason, take the first indeterminate reason encountered in the node's own declared operand order. Entries that are `undefined` (an operand not yet evaluated, or not applicable to this node kind) are skipped rather than treated as indeterminate.
26
26
  */
27
- declare function firstIndeterminate(...results: readonly (Evaluation<unknown> | undefined)[]): IndeterminateReason | undefined;
28
- //#endregion
29
- export { Evaluation, IndeterminateReason, IndeterminateReasonSchema, definite, firstIndeterminate, indeterminate };
27
+ export declare function firstIndeterminate(...results: readonly (Evaluation<unknown> | undefined)[]): IndeterminateReason | undefined;
28
+ //#endregion
@@ -1,21 +1,20 @@
1
1
  import { Evaluation } from "./evaluation.cjs";
2
2
  //#region src/evaluator-budget.d.ts
3
3
  /** A defense-in-depth guard against a long acyclic `treeReference` chain exhausting the call stack -- distinct from, and layered on top of, the cycle detector in evaluator.ts (`visitedTreeKeys`), which catches an actual repeat immediately and more precisely. */
4
- declare const MAX_TREE_REFERENCE_DEPTH = 100;
4
+ export declare const MAX_TREE_REFERENCE_DEPTH = 100;
5
5
  /** Default cap on the total number of predicate/expression nodes a single `evaluatePredicate`/`evaluateValue` call may visit -- see `createEvaluator`'s `maxNodes` option, threaded through to `createEvaluationBudget` below. Chosen generously above any realistic hand-authored business-rule, eligibility, or formula tree (see README.md's own consumer use cases), while still bounding an untrusted, adversarially-authored tree's total evaluation cost to a fixed, small amount of work regardless of how it is shaped. */
6
- declare const DEFAULT_MAX_EVALUATION_NODES = 10000;
6
+ export declare const DEFAULT_MAX_EVALUATION_NODES = 10000;
7
7
  /** Default cap on ordinary recursive-descent nesting depth -- see `createEvaluator`'s `maxNestingDepth` option, threaded through to `createEvaluationBudget` below. Set comfortably below the depth at which this evaluator's own recursive descent has been observed to exhaust the host call stack (a chain of plain `not` nodes wrapped around a single leaf, evaluated directly against this file under Node.js, failed consistently somewhere in the low thousands of nesting levels, with some run-to-run variance from whatever else already occupied the stack), while remaining far deeper than any legitimate hand-authored tree is ever likely to nest. Kept well clear of that measured failure point because the exact threshold varies by host runtime (a Cloudflare Workers isolate's own stack is smaller than Node's) and by how much of the stack the rest of the call chain has already used. */
8
- declare const DEFAULT_MAX_NESTING_DEPTH = 500;
8
+ export declare const DEFAULT_MAX_NESTING_DEPTH = 500;
9
9
  /**
10
10
  * A single `evaluatePredicate`/`evaluateValue` call's resource limits, independent of and layered underneath `MAX_TREE_REFERENCE_DEPTH`'s own cross-tree chain guard above: that guard only advances at an actual `treeReference` resolution and says nothing about a plain, self-contained tree built from ordinary `and`/`or`/`fold`/`conditional`/quantifier nesting, with no `treeReference` node anywhere in it. This closes that gap for a consumer evaluating a tree it did not author and cannot fully trust before evaluation (e.g. a tree embedded in a signed but otherwise attacker-controlled payload).
11
11
  *
12
12
  * Exposed as a single `checkNode` method rather than a raw mutable counter, following the same all-callback shape `Resolvers` and `FunctionRegistry` use in evaluator.ts: every recursive call site threads this object through as `Readonly<EvaluationBudget>`, and that wrapper genuinely prevents tampering because the running node count lives in `createEvaluationBudget`'s own closure, never as an assignable property on the object itself.
13
13
  */
14
- interface EvaluationBudget {
14
+ export interface EvaluationBudget {
15
15
  /** Charges one node visit and checks both caps, returning the `Evaluation` to return immediately if either is now exceeded, or `undefined` if evaluation of this node may proceed. Called as the very first action inside `evaluatePredicateInternal`/`evaluateValueInternal`, before any of that node's own work or further recursion, so an exceeded budget is discovered before it can be spent on additional descent. */
16
16
  checkNode: (nestingDepth: number) => Evaluation<never> | undefined;
17
17
  }
18
18
  /** Constructs a fresh `EvaluationBudget` for one top-level `evaluatePredicate`/`evaluateValue` call -- see `createEvaluator`'s `maxNodes`/`maxNestingDepth` options, which supply `maxNodes`/`maxNestingDepth` here. A fresh closure per call is what keeps `nodesVisited` from leaking between unrelated evaluations. */
19
- declare function createEvaluationBudget(maxNodes: number, maxNestingDepth: number): EvaluationBudget;
20
- //#endregion
21
- export { DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH, EvaluationBudget, MAX_TREE_REFERENCE_DEPTH, createEvaluationBudget };
19
+ export declare function createEvaluationBudget(maxNodes: number, maxNestingDepth: number): EvaluationBudget;
20
+ //#endregion
@@ -1,21 +1,20 @@
1
1
  import { Evaluation } from "./evaluation.js";
2
2
  //#region src/evaluator-budget.d.ts
3
3
  /** A defense-in-depth guard against a long acyclic `treeReference` chain exhausting the call stack -- distinct from, and layered on top of, the cycle detector in evaluator.ts (`visitedTreeKeys`), which catches an actual repeat immediately and more precisely. */
4
- declare const MAX_TREE_REFERENCE_DEPTH = 100;
4
+ export declare const MAX_TREE_REFERENCE_DEPTH = 100;
5
5
  /** Default cap on the total number of predicate/expression nodes a single `evaluatePredicate`/`evaluateValue` call may visit -- see `createEvaluator`'s `maxNodes` option, threaded through to `createEvaluationBudget` below. Chosen generously above any realistic hand-authored business-rule, eligibility, or formula tree (see README.md's own consumer use cases), while still bounding an untrusted, adversarially-authored tree's total evaluation cost to a fixed, small amount of work regardless of how it is shaped. */
6
- declare const DEFAULT_MAX_EVALUATION_NODES = 10000;
6
+ export declare const DEFAULT_MAX_EVALUATION_NODES = 10000;
7
7
  /** Default cap on ordinary recursive-descent nesting depth -- see `createEvaluator`'s `maxNestingDepth` option, threaded through to `createEvaluationBudget` below. Set comfortably below the depth at which this evaluator's own recursive descent has been observed to exhaust the host call stack (a chain of plain `not` nodes wrapped around a single leaf, evaluated directly against this file under Node.js, failed consistently somewhere in the low thousands of nesting levels, with some run-to-run variance from whatever else already occupied the stack), while remaining far deeper than any legitimate hand-authored tree is ever likely to nest. Kept well clear of that measured failure point because the exact threshold varies by host runtime (a Cloudflare Workers isolate's own stack is smaller than Node's) and by how much of the stack the rest of the call chain has already used. */
8
- declare const DEFAULT_MAX_NESTING_DEPTH = 500;
8
+ export declare const DEFAULT_MAX_NESTING_DEPTH = 500;
9
9
  /**
10
10
  * A single `evaluatePredicate`/`evaluateValue` call's resource limits, independent of and layered underneath `MAX_TREE_REFERENCE_DEPTH`'s own cross-tree chain guard above: that guard only advances at an actual `treeReference` resolution and says nothing about a plain, self-contained tree built from ordinary `and`/`or`/`fold`/`conditional`/quantifier nesting, with no `treeReference` node anywhere in it. This closes that gap for a consumer evaluating a tree it did not author and cannot fully trust before evaluation (e.g. a tree embedded in a signed but otherwise attacker-controlled payload).
11
11
  *
12
12
  * Exposed as a single `checkNode` method rather than a raw mutable counter, following the same all-callback shape `Resolvers` and `FunctionRegistry` use in evaluator.ts: every recursive call site threads this object through as `Readonly<EvaluationBudget>`, and that wrapper genuinely prevents tampering because the running node count lives in `createEvaluationBudget`'s own closure, never as an assignable property on the object itself.
13
13
  */
14
- interface EvaluationBudget {
14
+ export interface EvaluationBudget {
15
15
  /** Charges one node visit and checks both caps, returning the `Evaluation` to return immediately if either is now exceeded, or `undefined` if evaluation of this node may proceed. Called as the very first action inside `evaluatePredicateInternal`/`evaluateValueInternal`, before any of that node's own work or further recursion, so an exceeded budget is discovered before it can be spent on additional descent. */
16
16
  checkNode: (nestingDepth: number) => Evaluation<never> | undefined;
17
17
  }
18
18
  /** Constructs a fresh `EvaluationBudget` for one top-level `evaluatePredicate`/`evaluateValue` call -- see `createEvaluator`'s `maxNodes`/`maxNestingDepth` options, which supply `maxNodes`/`maxNestingDepth` here. A fresh closure per call is what keeps `nodesVisited` from leaking between unrelated evaluations. */
19
- declare function createEvaluationBudget(maxNodes: number, maxNestingDepth: number): EvaluationBudget;
20
- //#endregion
21
- export { DEFAULT_MAX_EVALUATION_NODES, DEFAULT_MAX_NESTING_DEPTH, EvaluationBudget, MAX_TREE_REFERENCE_DEPTH, createEvaluationBudget };
19
+ export declare function createEvaluationBudget(maxNodes: number, maxNestingDepth: number): EvaluationBudget;
20
+ //#endregion
@@ -7,17 +7,16 @@ import { FunctionRegistry } from "./functions.cjs";
7
7
  import { EvaluationContext, Resolvers } from "./resolvers.cjs";
8
8
  //#region src/evaluator-collection.d.ts
9
9
  /** `resolveParticipatingItems`'s own view of `evaluatePredicateInternal` -- the exact signature that function has in evaluator.ts, injected here rather than imported directly so this module has no dependency back on evaluator.ts. Evaluating a `filter` genuinely does need the full recursive predicate evaluator (a filter can itself be arbitrarily nested), but taking it as a parameter rather than an import means this collection-resolution logic and evaluator.ts's mutually-recursive `evaluatePredicateInternal`/`evaluateValueInternal` pair never import each other, so there is no circular-import hazard between the two files. */
10
- type EvaluatePredicate = (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>, accumulator: ComputedValue | undefined, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number) => Promise<Evaluation<boolean>>;
10
+ export type EvaluatePredicate = (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>, accumulator: ComputedValue | undefined, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number) => Promise<Evaluation<boolean>>;
11
11
  /** A collection candidate paired with its own pre-filter outcome: `"include"`/`"exclude"` when `filter` resolved definitely, or the filter's own indeterminate `Evaluation` when it did not (there is no third, definite-but-neither branch -- see `resolveParticipatingItems` below). */
12
- interface ResolvedCollectionItem {
12
+ export interface ResolvedCollectionItem {
13
13
  readonly item: unknown;
14
14
  readonly filterOutcome: "include" | "exclude" | Evaluation<never>;
15
15
  }
16
16
  /**
17
17
  * Collection resolution shared by the quantifiers (`some`/`every`) and by `fold` in evaluator.ts: resolves the opaque `collection` reference to its concrete candidate list via `resolvers.resolveCollection`, then evaluates each candidate's optional `filter` (via the injected `evaluatePredicate`, see `EvaluatePredicate`'s own doc comment) with that candidate as its own evaluation context and the accumulator reset to `undefined` -- see the README's "Evaluation context" and "Pre-filtering which items participate" sections. Deliberately stops short of deciding how an indeterminate filter combines with the rest of the surrounding node: `some`/`every` fold a filter-indeterminate item in as its own vote via the surrounding OR/AND absorption, while `fold` has no absorbing value at all and goes indeterminate outright on the same condition -- the two callers need genuinely different combination logic over these same per-item outcomes, so this helper only produces the outcomes and leaves combining them to the caller.
18
18
  */
19
- declare function resolveParticipatingItems(evaluatePredicate: EvaluatePredicate, collection: JsonValue, filter: PredicateNode | undefined, context: EvaluationContext, resolvers: Readonly<Resolvers>, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number): Promise<ResolvedCollectionItem[]>;
19
+ export declare function resolveParticipatingItems(evaluatePredicate: EvaluatePredicate, collection: JsonValue, filter: PredicateNode | undefined, context: EvaluationContext, resolvers: Readonly<Resolvers>, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number): Promise<ResolvedCollectionItem[]>;
20
20
  /** The first participating item (in declared collection order) whose `filter` evaluation was itself indeterminate, or `undefined` if every participating item's filter resolved definitely -- a filter-excluded item's own `"exclude"` outcome never counts here. Used only by `fold`, which -- unlike `some`/`every`'s OR/AND absorption -- has no absorbing value at all: any participating item's indeterminate filter makes the whole fold indeterminate outright, with no other item's outcome able to override it. */
21
- declare function firstFilterIndeterminate(participating: readonly ResolvedCollectionItem[]): IndeterminateReason | undefined;
22
- //#endregion
23
- export { EvaluatePredicate, ResolvedCollectionItem, firstFilterIndeterminate, resolveParticipatingItems };
21
+ export declare function firstFilterIndeterminate(participating: readonly ResolvedCollectionItem[]): IndeterminateReason | undefined;
22
+ //#endregion
@@ -7,17 +7,16 @@ import { FunctionRegistry } from "./functions.js";
7
7
  import { EvaluationContext, Resolvers } from "./resolvers.js";
8
8
  //#region src/evaluator-collection.d.ts
9
9
  /** `resolveParticipatingItems`'s own view of `evaluatePredicateInternal` -- the exact signature that function has in evaluator.ts, injected here rather than imported directly so this module has no dependency back on evaluator.ts. Evaluating a `filter` genuinely does need the full recursive predicate evaluator (a filter can itself be arbitrarily nested), but taking it as a parameter rather than an import means this collection-resolution logic and evaluator.ts's mutually-recursive `evaluatePredicateInternal`/`evaluateValueInternal` pair never import each other, so there is no circular-import hazard between the two files. */
10
- type EvaluatePredicate = (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>, accumulator: ComputedValue | undefined, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number) => Promise<Evaluation<boolean>>;
10
+ export type EvaluatePredicate = (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>, accumulator: ComputedValue | undefined, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number) => Promise<Evaluation<boolean>>;
11
11
  /** A collection candidate paired with its own pre-filter outcome: `"include"`/`"exclude"` when `filter` resolved definitely, or the filter's own indeterminate `Evaluation` when it did not (there is no third, definite-but-neither branch -- see `resolveParticipatingItems` below). */
12
- interface ResolvedCollectionItem {
12
+ export interface ResolvedCollectionItem {
13
13
  readonly item: unknown;
14
14
  readonly filterOutcome: "include" | "exclude" | Evaluation<never>;
15
15
  }
16
16
  /**
17
17
  * Collection resolution shared by the quantifiers (`some`/`every`) and by `fold` in evaluator.ts: resolves the opaque `collection` reference to its concrete candidate list via `resolvers.resolveCollection`, then evaluates each candidate's optional `filter` (via the injected `evaluatePredicate`, see `EvaluatePredicate`'s own doc comment) with that candidate as its own evaluation context and the accumulator reset to `undefined` -- see the README's "Evaluation context" and "Pre-filtering which items participate" sections. Deliberately stops short of deciding how an indeterminate filter combines with the rest of the surrounding node: `some`/`every` fold a filter-indeterminate item in as its own vote via the surrounding OR/AND absorption, while `fold` has no absorbing value at all and goes indeterminate outright on the same condition -- the two callers need genuinely different combination logic over these same per-item outcomes, so this helper only produces the outcomes and leaves combining them to the caller.
18
18
  */
19
- declare function resolveParticipatingItems(evaluatePredicate: EvaluatePredicate, collection: JsonValue, filter: PredicateNode | undefined, context: EvaluationContext, resolvers: Readonly<Resolvers>, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number): Promise<ResolvedCollectionItem[]>;
19
+ export declare function resolveParticipatingItems(evaluatePredicate: EvaluatePredicate, collection: JsonValue, filter: PredicateNode | undefined, context: EvaluationContext, resolvers: Readonly<Resolvers>, functions: Readonly<FunctionRegistry>, visitedTreeKeys: ReadonlySet<string>, treeReferenceDepth: number, budget: Readonly<EvaluationBudget>, nestingDepth: number): Promise<ResolvedCollectionItem[]>;
20
20
  /** The first participating item (in declared collection order) whose `filter` evaluation was itself indeterminate, or `undefined` if every participating item's filter resolved definitely -- a filter-excluded item's own `"exclude"` outcome never counts here. Used only by `fold`, which -- unlike `some`/`every`'s OR/AND absorption -- has no absorbing value at all: any participating item's indeterminate filter makes the whole fold indeterminate outright, with no other item's outcome able to override it. */
21
- declare function firstFilterIndeterminate(participating: readonly ResolvedCollectionItem[]): IndeterminateReason | undefined;
22
- //#endregion
23
- export { EvaluatePredicate, ResolvedCollectionItem, firstFilterIndeterminate, resolveParticipatingItems };
21
+ export declare function firstFilterIndeterminate(participating: readonly ResolvedCollectionItem[]): IndeterminateReason | undefined;
22
+ //#endregion
@@ -7,7 +7,7 @@ import { EvaluationContext, Resolvers } from "./resolvers.cjs";
7
7
  /**
8
8
  * Builds a bound `{ evaluatePredicate, evaluateValue }` pair over a caller-supplied function registry for `call` nodes -- the registry is bound once, at construction time, unlike `resolvers`, which are supplied fresh to every call. `maxNodes` and `maxNestingDepth` configure that same pair's own `EvaluationBudget` (see its doc comment in evaluator-budget.ts), created fresh for every top-level `evaluatePredicate`/`evaluateValue` invocation so budgets never leak between unrelated calls. The bare module-level `evaluatePredicate`/`evaluateValue` exports below are `createEvaluator({})`'s output, so both caps default to `DEFAULT_MAX_EVALUATION_NODES`/`DEFAULT_MAX_NESTING_DEPTH` for every caller that does not explicitly configure them.
9
9
  */
10
- declare function createEvaluator({ functions, maxNodes, maxNestingDepth }: {
10
+ export declare function createEvaluator({ functions, maxNodes, maxNestingDepth }: {
11
11
  functions?: FunctionRegistry;
12
12
  /** Caps the total number of predicate/expression nodes a single `evaluatePredicate`/`evaluateValue` call may visit -- see `createEvaluationBudget`. Defaults to `DEFAULT_MAX_EVALUATION_NODES`. */
13
13
  maxNodes?: number;
@@ -17,6 +17,5 @@ declare function createEvaluator({ functions, maxNodes, maxNestingDepth }: {
17
17
  evaluatePredicate: (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<boolean>>;
18
18
  evaluateValue: (node: ExpressionNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<ComputedValue>>;
19
19
  };
20
- declare const evaluatePredicate: (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<boolean>>, evaluateValue: (node: ExpressionNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<ComputedValue>>;
21
- //#endregion
22
- export { createEvaluator, evaluatePredicate, evaluateValue };
20
+ export declare const evaluatePredicate: (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<boolean>>, evaluateValue: (node: ExpressionNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<ComputedValue>>;
21
+ //#endregion
@@ -7,7 +7,7 @@ import { EvaluationContext, Resolvers } from "./resolvers.js";
7
7
  /**
8
8
  * Builds a bound `{ evaluatePredicate, evaluateValue }` pair over a caller-supplied function registry for `call` nodes -- the registry is bound once, at construction time, unlike `resolvers`, which are supplied fresh to every call. `maxNodes` and `maxNestingDepth` configure that same pair's own `EvaluationBudget` (see its doc comment in evaluator-budget.ts), created fresh for every top-level `evaluatePredicate`/`evaluateValue` invocation so budgets never leak between unrelated calls. The bare module-level `evaluatePredicate`/`evaluateValue` exports below are `createEvaluator({})`'s output, so both caps default to `DEFAULT_MAX_EVALUATION_NODES`/`DEFAULT_MAX_NESTING_DEPTH` for every caller that does not explicitly configure them.
9
9
  */
10
- declare function createEvaluator({ functions, maxNodes, maxNestingDepth }: {
10
+ export declare function createEvaluator({ functions, maxNodes, maxNestingDepth }: {
11
11
  functions?: FunctionRegistry;
12
12
  /** Caps the total number of predicate/expression nodes a single `evaluatePredicate`/`evaluateValue` call may visit -- see `createEvaluationBudget`. Defaults to `DEFAULT_MAX_EVALUATION_NODES`. */
13
13
  maxNodes?: number;
@@ -17,6 +17,5 @@ declare function createEvaluator({ functions, maxNodes, maxNestingDepth }: {
17
17
  evaluatePredicate: (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<boolean>>;
18
18
  evaluateValue: (node: ExpressionNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<ComputedValue>>;
19
19
  };
20
- declare const evaluatePredicate: (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<boolean>>, evaluateValue: (node: ExpressionNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<ComputedValue>>;
21
- //#endregion
22
- export { createEvaluator, evaluatePredicate, evaluateValue };
20
+ export declare const evaluatePredicate: (node: PredicateNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<boolean>>, evaluateValue: (node: ExpressionNode, context: EvaluationContext, resolvers: Readonly<Resolvers>) => Promise<Evaluation<ComputedValue>>;
21
+ //#endregion
@@ -6,33 +6,33 @@ import { EvaluationContext, Resolvers } from "./resolvers.cjs";
6
6
  /**
7
7
  * Shared fixture machinery for the two split indeterminacy test files (evaluator.indeterminacy-table.test.ts, evaluator.indeterminacy-cases.test.ts): systematic, table-driven coverage of README.md's "Indeterminacy reference" section, one fixture per node-kind x reason-code combination that section documents, for every `PredicateNode`/`ExpressionNode` kind implemented. This complements, rather than replaces, the ad hoc behavioural tests already spread across the evaluator.*.test.ts files and truth-tables.test.ts.
8
8
  */
9
- declare function isPlainRecord(value: unknown): value is Record<string, unknown>;
10
- declare function isUnknownArray(value: unknown): value is unknown[];
9
+ export declare function isPlainRecord(value: unknown): value is Record<string, unknown>;
10
+ export declare function isUnknownArray(value: unknown): value is unknown[];
11
11
  /** A single resolver pool shared by every fixture below, covering every named key/table/collection any fixture needs. Fixtures that need genuinely different resolver behaviour (the delegate/call rows) supply their own. */
12
- declare const baseResolvers: Resolvers;
13
- declare const numberLiteral: (value: number) => ExpressionNode;
14
- declare const missingRef: ExpressionNode;
15
- declare const divideByZero: ExpressionNode;
16
- declare const wrongTypeArithmetic: ExpressionNode;
17
- declare const trueGuard: PredicateNode;
18
- declare const falseGuard: PredicateNode;
19
- declare const missingGuard: PredicateNode;
12
+ export declare const baseResolvers: Resolvers;
13
+ export declare const numberLiteral: (value: number) => ExpressionNode;
14
+ export declare const missingRef: ExpressionNode;
15
+ export declare const divideByZero: ExpressionNode;
16
+ export declare const wrongTypeArithmetic: ExpressionNode;
17
+ export declare const trueGuard: PredicateNode;
18
+ export declare const falseGuard: PredicateNode;
19
+ export declare const missingGuard: PredicateNode;
20
20
  /** Arbitrary non-`{-1,0,1,2}` magnitudes used below, named individually so each numeric literal only appears once (`@typescript-eslint/no-magic-numbers` only exempts -1/0/1/2 and object-literal property values, not values passed as plain call arguments). */
21
- declare const memberOfProbeValue = 5;
22
- declare const reduceInitialSeed = 5;
23
- declare const laterConditionalCaseValue = 3;
24
- declare const untouchedReduceInitial = 42;
25
- declare const uniqueHitPolicyThirdCaseValue = 3;
26
- type Expected = {
21
+ export declare const memberOfProbeValue = 5;
22
+ export declare const reduceInitialSeed = 5;
23
+ export declare const laterConditionalCaseValue = 3;
24
+ export declare const untouchedReduceInitial = 42;
25
+ export declare const uniqueHitPolicyThirdCaseValue = 3;
26
+ export type Expected = {
27
27
  readonly status: "definite";
28
28
  } | {
29
29
  readonly status: "indeterminate";
30
30
  readonly code: IndeterminateReason["code"];
31
31
  };
32
- declare const isDefinite: Expected;
33
- declare const isNotFound: Expected;
34
- declare const isWrongType: Expected;
35
- declare const isDomainError: Expected;
32
+ export declare const isDefinite: Expected;
33
+ export declare const isNotFound: Expected;
34
+ export declare const isWrongType: Expected;
35
+ export declare const isDomainError: Expected;
36
36
  /** The minimal shape `runFixture` needs from either `evaluatePredicate`'s or `evaluateValue`'s result -- both `Evaluation<boolean>` and `Evaluation<ComputedValue>` are structurally assignable here since only the indeterminate branch's `reason` is ever inspected, never the definite branch's `value`. Typing `Fixture.run`'s result as this proper discriminated union, rather than the looser `{ status: string }` it replaces, is what lets `runFixture` below narrow `result.reason` directly instead of needing a type assertion. */
37
37
  type FixtureRunResult = {
38
38
  readonly status: "definite";
@@ -40,18 +40,17 @@ type FixtureRunResult = {
40
40
  readonly status: "indeterminate";
41
41
  readonly reason: IndeterminateReason;
42
42
  };
43
- interface Fixture {
43
+ export interface Fixture {
44
44
  readonly description: string;
45
45
  readonly expected: Expected;
46
46
  readonly run: () => Promise<FixtureRunResult>;
47
47
  }
48
- interface FixtureOverrides {
48
+ export interface FixtureOverrides {
49
49
  readonly context?: EvaluationContext;
50
50
  readonly resolvers?: Resolvers;
51
51
  readonly functions?: FunctionRegistry;
52
52
  }
53
- declare function pred(description: string, node: PredicateNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
54
- declare function expr(description: string, node: ExpressionNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
55
- declare function runFixture({ run, expected }: Fixture): Promise<void>;
56
- //#endregion
57
- export { Expected, Fixture, FixtureOverrides, baseResolvers, divideByZero, expr, falseGuard, isDefinite, isDomainError, isNotFound, isPlainRecord, isUnknownArray, isWrongType, laterConditionalCaseValue, memberOfProbeValue, missingGuard, missingRef, numberLiteral, pred, reduceInitialSeed, runFixture, trueGuard, uniqueHitPolicyThirdCaseValue, untouchedReduceInitial, wrongTypeArithmetic };
53
+ export declare function pred(description: string, node: PredicateNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
54
+ export declare function expr(description: string, node: ExpressionNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
55
+ export declare function runFixture({ run, expected }: Fixture): Promise<void>;
56
+ //#endregion
@@ -6,33 +6,33 @@ import { EvaluationContext, Resolvers } from "./resolvers.js";
6
6
  /**
7
7
  * Shared fixture machinery for the two split indeterminacy test files (evaluator.indeterminacy-table.test.ts, evaluator.indeterminacy-cases.test.ts): systematic, table-driven coverage of README.md's "Indeterminacy reference" section, one fixture per node-kind x reason-code combination that section documents, for every `PredicateNode`/`ExpressionNode` kind implemented. This complements, rather than replaces, the ad hoc behavioural tests already spread across the evaluator.*.test.ts files and truth-tables.test.ts.
8
8
  */
9
- declare function isPlainRecord(value: unknown): value is Record<string, unknown>;
10
- declare function isUnknownArray(value: unknown): value is unknown[];
9
+ export declare function isPlainRecord(value: unknown): value is Record<string, unknown>;
10
+ export declare function isUnknownArray(value: unknown): value is unknown[];
11
11
  /** A single resolver pool shared by every fixture below, covering every named key/table/collection any fixture needs. Fixtures that need genuinely different resolver behaviour (the delegate/call rows) supply their own. */
12
- declare const baseResolvers: Resolvers;
13
- declare const numberLiteral: (value: number) => ExpressionNode;
14
- declare const missingRef: ExpressionNode;
15
- declare const divideByZero: ExpressionNode;
16
- declare const wrongTypeArithmetic: ExpressionNode;
17
- declare const trueGuard: PredicateNode;
18
- declare const falseGuard: PredicateNode;
19
- declare const missingGuard: PredicateNode;
12
+ export declare const baseResolvers: Resolvers;
13
+ export declare const numberLiteral: (value: number) => ExpressionNode;
14
+ export declare const missingRef: ExpressionNode;
15
+ export declare const divideByZero: ExpressionNode;
16
+ export declare const wrongTypeArithmetic: ExpressionNode;
17
+ export declare const trueGuard: PredicateNode;
18
+ export declare const falseGuard: PredicateNode;
19
+ export declare const missingGuard: PredicateNode;
20
20
  /** Arbitrary non-`{-1,0,1,2}` magnitudes used below, named individually so each numeric literal only appears once (`@typescript-eslint/no-magic-numbers` only exempts -1/0/1/2 and object-literal property values, not values passed as plain call arguments). */
21
- declare const memberOfProbeValue = 5;
22
- declare const reduceInitialSeed = 5;
23
- declare const laterConditionalCaseValue = 3;
24
- declare const untouchedReduceInitial = 42;
25
- declare const uniqueHitPolicyThirdCaseValue = 3;
26
- type Expected = {
21
+ export declare const memberOfProbeValue = 5;
22
+ export declare const reduceInitialSeed = 5;
23
+ export declare const laterConditionalCaseValue = 3;
24
+ export declare const untouchedReduceInitial = 42;
25
+ export declare const uniqueHitPolicyThirdCaseValue = 3;
26
+ export type Expected = {
27
27
  readonly status: "definite";
28
28
  } | {
29
29
  readonly status: "indeterminate";
30
30
  readonly code: IndeterminateReason["code"];
31
31
  };
32
- declare const isDefinite: Expected;
33
- declare const isNotFound: Expected;
34
- declare const isWrongType: Expected;
35
- declare const isDomainError: Expected;
32
+ export declare const isDefinite: Expected;
33
+ export declare const isNotFound: Expected;
34
+ export declare const isWrongType: Expected;
35
+ export declare const isDomainError: Expected;
36
36
  /** The minimal shape `runFixture` needs from either `evaluatePredicate`'s or `evaluateValue`'s result -- both `Evaluation<boolean>` and `Evaluation<ComputedValue>` are structurally assignable here since only the indeterminate branch's `reason` is ever inspected, never the definite branch's `value`. Typing `Fixture.run`'s result as this proper discriminated union, rather than the looser `{ status: string }` it replaces, is what lets `runFixture` below narrow `result.reason` directly instead of needing a type assertion. */
37
37
  type FixtureRunResult = {
38
38
  readonly status: "definite";
@@ -40,18 +40,17 @@ type FixtureRunResult = {
40
40
  readonly status: "indeterminate";
41
41
  readonly reason: IndeterminateReason;
42
42
  };
43
- interface Fixture {
43
+ export interface Fixture {
44
44
  readonly description: string;
45
45
  readonly expected: Expected;
46
46
  readonly run: () => Promise<FixtureRunResult>;
47
47
  }
48
- interface FixtureOverrides {
48
+ export interface FixtureOverrides {
49
49
  readonly context?: EvaluationContext;
50
50
  readonly resolvers?: Resolvers;
51
51
  readonly functions?: FunctionRegistry;
52
52
  }
53
- declare function pred(description: string, node: PredicateNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
54
- declare function expr(description: string, node: ExpressionNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
55
- declare function runFixture({ run, expected }: Fixture): Promise<void>;
56
- //#endregion
57
- export { Expected, Fixture, FixtureOverrides, baseResolvers, divideByZero, expr, falseGuard, isDefinite, isDomainError, isNotFound, isPlainRecord, isUnknownArray, isWrongType, laterConditionalCaseValue, memberOfProbeValue, missingGuard, missingRef, numberLiteral, pred, reduceInitialSeed, runFixture, trueGuard, uniqueHitPolicyThirdCaseValue, untouchedReduceInitial, wrongTypeArithmetic };
53
+ export declare function pred(description: string, node: PredicateNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
54
+ export declare function expr(description: string, node: ExpressionNode, expected: Expected, overrides?: FixtureOverrides): Fixture;
55
+ export declare function runFixture({ run, expected }: Fixture): Promise<void>;
56
+ //#endregion