import { Parser, ParserResult } from "tarsec";
import { SourceLocation } from "../types/base.js";
import { AgencyNode, Assignment, BooleanLiteral, Expression, FunctionCall, FunctionDefinition, FunctionParameter, InterpolationSegment, Literal, MultiLineStringLiteral, NewLine, NullLiteral, NumberLiteral, UnitLiteral, RegexLiteral, StringLiteral, TextSegment, VariableNameLiteral, VariableType, AgencyComment, AgencyMultiLineComment, ArrayType, BlockType, BooleanLiteralType, NumberLiteralType, ObjectProperty, ObjectType, GenericType, PrimitiveType, ResultType, StringLiteralType, TypeAlias, TypeAliasVariable, TypeParam, UnionType, ValueParam } from "../types.js";
import { GraphNodeDefinition } from "../types/graphNode.js";
import { ForLoop } from "../types/forLoop.js";
import { WhileLoop } from "../types/whileLoop.js";
import { ParallelBlock, SeqBlock } from "../types/parallelBlock.js";
import { IfElse } from "../types/ifElse.js";
import { ValueAccess } from "../types/access.js";
import { BlockArgument } from "../types/blockArgument.js";
import { BinOpExpression } from "../types/binop.js";
import { NewExpression } from "../types/newExpression.js";
import { SchemaExpression } from "../types/schemaExpression.js";
import { InterruptStatement } from "../types/interruptStatement.js";
import { ReturnStatement } from "../types/returnStatement.js";
import { GotoStatement } from "../types/gotoStatement.js";
import { DebuggerStatement } from "../types/debuggerStatement.js";
import { Keyword } from "../types/keyword.js";
import { Skill } from "../types/skill.js";
import { AgencyArray, AgencyObject, AgencyObjectKV, SplatExpression } from "../types/dataStructures.js";
import { ImportNodeStatement, ImportStatement } from "../types/importStatement.js";
import { ExportFromStatement } from "../types/exportFromStatement.js";
import { DefaultCase, MatchBlockCase } from "../types/matchBlock.js";
import { MessageThread } from "../types/messageThread.js";
import { HandleBlock } from "../types/handleBlock.js";
import { WithModifier } from "../types/withModifier.js";
import { StaticStatement } from "../types/staticStatement.js";
import { ArrayPattern, BindingPattern, MatchPattern, ObjectPattern, RestPattern, ResultPattern, WildcardPattern } from "../types/pattern.js";
export declare const optionalSpacesOrNewline: Parser<string[]>;
export declare const optionalSpaces: Parser<string[]>;
export declare const backtick: Parser<"`">;
export declare const comma: Parser<(string[] | ",")[]>;
export declare const plusSign: Parser<("+" | string[])[]>;
export declare const commaWithNewline: Parser<(string[] | ",")[]>;
export declare const varNameChar: Parser<string>;
export declare const AGENCY_TEMPLATE_OFFSET = 2;
export declare function setTemplateOffset(n: number): void;
/**
 * Wraps a parser to add a `loc` field from tarsec's withSpan.
 * Converts Span { start: Position, end: Position } to SourceLocation { line, col, start, end }.
 */
export declare function withLoc<T>(parser: Parser<T>): Parser<T & {
    loc: SourceLocation;
}>;
export declare const optionalSemicolon: Parser<";" | null>;
export declare function removeQuotes(s: string): string;
export declare const oneOfStr: <T extends string>(strs: readonly T[]) => Parser<T>;
export declare const newLineParser: Parser<NewLine>;
export declare const BLANK_LINE_SENTINEL = "\uE000";
export declare const stripSentinels: (s: string) => string;
export declare const blankLineParser: Parser<NewLine>;
export declare const commentParser: Parser<AgencyComment>;
export declare const multiLineCommentParser: Parser<AgencyMultiLineComment>;
export declare const stringTextSegmentParser: Parser<TextSegment>;
export declare const multiLineStringTextSegmentParser: Parser<TextSegment>;
export declare const interpolationSegmentParser: Parser<InterpolationSegment>;
export declare const numberParser: Parser<NumberLiteral>;
export declare const unitLiteralParser: Parser<UnitLiteral>;
export declare const regexLiteralParser: Parser<RegexLiteral>;
export declare const simpleStringParser: Parser<StringLiteral>;
export declare const staticInterpolatedStringParser: Parser<StringLiteral>;
export declare const staticMultiLineStringParser: Parser<MultiLineStringLiteral>;
export declare const _stringParser: Parser<StringLiteral>;
export declare const stringParser: Parser<StringLiteral>;
export declare const multiLineStringParser: Parser<MultiLineStringLiteral>;
export declare const variableNameParser: Parser<VariableNameLiteral>;
export declare const booleanParser: Parser<BooleanLiteral>;
export declare const nullParser: Parser<NullLiteral>;
export declare const literalParser: Parser<Literal>;
export declare const literalParserNoVarName: Parser<Literal>;
export declare function simpleLiteralParser(input: string): ParserResult<Literal>;
export declare const primitiveTypeParser: Parser<PrimitiveType>;
export declare const typeAliasVariableParser: Parser<TypeAliasVariable>;
/**
 * `(T)` — a parenthesized type expression. Lets users write things like
 * `(name | serving_size)[]` or `(string | number)[]` where the union
 * needs to be grouped before the array suffix can apply.
 */
