/** Any sort of node which appears as syntax */ type SyntaxNode = ExprNode | ArrayElementNode | ObjectAttributeNode | SelectAlternativeNode; type ObjectAttributeNode = ObjectAttributeValueNode | ObjectConditionalSplatNode | ObjectSplatNode; /** * A node which can be evaluated into a value. * @public */ type ExprNode = AccessAttributeNode | AccessElementNode | AndNode | ArrayNode | ArrayCoerceNode | AscNode | ContextNode | DerefNode | DescNode | EverythingNode | FilterNode | FlatMapNode | FuncCallNode | GroupNode | InRangeNode | MapNode | NegNode | NotNode | ObjectNode | OpCallNode | OrNode | ParameterNode | ParentNode | PipeFuncCallNode | PosNode | ProjectionNode | SelectNode | SelectorNode | SliceNode | ThisNode | TupleNode | ValueNode; type OpCall = '==' | '!=' | '>' | '>=' | '<' | '<=' | '+' | '-' | '*' | '/' | '%' | '**' | 'in' | 'match'; /** The base interface for SyntaxNode. */ interface BaseNode { type: string; } interface AndNode extends BaseNode { type: 'And'; left: ExprNode; right: ExprNode; } interface ArrayElementNode extends BaseNode { type: 'ArrayElement'; value: ExprNode; isSplat: boolean; } interface ArrayNode extends BaseNode { type: 'Array'; elements: ArrayElementNode[]; } interface ArrayCoerceNode extends BaseNode { type: 'ArrayCoerce'; base: Base; } interface AscNode extends BaseNode { type: 'Asc'; base: ExprNode; } interface ContextNode extends BaseNode { type: 'Context'; key: string; } interface DerefNode extends BaseNode { type: 'Deref'; base: ExprNode; } interface DescNode extends BaseNode { type: 'Desc'; base: ExprNode; } interface EverythingNode extends BaseNode { type: 'Everything'; } interface FuncCallNode extends BaseNode { type: 'FuncCall'; namespace: string; name: string; args: ExprNode[]; } interface GroupNode extends BaseNode { type: 'Group'; base: Base; } interface InRangeNode extends BaseNode { type: 'InRange'; base: ExprNode; left: ExprNode; right: ExprNode; isInclusive: boolean; } interface NegNode extends BaseNode { type: 'Neg'; base: ExprNode; } interface NotNode extends BaseNode { type: 'Not'; base: ExprNode; } interface ObjectAttributeValueNode extends BaseNode { type: 'ObjectAttributeValue'; name: string; value: ExprNode; } interface ObjectConditionalSplatNode extends BaseNode { type: 'ObjectConditionalSplat'; condition: ExprNode; value: ExprNode; } interface ObjectNode extends BaseNode { type: 'Object'; attributes: ObjectAttributeNode[]; } interface ObjectSplatNode extends BaseNode { type: 'ObjectSplat'; value: ExprNode; } interface OpCallNode extends BaseNode { type: 'OpCall'; op: OpCall; left: ExprNode; right: ExprNode; } interface OrNode extends BaseNode { type: 'Or'; left: ExprNode; right: ExprNode; } interface ParameterNode extends BaseNode { type: 'Parameter'; name: string; } interface ParentNode extends BaseNode { type: 'Parent'; n: number; } interface PipeFuncCallNode extends BaseNode { type: 'PipeFuncCall'; base: ExprNode; name: string; args: ExprNode[]; } interface PosNode extends BaseNode { type: 'Pos'; base: ExprNode; } interface SelectAlternativeNode extends BaseNode { type: 'SelectAlternative'; condition: ExprNode; value: ExprNode; } interface SelectNode extends BaseNode { type: 'Select'; alternatives: SelectAlternativeNode[]; fallback?: ExprNode; } type SelectorNode = AccessAttributeNode | SelectorFuncCallNode | GroupNode | TupleNode | ArrayCoerceNode | FilterNode | SelectorNestedNode; declare function isSelectorNode(node: BaseNode): node is SelectorNode; interface SelectorFuncCallNode extends BaseNode { type: 'SelectorFuncCall'; name: 'anywhere'; arg: ExprNode; } type SelectorNested = AccessAttributeNode | ArrayCoerceNode | FilterNode | GroupNode | TupleNode; declare function isSelectorNested(node: BaseNode): node is SelectorNested; interface SelectorNestedNode extends BaseNode { type: 'SelectorNested'; base: SelectorNode; nested: SelectorNested; } interface ThisNode extends BaseNode { type: 'This'; } interface TupleNode extends BaseNode { type: 'Tuple'; members: Array; } interface ValueNode

