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, };

Implements

Constructors

Properties

Methods

  • 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

    Parameters

    Returns Promise<void>

  • Executes the specified execution plan.

    This method runs any plan that the Planner has generated, applying its operations to the template or its components.

    Parameters

    Returns Promise<void>

    A promise that resolves once execution is complete.

  • Returns a 'total ordering' of the dependency graph. A single array of JSON pointers is returned. From always uses the SerialPlanner therefore the returned array of json pointers should only be literally interpreted as the execution plan order when you are using a SerialPlanner. However, the point of from() is to give users of the command line a concise report on which parts of the output the dag will propagate to. In other words, the 'effects' that flow downstream from a mutation applied to jsonPtr

    Parameters

    • jsonPtr: string

    Returns string[]

    JsonPointerString[]

  • This is the inverse of the toJSON. It takes a serializable execution plan and returns an object that can be used in the runtime.The snapshot is necessary because it contains normalization structures that have to be used to rehydrate an ExecutionPlan from a SerializableExecutionPlan

    Parameters

    Returns ExecutionPlan

  • Generates an initialization plan for the specified JSON pointer.

    This method is typically queued by the TemplateProcessor during initialization. While the jsonPointer is often / (the root), it may point to a specific location in the template when $import is called to initialize an imported template.

    Parameters

    • jsonPointer: string = "/"

      The JSON pointer indicating the location for initialization.

    Returns ExecutionPlan

    The generated ExecutionPlan for initialization.

  • Generates a mutation plan for the specified JSON pointer and operation.

    This method creates a plan responsible for performing mutations on the template. Supported operations include initialize, set, delete, and forceSetInternal.

    Parameters

    • jsonPtr: string
    • data: any
    • op: Op

      The operation to perform. Supported values: "initialize", "set", "delete", "forceSetInternal".

    Returns [SerialPlan, string[]]

    [ExecutionPlan, JsonPointerString[]] The generated ExecutionPlan for the mutation and an array telling which expressions must be transitively re-evaluated as a result of the mutation.

    See

    Op

  • 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.

    Parameters

    Returns Promise<void>

  • Parameters

    • metaInfos: MetaInfo[]
    • exprsOnly: boolean = true
    • fanout: boolean = true
    • extraOpts: {
          isFollowDependencies: boolean;
      } = ...
      • isFollowDependencies: boolean

    Returns string[]

Generated using TypeDoc