import type { EventSchema, RunnerOptions, RunnerResult } from "./types"; /** * Runs the segment IDs in `input` through `schema`: validates their order * and groups them. * * Returns `matched` with the segments grouped as the schema defines them; * `mismatched` with the `index` of the first segment the schema does not * allow at its position; or `incomplete` when every segment fits but the * schema requires more. `expected` lists the segment IDs valid at that * point, sorted. * * Where the schema admits more than one grouping, the runner prefers, in * order: entering an optional element over skipping it, repeating an element * over leaving it, and the earlier alternative of a choice. A group occurrence * that holds no segment is left out of the groups. A segment named `Hxx` in the * schema matches any segment ID, and one named `anyZSegment` any segment ID * that starts with `Z`. * * A Z-segment (a segment ID that starts with `Z`) that the schema does not * name fits at any position unless `options.allowZSegments` is `false`. It is * grouped right after the segment before it, in that segment's group, and * never makes a group occurrence that holds no other segment. A reading that * reaches an `Hxx` takes the Z-segment there rather than pass over it. * * Compiles `schema` on its first use by `runner()` or `repair()` and reuses * the program for later runs of the same object. `schema` MUST NOT change * after its first use. Runs in time proportional to the input length times * the schema size. * * @throws {Error} When `schema` has no elements, a segment has no name, a * group has no ID, no name, or no elements, a choice has no alternatives, * or a choice alternative can match no segment. */ export declare function runner(schema: EventSchema, input: readonly string[], options?: RunnerOptions): RunnerResult; //# sourceMappingURL=runner.d.ts.map