/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * A query's steps as the step functions take them (#933): the decoded values * of `Query.Types`, their ids, and when a step is finished. * * @packageDocumentation */ import { type ValueTypeOf } from "@elaraai/east"; import type { QueryAggregateType, QueryComparisonType, QueryConditionType, QueryMatchType, QueryPickFieldType, QueryStepInputType, QueryStepType, QueryStepValueType, QueryStepsType } from "@elaraai/e3-ui/internal"; /** A query as steps: its data source and its steps. */ export type StepQuery = ValueTypeOf; /** One step of a query. */ export type Step = ValueTypeOf; /** A step's kind: `filter`, `lookup`, … */ export type StepKind = Step["type"]; /** One step of a kind. */ export type StepOf = Extract; /** A condition of a Keep rows where step. */ export type Condition = ValueTypeOf; /** A test of one field. */ export type TestCondition = Extract; /** A group of conditions. */ export type GroupCondition = Extract; /** How a condition compares a field. */ export type Comparison = ValueTypeOf; /** A comparison's kind: `eq`, `inYear`, … */ export type ComparisonKind = Comparison["type"]; /** How conditions combine. */ export type Match = ValueTypeOf; /** One total of a Group and total step. */ export type Aggregate = ValueTypeOf; /** One field a Show only fields step shows. */ export type PickField = ValueTypeOf; /** A value a step compares with or fills in. */ export type StepValue = ValueTypeOf; /** A count or a bound a step takes. */ export type StepInput = ValueTypeOf; /** What an id names: a step, a condition, a total or a field shown. */ export type IdKind = "step" | "condition" | "aggregate" | "pick"; /** * A fresh id, unique for the life of the page: each call gives a new one, so * an id is never reused, even by a query parsed again. * * @param kind - what it names * @returns the id */ export declare function freshId(kind: IdKind): string; /** * A comparison of a kind. * * @param kind - the comparison * @returns its value */ export declare function comparison(kind: ComparisonKind): Comparison; /** * Whether a value is filled in: any value but empty text. * * @param value - the value * @returns whether it counts as given */ export declare function isGiven(value: StepValue): boolean; /** * Whether a comparison takes a value: every one but missing, present, yes, * no, and any where, which takes an inner condition instead. * * @param kind - the comparison * @returns whether it needs a value */ export declare function needsValue(kind: ComparisonKind): boolean; /** * Whether a condition is finished: a test with its field, its comparison and * the value or inner condition it needs; a group with a finished condition. * * @param condition - the condition * @returns whether it is printed */ export declare function isConditionComplete(condition: Condition): boolean; /** * Whether a step is finished: every slot it needs is filled. An unfinished * step is left out of the program until it is. * * @param step - the step * @returns whether it is printed */ export declare function isComplete(step: Step): boolean; //# sourceMappingURL=values.d.ts.map