@ -11,6 +11,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"@types/react": "18.2.15"
|
||||
"@types/react": "18.2.15",
|
||||
"@typebot.io/forge-repository": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { SVGProps } from 'react'
|
||||
import { z } from './zod'
|
||||
import { ZodRawShape } from 'zod'
|
||||
import { enabledBlocks } from '@typebot.io/forge-repository'
|
||||
|
||||
export type VariableStore = {
|
||||
get: (variableId: string) => string | (string | null)[] | null | undefined
|
||||
@ -32,6 +33,14 @@ export type FunctionToExecute = {
|
||||
|
||||
export type ReadOnlyVariableStore = Omit<VariableStore, 'set'>
|
||||
|
||||
export type TurnableIntoParam<T = {}> = {
|
||||
blockType: (typeof enabledBlocks)[number]
|
||||
/**
|
||||
* If defined will be used to convert the existing block options into the new block options.
|
||||
*/
|
||||
customMapping?: (options: T) => any
|
||||
}
|
||||
|
||||
export type ActionDefinition<
|
||||
A extends AuthDefinition,
|
||||
BaseOptions extends z.ZodObject<ZodRawShape> = z.ZodObject<{}>,
|
||||
@ -40,6 +49,7 @@ export type ActionDefinition<
|
||||
name: string
|
||||
fetchers?: FetcherDefinition<A, z.infer<BaseOptions> & z.infer<Options>>[]
|
||||
options?: Options
|
||||
turnableInto?: TurnableIntoParam<z.infer<Options>>[]
|
||||
getSetVariableIds?: (options: z.infer<Options>) => string[]
|
||||
run?: {
|
||||
server?: (params: {
|
||||
|
Reference in New Issue
Block a user