import * as Lib from "../..";
import type Metadata from "../../v1/metadata/Metadata";
import type { ErrorWithMessage, Token } from "./types";
export declare function countMatchingParentheses(tokens: Token[]): number;
export declare function diagnose({ source, startRule, query, stageIndex, metadata, name, expressionIndex, }: {
    source: string;
    startRule: "expression" | "aggregation" | "boolean";
    query: Lib.Query;
    stageIndex: number;
    name?: string | null;
    metadata?: Metadata;
    expressionIndex: number | undefined;
}): ErrorWithMessage | null;
export declare function isErrorWithMessage(err: unknown): err is ErrorWithMessage;
