import { CreateLogsBackfillJobDataType, CreateSpansBackfillJobDataType, DatadogQueryPredicateType, NewRelicQueryPredicateType, type SchemaEventPredicate, type SchemaNrqlQueryPredicate, type SchemaQuery, type SchemaTracesIcebergTableSource } from '../openapi/openApiTypes.js'; import type { SignalDataType } from './signal-source.js'; export type LanguageQueryType = DatadogQueryPredicateType.datadog_query | NewRelicQueryPredicateType.newrelic_query; export interface LanguageQueryOptions { query?: string; queryType?: LanguageQueryType; } export interface SourcePredicateOptions extends LanguageQueryOptions { messageLengthMin?: number; messageLengthMax?: number; } export interface SignalPredicateOptions extends SourcePredicateOptions { dataType: SignalDataType; } export type SpanQueryFilters = Pick; export type BuiltSignalPredicate = { dataType: CreateLogsBackfillJobDataType.logs; query: SchemaEventPredicate; } | { dataType: CreateSpansBackfillJobDataType.spans; query: SchemaQuery; }; export declare function buildLanguageQueryPredicate(options: LanguageQueryOptions): SchemaQuery; /** * The reason a message-length range is unusable, or undefined when it is fine. A negative bound is * not a length, and a reversed range can never match. The removed structured predicate rejected * both with a 400; the NRQL replacement would instead be accepted and quietly return no rows. */ export declare function messageLengthBoundsError(min?: number, max?: number): string | undefined; /** * Builds the NRQL a message-length range is expressed as, or undefined when no bound constrains * anything. This text must stay byte-identical to what the server converts a stored * `message-length` predicate into. * * Bounds outside int range clamp to their exact equivalents: every message satisfies an upper * bound at or above INT_MAX_LENGTH, so it is dropped, and no message satisfies a lower bound above * it, so it becomes a bound no length can meet. Clamping would hide an unusable range, so the * bounds are validated first. * * @throws RangeError when messageLengthBoundsError rejects the bounds */ export declare function messageLengthNrql(min?: number, max?: number): string | undefined; export declare function buildMessageLengthPredicate(options: SourcePredicateOptions): SchemaNrqlQueryPredicate | undefined; export declare function buildSourcePredicate(options: SourcePredicateOptions): SchemaEventPredicate; export declare function buildSignalPredicate(options: SignalPredicateOptions): BuiltSignalPredicate; export declare function buildSpanQueryPredicate(options: SourcePredicateOptions): SchemaQuery; /** * Lifts the subset of Datadog span-query syntax that synchronous structured source filters can * represent without changing its meaning. Synchronous queries reject lossy Boolean and wildcard * forms instead of silently narrowing or widening the query; span backfills do not use this path. */ export declare function deriveSpanQueryFilters(query: string): SpanQueryFilters; /** * Warns synchronous-query users when structured filters cannot represent the complete predicate. * The raw predicate remains on synchronous span sources, so this path does not need to fail. */ export declare function warnOnUnliftedSpanQuery(query: string): void; //# sourceMappingURL=query-predicate.d.ts.map