/** * Defines which type of content a Step returns. * Add an entry here when you define a step */ export type StepReturnTypes = { FILE_OR_URL_IMPORT: string // String content of the file/url TARGET_MY_COLLECTION: number // folderPath } /** * Defines what the data structure of a step */ export type Step = { name: T caption?: string } /** * The return output value of an individual step */ export type StepReturnType = T extends Step ? StepReturnTypes[U] : never /** * Defines the value of the output list generated by a step */ export type StepsOutputList = { [K in keyof T]: StepReturnType } /** Use this function to define a step */ export const step = ( stepName: T, caption?: string ) => >{ name: stepName, caption, }