IChatRendering interface
đ Descriptionâ
Interface that specifies the block renderer interface. Used when creating custom blocks.
đ Type declarationâ
interface IChatRendering { required?: boolean;ReadonlyOptional question?: (props: IChatRenderProps) => ReactNode;FunctionOptional answer?: (props: IChatRenderProps) => ReactNode;FunctionOptional input?: (props: IChatRenderProps, done?: () => void, cancel?: () => void) => ReactNode;FunctionOptional }
đī¸ Propertiesâ
đˇī¸ requiredâ
Specifies if the block is required.
Typeâ
boolean
âļī¸ Functionsâ
đ§ answerâ
Specifies a function that is invoked when the answer bubble for the block is generated. This function should return a valid React component.
Signatureâ
(props: IChatRenderProps) => ReactNode
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
props | IChatRenderProps | No | Contains the rendering props. |
Return valueâ
Returns the ReactNode for the answer bubble.
Read the Custom blocks guide for an example.
đ§ inputâ
Specifies a function that is invoked when the input area for the block is generated. This function should return a valid React component.
Signatureâ
(props: IChatRenderProps, done?: () => void, cancel?: () => void) => ReactNode
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
props | IChatRenderProps | No | Contains the rendering props. |
done | () => void | Yes | Invoke this function when the block is done and the runner can move to the next block. |
cancel | () => void | Yes | Invoke this function when the block wants to cancel and go back to the previous block. |
Return valueâ
Returns the ReactNode for the input area.
Read the Custom blocks guide for an example.
đ§ questionâ
Specifies a function that is invoked when the question bubble for the block is generated. This function should return a valid React component.
Signatureâ
(props: IChatRenderProps) => ReactNode
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
props | IChatRenderProps | No | Contains the rendering props. |
Return valueâ
Returns the ReactNode for the question bubble.
Read the Custom blocks guide for an example.