export declare const parenthesizedTypeParser: Parser<VariableType>;
export declare const arrayTypeParser: Parser<ArrayType>;
export declare const angleBracketsArrayTypeParser: Parser<ArrayType>;
export declare const stringLiteralTypeParser: Parser<StringLiteralType>;
export declare const numberLiteralTypeParser: Parser<NumberLiteralType>;
export declare const booleanLiteralTypeParser: Parser<BooleanLiteralType>;
export declare const objectPropertyDelimiter: Parser<(string | string[])[]>;
export declare const objectPropertyParser: Parser<ObjectProperty>;
export declare const objectPropertyDescriptionParser: Parser<{
    description: string;
}>;
export declare const objectPropertyWithDescriptionParser: Parser<ObjectProperty>;
/**
 * Parses one or more `@tag(...)` lines, then a property, attaching the
 * tags to that property's `tags` field. Used inside `objectTypeParser`
 * so users can write:
 *
 *     type User = {
 *       @validate(isEmail)
 *       @jsonSchema({ format: "email" })
 *       email: string
 *     }
 */
export declare const taggedObjectPropertyParser: Parser<ObjectProperty>;
export declare const objectTypeParser: Parser<ObjectType>;
export declare const unionItemParser: Parser<VariableType>;
export declare const _unionTypeParser: Parser<UnionType>;
export declare const unionTypeParser: Parser<UnionType>;
export declare const blockTypeParser: Parser<BlockType>;
export declare const resultTypeParser: Parser<ResultType>;
/**
 * Generic type usage: `Name<TypeArg1, TypeArg2, ...>`. Produces a
 * `genericType` AST node. The parser is policy-free — it does not
 * special-case any name. The type checker's `resolveType` normalizes
 * built-ins (`Array`, `Schema`, `Record`) and resolves user-defined
 * generic aliases by substituting type parameters into the alias body.
 *
 * Ordering: must come AFTER `resultTypeParser` (which keeps its own AST
 * node for `Result<T, E>`) and BEFORE `typeAliasVariableParser` (which
 * greedily matches any identifier).
 */
export declare const genericTypeParser: Parser<GenericType>;
export declare const variableTypeParser: Parser<VariableType>;
/**
 * Type parameter on a generic alias declaration. Examples:
 *   T            → { name: "T" }
 *   V = any      → { name: "V", default: { type: "primitiveType", value: "any" } }
 */
export declare const typeParamParser: Parser<TypeParam>;
/**
 * Value parameter on a value-parameterized alias declaration. Examples:
 *   min: number              → { name: "min", type: { type: "primitiveType", value: "number" } }
 *   min: number = 0          → { ..., default: { type: "number", value: "0" } }
 *
 * The default expression is restricted to the same statically-known
 * subset as tag arguments (see `staticTagArgParser`).
 */
