import { StepExecutionContext, WorkflowData } from "./type"; type Func1 = (input: T extends WorkflowData ? U : T extends object ? { [K in keyof T]: T[K] extends WorkflowData ? U : T[K]; } : {}, context: StepExecutionContext) => U | Promise; type Func = (input: T, context: StepExecutionContext) => U | Promise; /** * * This function transforms the output of other utility functions. * * For example, if you're using the value(s) of some step(s) as an input to a later step. As you can't directly manipulate data in the workflow constructor function passed to {@link createWorkflow}, * the `transform` function provides access to the runtime value of the step(s) output so that you can manipulate them. * * Another example is if you're using the runtime value of some step(s) as the output of a workflow. * * If you're also retrieving the output of a hook and want to check if its value is set, you must use a workflow to get the runtime value of that hook. * * @returns There's no expected value to be returned by the `transform` function. * * @example * import { * createWorkflow, * transform, * WorkflowResponse * } from "@medusajs/framework/workflows-sdk" * import { step1, step2 } from "./steps" * * type WorkflowInput = { * name: string * } * * const myWorkflow = createWorkflow( * "hello-world", * (input: WorkflowInput) => { * const str1 = step1(input) * const str2 = step2(input) * * const message = transform({ * str1, * str2 * }, (input) => `${input.str1}${input.str2}`) * * return new WorkflowResponse(message) * }) */ export declare function transform( /** * The output(s) of other step functions. */ values: T, /** * The transform function used to perform action on the runtime values of the provided `values`. */ ...func: [Func1]): WorkflowData; /** * @internal */ export declare function transform(values: T, ...func: [Func1] | [Func1, Func]): WorkflowData; /** * @internal */ export declare function transform(values: T, ...func: [Func1] | [Func1, Func] | [Func1, Func, Func]): WorkflowData; /** * @internal */ export declare function transform(values: T, ...func: [Func1] | [Func1, Func] | [Func1, Func, Func] | [Func1, Func, Func, Func]): WorkflowData; /** * @internal */ export declare function transform(values: T, ...func: [Func1] | [Func1, Func] | [Func1, Func, Func] | [Func1, Func, Func, Func] | [Func1, Func, Func, Func, Func]): WorkflowData; /** * @internal */ export declare function transform(values: T, ...func: [Func1] | [Func1, Func] | [Func1, Func, Func] | [Func1, Func, Func, Func] | [Func1, Func, Func, Func, Func] | [Func1, Func, Func, Func, Func, Func]): WorkflowData; /** * @internal */ export declare function transform(values: T, ...func: [Func1] | [Func1, Func] | [Func1, Func, Func] | [Func1, Func, Func, Func] | [Func1, Func, Func, Func, Func] | [Func1, Func, Func, Func, Func, Func] | [Func1, Func, Func, Func, Func, Func, Func]): WorkflowData; export {}; //# sourceMappingURL=transform.d.ts.map