UNPKG

@afex-bots/feedback

Version:

Feedback Bot

103 lines (95 loc) 2.54 kB
import { ReactNode } from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; declare const ISSUE_TYPES: readonly { label: string; value: string; }[]; type IssueTypeValue = (typeof ISSUE_TYPES)[number]["label"]; type AuthStrategy = "localStorage" | "sessionStorage" | "user"; type AuthMethod = "string" | "object"; interface StorageKeys { strategy?: Exclude<AuthStrategy, "user-specified">; method?: AuthMethod; objectName?: string; userKeys: { email: string; name: string; }; } interface UserSpecifiedKeys { strategy: "user-specified"; userData: { email: string; name: string; }; } type AuthStatus = StorageKeys | UserSpecifiedKeys; interface SupportGuideProps { customFaqSection?: React.ReactNode; gradient?: [string, string]; system?: IssueTypeValue; titles?: { description: string; guideSections?: { heading: string; steps: string[]; }[]; heading: string; id?: number; }[]; } interface DefaultConfiguration { apiKey?: string; apiURL?: string; authStatus?: AuthStatus; headers?: Record<string, string>; issueType?: IssueTypeValue; position?: "bottom-left" | "bottom-right" | "left" | "right" | "top-left" | "top-right"; sections?: Array<Section>; supportGuide?: SupportGuideProps; icon?: ReactNode; label?: string | ReactNode; } interface Section { icon?: ReactNode; id: ViewType; title: string; show?: boolean; } declare const View: Readonly<{ Chat: "Chat"; Feedback: "Feedback"; Home: "Home"; Info: "Info"; Issue: "Issue"; }>; type ViewType = keyof typeof View; declare const FeedBackBot: (defaultProps: DefaultConfiguration) => react_jsx_runtime.JSX.Element; declare const defaultPosition = "bottom-right"; declare const defaultSections: ({ icon: react_jsx_runtime.JSX.Element; id: "Home"; title: string; } | { icon: react_jsx_runtime.JSX.Element; id: "Issue"; title: string; } | { icon: react_jsx_runtime.JSX.Element; id: "Chat"; title: string; })[]; declare const defaultSupportGuide: { gradient: [string, string]; system: string; titles: { description: string; guideSections: { heading: string; steps: string[]; }[]; heading: string; id: number; }[]; }; export { type DefaultConfiguration, FeedBackBot, defaultPosition, defaultSections, defaultSupportGuide };