import { Dimension } from "./types.mjs"; type QueryErrorKind = 'missing-date-range' | 'invalid-row-limit' | 'invalid-start-row' | 'invalid-data-state' | 'invalid-aggregation-type' | 'invalid-builder-state' | 'invalid-filter' | 'unsupported-capability' | 'unresolvable-dataset'; type QueryError = { kind: 'missing-date-range'; message: string; } | { kind: 'invalid-row-limit'; value: unknown; message: string; } | { kind: 'invalid-start-row'; value: unknown; message: string; } | { kind: 'invalid-data-state'; message: string; } | { kind: 'invalid-aggregation-type'; message: string; } | { kind: 'invalid-builder-state'; message: string; cause?: unknown; } | { kind: 'invalid-filter'; message: string; } | { kind: 'unsupported-capability'; capability: string; context: string; message: string; } | { kind: 'unresolvable-dataset'; dimensions: readonly Dimension[]; filterDims: readonly Dimension[]; message: string; }; declare const queryErrors: { readonly missingDateRange: () => QueryError; readonly invalidRowLimit: (value: unknown) => QueryError; readonly invalidStartRow: (value: unknown) => QueryError; readonly hourDimensionRequiresHourlyState: () => QueryError; readonly hourlyStateRequiresHourDimension: () => QueryError; readonly byPropertyUnsupportedSearchType: () => QueryError; readonly byPropertyNotAllowedWithPage: () => QueryError; readonly byNewsShowcaseRequiresSearchType: () => QueryError; readonly byNewsShowcaseNotAllowedWithPage: () => QueryError; readonly byNewsShowcaseRequiresShowcaseFilter: () => QueryError; readonly invalidBuilderState: (cause?: unknown) => QueryError; readonly malformedFilterLeaf: () => QueryError; readonly unsupportedCapability: (capability: string, context: string) => QueryError; readonly unresolvableDataset: (dimensions: readonly Dimension[], filterDims?: readonly Dimension[]) => QueryError; }; declare function isQueryError(value: unknown): value is QueryError; /** * Thrown when a query needs a planner capability (regex pushdown, comparison * joins, multi-dataset reads) the target engine lacks. Engines catch it to fall * back to the live GSC API. Carries the typed `queryError` value so a caller can * read the modelled failure instead of parsing the message. */ declare class UnsupportedLogicalCapabilityError extends Error { readonly queryError: Extract; constructor(capability: string, context: string); } /** * Thrown when a query's grouped + filtered dimensions span more than one stored * dataset. Replaces the resolver's raw "unknown column" error so hosts can map * it to a 4xx instead of leaking an opaque 500. Carries the typed `queryError`. */ declare class UnresolvableDatasetError extends Error { readonly queryError: Extract; constructor(dimensions: readonly Dimension[], filterDims?: readonly Dimension[]); } /** * Re-raises a `QueryError` value as an `Error`, preserving the historical class * identity for the two errors engines match on by name (`UnresolvableDatasetError`, * `UnsupportedLogicalCapabilityError`). Pairs with `unwrapResult` so a * `fooResult(): Result` core can back a throwing `foo()`. */ declare function queryErrorToException(error: QueryError): Error; export { QueryError, QueryErrorKind, UnresolvableDatasetError, UnsupportedLogicalCapabilityError, isQueryError, queryErrorToException, queryErrors };