export declare const valueParamParser: Parser<ValueParam>;
export declare const typeAliasParser: Parser<TypeAlias>;
export declare const keywordParser: Parser<Keyword>;
export declare const debuggerParser: Parser<DebuggerStatement>;
export declare function _skillParser(input: string): ParserResult<Skill>;
export declare function _skillParserWithDescription(input: string): ParserResult<Skill>;
export declare const skillParser: (input: string) => ParserResult<Skill>;
export declare const staticTagArgParser: Parser<Expression>;
export declare const tagParser: Parser<{
    name: string;
    type: "tag";
    arguments: Expression[];
} & {
    loc: SourceLocation;
}>;
export declare const splatParser: Parser<SplatExpression>;
export declare const agencyArrayParser: Parser<AgencyArray>;
export declare const agencyObjectKVParser: Parser<AgencyObjectKV>;
export declare const agencyObjectParser: Parser<AgencyObject>;
export declare const _functionCallParser: Parser<FunctionCall>;
export declare const functionCallParser: Parser<FunctionCall>;
export declare const _valueAccessParser: (input: string) => ParserResult<VariableNameLiteral | FunctionCall | ValueAccess>;
export declare const asyncValueAccessParser: (input: string) => ParserResult<FunctionCall | ValueAccess | VariableNameLiteral>;
export declare const syncValueAccessParser: (input: string) => ParserResult<FunctionCall | ValueAccess | VariableNameLiteral>;
export declare function valueAccessParser(input: string): ParserResult<VariableNameLiteral | FunctionCall | ValueAccess>;
export declare const newExpressionParser: Parser<NewExpression>;
export declare const schemaExpressionParser: Parser<SchemaExpression>;
export declare const exprParser: Parser<Expression>;
export declare const returnStatementParser: Parser<ReturnStatement>;
export declare const gotoStatementParser: Parser<GotoStatement>;
export declare const interruptExprParser: Parser<InterruptStatement>;
export declare const interruptStatementParser: Parser<InterruptStatement>;
export declare const binOpParser: Parser<BinOpExpression>;
export declare const asParser: (input: string) => ParserResult<FunctionParameter[]>;
export declare const blockArgumentParser: Parser<BlockArgument>;
export declare const inlineBlockParser: Parser<BlockArgument>;
export declare const defaultCaseParser: Parser<DefaultCase>;
export declare const matchBlockParserCase: Parser<MatchBlockCase>;
export declare const matchBlockParser: Parser<{
    expression: Expression;
    type: "matchBlock";
    cases: (AgencyComment | NewLine | MatchBlockCase)[];
} & {
    loc: SourceLocation;
}>;
export declare const importNodeStatmentParser: Parser<ImportNodeStatement>;
export declare const importStatmentParser: Parser<ImportStatement>;
export declare const exportFromStatementParser: Parser<ExportFromStatement>;
export declare const assignmentParser: Parser<Assignment>;
export declare const modifiedAssignmentParser: Parser<Assignment>;
export declare const staticStatementParser: Parser<StaticStatement>;
export declare const docStringParser: Parser<MultiLineStringLiteral>;
export declare const bodyParser: (input: string) => ParserResult<AgencyNode[]>;
export declare const _messageThreadParser: Parser<MessageThread>;
export declare const _submessageThreadParser: Parser<MessageThread>;
export declare const messageThreadParser: Parser<MessageThread>;
export declare const handleBlockParser: Parser<HandleBlock>;
export declare const withModifierParser: Parser<WithModifier>;
export declare const ifParser: Parser<IfElse>;
export declare const whileLoopParser: Parser<WhileLoop>;
export declare const parallelBlockParser: Parser<ParallelBlock>;
export declare const seqBlockParser: Parser<SeqBlock>;
export declare const forLoopParser: Parser<ForLoop>;
export declare const functionParameterParser: Parser<FunctionParameter>;
export declare const variadicParameterParser: Parser<FunctionParameter>;
export declare const functionReturnTypeParser: Parser<VariableType>;
export declare const functionParser: Parser<FunctionDefinition>;
export declare const graphNodeParser: Parser<GraphNodeDefinition>;
export declare const reservedClassParser: Parser<never>;
export declare const wildcardPatternParser: Parser<WildcardPattern>;
export declare const restPatternParser: Parser<RestPattern>;
export declare const bindingPatternParser: Parser<BindingPattern>;
export declare const arrayBindingPatternParser: Parser<ArrayPattern>;
export declare const objectBindingPatternParser: Parser<ObjectPattern>;
export declare const resultPatternParser: Parser<ResultPattern>;
export declare const matchPatternParser: Parser<MatchPattern>;
export declare const arrayMatchPatternParser: Parser<ArrayPattern>;
export declare const objectMatchPatternParser: Parser<ObjectPattern>;
