import { ChatElement } from 'chat-element-json-ts'; import { BasicCardType } from './BasicCard.component'; import { CarouselType } from './Carousel.component'; import { CommerceCardType } from './CommerceCard.component'; import { OutputElementName } from './constants'; import { ItemCardType } from './item-card'; import { SimpleImageType } from './SimpleImage.component'; import { SimpleTextType } from './SimpleText.component'; export type DefaultContentType = | BasicCardType | CommerceCardType | CarouselType | SimpleTextType | SimpleImageType | ItemCardType; export class OutputElementPropsType { [chatElementName: string]: AllowedContentType; } export type OutputType = ChatElement< typeof OutputElementName, OutputElementPropsType >; export function Output( outputProps: OutputElementPropsType, ): OutputType { return new ChatElement(OutputElementName, outputProps); }