import { StreamIO } from '../data'; import { ArrayType, BooleanType, DictType, EastFunction, EastType, ProcedureFunction, SetType, StringType, StructType, VariantType } from '../east'; import { MLDescription } from '../scenario/SimulationTaskDescription'; import { ModulePath } from '../template'; /** @internal */ export type LetFunctionStatement = { type: "let"; name: string; expr: EastFunction; }; /** @internal */ export type AssignFunctionStatement = { type: "assign"; name: string; expr: EastFunction; }; /** @internal */ export type InsertFunctionStatement = { type: "insert"; collection: EastFunction; key: "first" | "last" | EastFunction; value: EastFunction | null; if_exists: 'error' | 'warn' | 'ignore'; }; /** @internal */ export type UpdateFunctionStatement = { type: "update"; collection: EastFunction; key: EastFunction; value: EastFunction; old_value: string; }; /** @internal */ export type DeleteFunctionStatement = { type: "delete"; collection: EastFunction; key: "first" | "last" | EastFunction; if_not_exists: 'error' | 'warn' | 'ignore'; }; /** @internal */ export type ClearFunctionStatement = { type: "clear"; collection: EastFunction; }; /** @internal */ export type IfFunctionStatement = { type: "if"; predicate: EastFunction; true_statements: FunctionStatement[]; false_statements: FunctionStatement[]; }; /** @internal */ export type IfNullFunctionStatement = { type: "ifNull"; label: string; input: EastFunction; null_statements: FunctionStatement[]; value_statements: FunctionStatement[]; }; /** @internal */ export type MatchFunctionStatement = { type: "match"; label: string; variant: EastFunction; case_statements: Record; }; /** @internal */ export type WhileFunctionStatement = { type: "while"; label: string; predicate: EastFunction; statements: FunctionStatement[]; }; /** @internal */ export type ForFunctionStatement = { type: "for"; label: string; collection: EastFunction; statements: FunctionStatement[]; }; /** @internal */ export type ContinueFunctionStatement = { type: "continue"; label: string; }; /** @internal */ export type BreakFunctionStatement = { type: "break"; label: string; }; /** @internal */ export type LogFunctionStatement = { type: "log"; message: EastFunction; }; /** @internal */ export type WarnFunctionStatement = { type: "warn"; message: EastFunction; }; /** @internal */ export type ErrorFunctionStatement = { type: "error"; message: EastFunction; }; /** @internal */ export type ReturnFunctionStatement = { type: "return"; outputs: Record; }; /** @internal */ export type RecurseFunctionStatement = { type: "recurse"; name: string; inputs: Record; }; /** @internal */ export type ReturnProcedureStatement = { type: "return_procedure"; output: EastFunction; }; /** @internal */ export type FunctionStatement = LetFunctionStatement | AssignFunctionStatement | InsertFunctionStatement | UpdateFunctionStatement | DeleteFunctionStatement | ClearFunctionStatement | IfFunctionStatement | IfNullFunctionStatement | MatchFunctionStatement | WhileFunctionStatement | ForFunctionStatement | ContinueFunctionStatement | BreakFunctionStatement | LogFunctionStatement | WarnFunctionStatement | ErrorFunctionStatement | ReturnFunctionStatement | RecurseFunctionStatement | ReturnProcedureStatement; /** @internal */ export type ProcedureDescription = { name: Name; inputs: Inputs; output: T; procedures: Record; statements: FunctionStatement[]; }; /** @internal */ export type ProcedureEvaluator = (inputs: EastFunction) => EastFunction; /** @internal */ export declare function ProcedureEvaluator(proc: Proc): ProcedureEvaluator; /** @internal */ export declare function createProcedureAST(proc: ProcedureDescription, inputs: EastFunction): ProcedureFunction; /** @internal */ export declare function procedureEqual(proc1: ProcedureDescription, proc2: ProcedureDescription): boolean; /** @internal */ export type FunctionTaskDescription = { task_type: "function"; module: ModulePath; name: string; inputs: Record; defaults: Record; mls: Record; procedures: Record; outputs: Record; statements: FunctionStatement[]; random_seed: string; };