import { Query } from '../query'; import { Graph } from '../graph'; import { ErrorDetails } from '@andyfischer/streams'; import { Handler } from '../handler'; import { JoinPlan } from './Join'; import { TaskCallback } from '../task/runTaskCallback'; import { SchemaDecl } from '../table'; export type QueryExecutionContext = any; export type QueryParameters = any; export type NativeCallback = Function; export interface NoInputExpected { t: 'no_value'; } export interface SomeInputExpected { t: 'some_value'; } export interface ExpectedSingleValue { t: 'expected_value'; value: Query; } export interface ExpectedUnionValue { t: 'expected_union'; values: Query[]; } export type ExpectedValue = NoInputExpected | SomeInputExpected | ExpectedSingleValue | ExpectedUnionValue; export interface InputValueFromQueryAttr { t: 'input_value_from_query_attr'; attr: string; } export interface InputAttrFromQueryIndex { t: 'input_attr_from_query_index'; index: number; } export interface InputValueFromParams { t: 'input_value_from_params'; attr: string; } export interface InputValueNotProvided { t: 'input_value_not_provided'; } export interface SpecialInputValueTask { t: 'special_input_value_task'; } export type InputValuePlan = InputValueFromQueryAttr | InputAttrFromQueryIndex | InputValueFromParams | InputValueNotProvided | SpecialInputValueTask; export declare class Plan { graph: Graph; query: Query; queryWithoutVerb: Query; verb: string; context: QueryExecutionContext; expectedInput: ExpectedValue; handler: Handler; inputValues: InputValuePlan[]; expectedOutput: ExpectedValue; checkRequiredParams: string[]; overprovidedAttrs: string[]; paramsFromQuery: Map; outputSchema: SchemaDecl; nativeCallback: TaskCallback | null; joinPlan?: JoinPlan; outputFilters: OutputFilter[]; knownError?: ErrorDetails; toDebugString(): void; consoleLog(): void; } export type OutputFilter = OutputFilterReshape | OutputFilterWhereAttrsEqual; export interface OutputFilterReshape { t: 'reshape'; shape: OutputAttr[]; } export interface OutputFilterWhereAttrsEqual { t: 'whereAttrsEqual'; attrs: Array; } export type OutputAttr = OutputAttrFromItem | OutputAttrFromParam | OutputAttrConstant; interface OutputAttrFromItem { t: 'from_item'; attr: string; } interface OutputAttrFromParam { t: 'from_param'; attr: string; } interface OutputAttrConstant { t: 'constant'; attr: string; value: any; } export type ExecutionType = 'normal' | 'schemaOnly'; export {};