import { Duration, Timezone } from 'chronoshift'; import { PlywoodRequester } from 'plywood-base-api'; import { ReadableStream, Transform } from 'readable-stream'; import { AttributeInfo, AttributeJSs, Attributes, Datum, PlywoodValue } from '../datatypes'; import { TimeRange } from '../datatypes/timeRange'; import { ApplyExpression, ChainableUnaryExpression, Expression, FilterExpression, LimitExpression, LiteralExpression, RefExpression, SelectExpression, SortExpression, SplitExpression, TimeShiftExpression } from '../expressions'; import { ExpressionJS } from '../expressions/baseExpression'; import { DatasetFullType, PlyType, PlyTypeSimple } from '../types'; import { CustomDruidAggregations, CustomDruidTransforms } from './utils/druidTypes'; export declare class TotalContainer { datum: Datum; constructor(d: Datum); toJS(): any; } export declare type NextFn = (prevQuery: Q, prevResultLength: number, prevMeta: any) => Q; export interface QueryAndPostTransform { query: T; context?: Record; postTransform: Transform; next?: NextFn; } export declare type Inflater = (d: Datum) => void; export declare type QuerySelection = 'any' | 'no-top-n' | 'group-by-only'; export declare type IntrospectionDepth = 'deep' | 'default' | 'shallow'; export interface IntrospectOptions { depth?: IntrospectionDepth; deep?: boolean; } export declare type QueryMode = 'raw' | 'value' | 'total' | 'split'; export interface SpecialApplyTransform { mainRangeLiteral: LiteralExpression; curTimeRange: TimeRange; prevTimeRange: TimeRange; } export interface ExternalValue { engine?: string; version?: string; suppress?: boolean; source?: string | string[]; rollup?: boolean; attributes?: Attributes; attributeOverrides?: Attributes; derivedAttributes?: Record; delegates?: External[]; concealBuckets?: boolean; mode?: QueryMode; dataName?: string; rawAttributes?: Attributes; filter?: Expression; valueExpression?: Expression; select?: SelectExpression; split?: SplitExpression; applies?: ApplyExpression[]; sort?: SortExpression; limit?: LimitExpression; havingFilter?: Expression; specialApplyTransform?: SpecialApplyTransform; withQuery?: string; timeAttribute?: string; customAggregations?: CustomDruidAggregations; customTransforms?: CustomDruidTransforms; allowEternity?: boolean; allowSelectQueries?: boolean; exactResultsOnly?: boolean; querySelection?: QuerySelection; context?: Record; requester?: PlywoodRequester; } export interface ExternalJS { engine: string; version?: string; source?: string | string[]; rollup?: boolean; attributes?: AttributeJSs; attributeOverrides?: AttributeJSs; derivedAttributes?: Record; filter?: ExpressionJS; rawAttributes?: AttributeJSs; concealBuckets?: boolean; withQuery?: string; timeAttribute?: string; customAggregations?: CustomDruidAggregations; customTransforms?: CustomDruidTransforms; allowEternity?: boolean; allowSelectQueries?: boolean; exactResultsOnly?: boolean; querySelection?: QuerySelection; context?: Record; } export interface ApplySegregation { aggregateApplies: ApplyExpression[]; postAggregateApplies: ApplyExpression[]; } export interface AttributesAndApplies { attributes?: Attributes; applies?: ApplyExpression[]; } export declare abstract class External { static type: string; static SEGMENT_NAME: string; static VALUE_NAME: string; static isExternal(candidate: any): candidate is External; static extractVersion(v: string): string; static versionLessThan(va: string, vb: string): boolean; static deduplicateExternals(externals: External[]): External[]; static addExtraFilter(ex: Expression, extraFilter: Expression): Expression; static makeZeroDatum(applies: ApplyExpression[]): Datum; static normalizeAndAddApply(attributesAndApplies: AttributesAndApplies, apply: ApplyExpression): AttributesAndApplies; static segregationAggregateApplies(applies: ApplyExpression[]): ApplySegregation; static getCommonFilterFromExternals(externals: External[]): Expression; static getMergedDerivedAttributesFromExternals(externals: External[]): Record; static getIntelligentInflater(expression: Expression, label: string): Inflater; static getSimpleInflater(type: PlyType, label: string): Inflater; static booleanInflaterFactory(label: string): Inflater; static timeRangeInflaterFactory(label: string, duration: Duration, timezone: Timezone): Inflater; static nullInflaterFactory(label: string): Inflater; static numberRangeInflaterFactory(label: string, rangeSize: number): Inflater; static numberInflaterFactory(label: string): Inflater; static stringInflaterFactory(label: string): Inflater; static timeInflaterFactory(label: string): Inflater; static ipInflaterFactory(label: string): Inflater; static setStringInflaterFactory(label: string): Inflater; static setCardinalityInflaterFactory(label: string): Inflater; static typeCheckDerivedAttributes(derivedAttributes: Record, typeContext: DatasetFullType): Record; static valuePostTransformFactory(): Transform; static inflateArrays(d: Datum, attributes: Attributes): void; static postTransformFactory(inflaters: Inflater[], attributes: Attributes, keys: string[], zeroTotalApplies: ApplyExpression[]): Transform; static performQueryAndPostTransform(queryAndPostTransform: QueryAndPostTransform, requester: PlywoodRequester, engine: string, rawQueries: any[] | null): ReadableStream; static buildValueFromStream(stream: ReadableStream): Promise; static valuePromiseToStream(valuePromise: Promise): ReadableStream; static jsToValue(parameters: ExternalJS, requester: PlywoodRequester): ExternalValue; static classMap: Record; static register(ex: typeof External): void; static getConstructorFor(engine: string): typeof External; static uniteValueExternalsIntoTotal(keyExternals: { key: string; external?: External; }[]): External; static fromJS(parameters: ExternalJS, requester?: PlywoodRequester): External; static fromValue(parameters: ExternalValue): External; engine: string; version: string; source: string | string[]; suppress: boolean; rollup: boolean; attributes: Attributes; attributeOverrides: Attributes; derivedAttributes: Record; delegates: External[]; concealBuckets: boolean; rawAttributes: Attributes; requester: PlywoodRequester; mode: QueryMode; filter: Expression; valueExpression: Expression; select: SelectExpression; split: SplitExpression; dataName: string; applies: ApplyExpression[]; sort: SortExpression; limit: LimitExpression; havingFilter: Expression; specialApplyTransform: SpecialApplyTransform; constructor(parameters: ExternalValue, dummy?: any); protected _ensureEngine(engine: string): void; protected _ensureMinVersion(minVersion: string): void; valueOf(): ExternalValue; toJS(): ExternalJS; toJSON(): ExternalJS; toString(): string; equals(other: External | undefined): boolean; equalBaseAndFilter(other: External): boolean; equalBase(other: External): boolean; changeVersion(version: string): External; attachRequester(requester: PlywoodRequester): External; versionBefore(neededVersion: string): boolean; protected capability(_cap: string): boolean; getAttributesInfo(attributeName: string): AttributeInfo; updateAttribute(newAttribute: AttributeInfo): External; show(): External; hasAttribute(name: string): boolean; expressionDefined(ex: Expression): boolean; bucketsConcealed(ex: Expression): boolean; changeSpecialApplyTransform(specialApplyTransform: SpecialApplyTransform): External; abstract canHandleFilter(filter: FilterExpression): boolean; abstract canHandleSort(sort: SortExpression): boolean; addDelegate(delegate: External): External; getBase(): External; getRaw(): External; makeTotal(applies: ApplyExpression[]): External; private getHybridTimeExpressionDecomposition; private _addFilterForNext; addExpression(ex: Expression): External; private _addFilterExpression; private _addSelectExpression; private _addSplitExpression; private _addApplyExpression; private _addSortExpression; private _addLimitExpression; private _addAggregateExpression; private _addPostAggregateExpression; prePush(ex: ChainableUnaryExpression): External; valueExpressionWithinFilter(withinFilter: Expression): Expression; toValueApply(): ApplyExpression; sortOnLabel(): boolean; getQuerySplit(): SplitExpression; getQueryFilter(): Expression; inlineDerivedAttributes(expression: Expression): Expression; getSelectedAttributes(): Attributes; getValueType(): PlyTypeSimple; addNextExternalToDatum(datum: Datum): void; getDelegate(): External; simulateValue(lastNode: boolean, simulatedQueries: any[], externalForNext?: External): PlywoodValue | TotalContainer; getQueryAndPostTransform(): QueryAndPostTransform; queryValue(lastNode: boolean, rawQueries: any[], externalForNext?: External): Promise; protected queryBasicValueStream(rawQueries: any[] | null): ReadableStream; queryValueStream(lastNode: boolean, rawQueries: any[] | null, externalForNext?: External): ReadableStream; needsIntrospect(): boolean; protected abstract getIntrospectAttributes(depth: IntrospectionDepth): Promise; introspect(options?: IntrospectOptions): Promise; getRawFullType(skipDerived?: boolean): DatasetFullType; getFullType(): DatasetFullType; getTimeAttribute(): string | undefined; isTimeRef(ex: Expression): ex is RefExpression; private groupAppliesByTimeFilterValue; getJoinDecompositionShortcut(): { external1: External; external2: External; timeShift?: TimeShiftExpression; waterfallFilterExpression?: SplitExpression; } | null; } //# sourceMappingURL=baseExternal.d.ts.map