/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable react/require-default-props */ /* eslint-disable react/no-unused-prop-types */ /** * @author David */ import { Component, ReactElement, ReactNode } from 'react'; export type Localized = { locale: string title: string } export type RenderingFunction = {():string|ReactElement|ReactNode}; export type CustomHeaderIcon = { icon: RenderingFunction payload: string tooltip?: Localized[] postbackTitle?: string } export type HashAuth = { userId: string hash: string timestamp: number data: object }; export type Props = { autoStart?: boolean fullscreen?: boolean, maximizable?: boolean, startMaximized?: boolean, startAction?: string pageId?: string, authorization?: string senderId?: string disableComposer?: boolean api?: string websocket?: string, showTracking?: boolean, showVectorSearch?: boolean, contextLangProp?: string, contextTimezoneProp?: string, contextLocaleProp?: string, oauthWithCredentials?: boolean, oauthPrompt?: string, oauthMode: 'xhr'|'iframe'|'redirect'|string oauthRedirectFallbackAllowed?: boolean oauthRedirectProxyEnabled?: boolean|string contextUserAgentProp?: string, contextScreenResolutionProp?: string, uploadEnabled?: boolean, context?: { [key: string]: string | number | boolean }, className?: string, customStore?: unknown onPublicContextChange?: OnPublicContextChange enableMessageTimestamps?: boolean addCustomFaq?: ( viewEvents: MessagingEvent[], myevent: MessagingEvent, sendAsPage: boolean, senderId: string, pageId: string ) => void; lang?: string; customHeaderIcons?: CustomHeaderIcon[] hashAuth?: HashAuth expandStartActionExpirationMs?: number expandStartAction?: string }; export type OnPublicContextChange = { (current: T, prev: T): void }; // eslint-disable-next-line export class WingbotChat extends Component { } export type Enhancer = { (chat: WingbotChat | null, cmd: string, ...args: any[]): [cmd: string, ...args: any[]] }; type ChatFunction = { (cmd: string, ...args: unknown[]): void } export function injectOptionsEnhancer(options: Props): Enhancer; export function createWingbotChat(enhancers: Enhancer[]): ChatFunction export function createDummyChatReduxStore(...props: any): any; export function attachChatToWindow(chatFunction: ChatFunction): void export type MessagingEvent = ocp.MessagingEvent; export type Postback = ocp.Postback; export type Attachment = ocp.Attachment; export type TextMessage = ocp.TextMessage; export type GenericTemplate = ocp.GenericTemplate; export type InteractionEvent = ocp.InteractionEvent; export type ReadDelivery = ocp.ReadDelivery; export type DetectedEntity = ocp.DetectedEntity; export type DetectedIntent = ocp.DetectedIntent; export type MessagingMeta = ocp.MessagingMeta; export type Tracking = ocp.Tracking; export type Button = ocp.Button; export type PassThreadRequest = ocp.PassThreadRequest; export type SenderAction = ocp.SenderAction; export type SetContext = ocp.SetContext;