{ type: 'Value'; value: P; } interface FunctionDeclarationNode { type: 'FuncDeclaration'; namespace: string; name: string; params: ParameterNode[]; body: ExprNode; } interface FlatMapNode extends BaseNode { type: 'FlatMap'; base: ExprNode; expr: ExprNode; } interface MapNode extends BaseNode { type: 'Map'; base: ExprNode; expr: ExprNode; } interface AccessAttributeNode extends BaseNode { type: 'AccessAttribute'; base?: T; name: string; } interface AccessElementNode extends BaseNode { type: 'AccessElement'; base: ExprNode; index: number; } interface SliceNode extends BaseNode { type: 'Slice'; base: ExprNode; left: number; right: number; isInclusive: boolean; } interface FilterNode extends BaseNode { type: 'Filter'; base: Base; expr: ExprNode; } interface ProjectionNode extends BaseNode { type: 'Projection'; base: ExprNode; expr: ExprNode; } declare class Path { private pattern; private patternRe; constructor(pattern: string); matches(str: string): boolean; toJSON(): string; } declare class StaticValue { data: P; type: T; constructor(data: P, type: T); isArray(): boolean; get(): Promise; asStatic(): this; [Symbol.asyncIterator](): Generator; } declare class DateTime { date: Date; constructor(date: Date); static parseToValue(str: string): DateTimeValue | NullValue; equals(other: DateTime): boolean; add(secs: number): DateTime; difference(other: DateTime): number; compareTo(other: DateTime): number; toString(): string; toJSON(): string; } /** * Returns a normalized JavaScript value. This eliminates internal values * such as DateTime and Path by turning them into the JSON representation. */ declare function toJS(val: AnyStaticValue): unknown; /** * A type of a value in GROQ. */ type GroqType = 'null' | 'boolean' | 'number' | 'string' | 'array' | 'object' | 'path' | 'datetime'; /** * The result of an expression. */ type Value = AnyStaticValue | StreamValue; type StringValue = StaticValue; type NumberValue = StaticValue; type NullValue = StaticValue; type BooleanValue = StaticValue; type DateTimeValue = StaticValue; type PathValue = StaticValue; type ObjectValue = StaticValue, 'object'>; type ArrayValue = StaticValue; type AnyStaticValue = StringValue | NumberValue | NullValue | BooleanValue | DateTimeValue | ObjectValue | ArrayValue | PathValue; declare class StreamValue { type: 'stream'; private generator; private ticker; private isDone; private data; constructor(generator: () => AsyncGenerator); isArray(): boolean; get(): Promise; asStatic(): Promise; [Symbol.asyncIterator](): AsyncGenerator; _nextTick(): Promise; } export { SelectNode as $, FilterNode as A, ObjectAttributeValueNode as B, AscNode as C, DescNode as D, DerefNode as E, InRangeNode as F, OpCallNode as G, ObjectNode as H, MapNode as I, ParentNode as J, OrNode as K, NegNode as L, FuncCallNode as M, FunctionDeclarationNode as N, EverythingNode as O, GroupNode as P, SelectAlternativeNode as Q, NotNode as R, ArrayNode as S, ContextNode as T, ObjectSplatNode as U, ObjectConditionalSplatNode as V, OpCall as W, PosNode as X, PipeFuncCallNode as Y, ProjectionNode as Z, AccessAttributeNode as _, DateTimeValue as a, SyntaxNode as at, ArrayCoerceNode as b, NumberValue as c, ValueNode as ct, StringValue as d, SelectorFuncCallNode as et, Value as f, Path as g, toJS as h, BooleanValue as i, SliceNode as it, FlatMapNode as j, ExprNode as k, ObjectValue as l, isSelectorNested as lt, StaticValue as m, AnyStaticValue as n, SelectorNestedNode as nt, GroqType as o, ThisNode as ot, DateTime as p, ParameterNode as q, ArrayValue as r, SelectorNode as rt, NullValue as s, TupleNode as st, StreamValue as t, SelectorNested as tt, PathValue as u, isSelectorNode as ut, AccessElementNode as v, BaseNode as w, ArrayElementNode as x, AndNode as y, ObjectAttributeNode as z }; //# sourceMappingURL=shared-B-KhUIgP.d.ts.map