import { ExecutionPlan, Planner, SerializableExecutionPlan } from "./Planner.js"; import TemplateProcessor, { Fork, Op } from "./TemplateProcessor.js"; import { JsonPointerString, MetaInfo } from "./MetaInfoProducer.js"; import { Snapshot } from "./TemplateProcessor.js"; export interface SerialPlan extends ExecutionPlan { sortedJsonPtrs: JsonPointerString[]; restoreJsonPtrs: JsonPointerString[]; didUpdate: boolean[]; } /** export type Plan = { sortedJsonPtrs:JsonPointerString[], restoreJsonPtrs:JsonPointerString[], //this is dependencies (functions and intervals/timeouts) we need to initialize on restore from a snapshot before we can evaluate the plan didUpdate: boolean[] //peers with sortedJsonPointers, tells us which of those locations in output actually updated data?:any, op?:Op, //if present and op="set", the data is applied to first json pointer output:object, forkId:string, forkStack:Fork[] //allows us to have nested execution contexts that cen restored by popping this stack onto output lastCompletedStep?:PlanStep, }; */ export declare class SerialPlanner implements Planner { private tp; constructor(tp: TemplateProcessor); getInitializationPlan(jsonPointer?: JsonPointerString): ExecutionPlan; execute(plan: ExecutionPlan): Promise; executeDependentExpressions(plan: SerialPlan): Promise; topologicalSort(metaInfos: MetaInfo[], exprsOnly?: boolean, fanout?: boolean, extraOpts?: { isFollowDependencies: boolean; }): JsonPointerString[]; static isInterval: (metaInf: MetaInfo, tp: TemplateProcessor) => boolean; static isFunction: (jsonPointer: JsonPointerString, tp: TemplateProcessor) => boolean; getDependeesBFS(jsonPtr: JsonPointerString): MetaInfo[]; /** * Restores ExecutionStatuses, initialize plans and executes all plans in-flight * @param executionStatus */ /** * Create an initialization plan from the execution plan, that intializes outputs that cannot be serialized and * deserialized from the snapshot, such as timers, and functions. * @param plan */ private restoreIntervalsExpressionsAndFunctions; /** * This method is used to compile and evaluate function expressions and their dependencies. * * Based on the metadata, we should identify all functions, and their dependencies * @param plan */ evaluateRestorePlan(plan: SerialPlan): Promise; applyMutationToFirstJsonPointerOfPlan(plan: ExecutionPlan): Promise; getMutationPlan(jsonPtr: JsonPointerString, data: any, op: Op): [SerialPlan, JsonPointerString[]]; from(jsonPtr: JsonPointerString): string[]; toJSON(mutationPlan: ExecutionPlan): SerializableExecutionPlan; executeDataChangeCallbacks(plan: ExecutionPlan): Promise; fromJSON(planData: SerializableExecutionPlan, snapshot: Snapshot, forks: Map): ExecutionPlan; } //# sourceMappingURL=SerialPlanner.d.ts.map