/************************************************************************** * IMPORTS ***************************************************************************/ import CrispMessage from "./message"; export { AnimationMessage, AudioMessage, FileMessage, PickerMessage, PickerMessageChoices, FieldMessage } from "./message"; import CrispUser from "./user"; export { CompanyData, CompanyDataEmployment, CompanyDataGeolocation } from "./user"; import CrispTrigger from "./trigger"; import CrispScenario from "./scenario"; import CrispSession from "./session"; export { EventsColors } from "./session"; import CrispChat from "./chat"; import CrispHugo from "./hugo"; export { HugoToolHandler } from "./hugo"; /************************************************************************** * TYPES ***************************************************************************/ declare global { var $crisp: any; var CRISP_WEBSITE_ID: string; var CRISP_TOKEN_ID: string; var CRISP_RUNTIME_CONFIG: any; var CRISP_COOKIE_DOMAIN: string; var CRISP_COOKIE_EXPIRE: number; } export type Options = { clientUrl?: string; autoload?: boolean; tokenId?: string; locale?: string; sessionMerge?: boolean; cookieDomain?: string; cookieExpire?: number; lockMaximized?: boolean; lockFullview?: boolean; disableFullview?: boolean; safeMode?: boolean; }; /************************************************************************** * ENUMERATIONS ***************************************************************************/ export declare enum ChatboxColors { Default = "default", Amber = "amber", Black = "black", Blue = "blue", BlueGrey = "blue_grey", LightBlue = "light_blue", Brown = "brown", Cyan = "cyan", Green = "green", LightGreen = "light_green", Grey = "grey", Indigo = "indigo", Orange = "orange", DeepOrange = "deep_orange", Pink = "pink", Purple = "purple", DeepPurple = "deep_purple", Red = "red", Teal = "teal" } export declare enum ChatboxPosition { Left = "left", Right = "right" } /************************************************************************** * CLASS ***************************************************************************/ /** * Main Crisp SDK class */ declare class Crisp { private clientUrl; private websiteId; private autoload; private tokenId?; private locale?; private sessionMerge?; private cookieDomain?; private cookieExpire?; private lockFullview?; private disableFullview?; private lockMaximized?; private safeMode?; private injected; chat: CrispChat; session: CrispSession; user: CrispUser; message: CrispMessage; trigger: CrispTrigger; scenario: CrispScenario; hugo: CrispHugo; /** * Constructor */ constructor(); /** * Configures the Crisp SDK */ configure(websiteId: string, options?: Options): void; /** * Loads the Crisp client script */ load(): void; /** * Sets the token ID for authentication */ setTokenId(tokenId?: string): void; /** * Sets the z-index of the chat widget */ setZIndex(zIndex: number): void; /** * Sets the color theme of the chat widget */ setColorTheme(color: ChatboxColors): void; /** * Sets whether to hide the widget when operators are away */ setHideOnAway(enabled: boolean): void; /** * Sets whether to hide the widget on mobile devices */ setHideOnMobile(enabled: boolean): void; /** * Sets the position of the chat widget */ setPosition(position: ChatboxPosition): void; /** * Sets whether to show the availability tooltip */ setAvailabilityTooltip(enabled: boolean): void; /** * Sets whether vacation mode is enabled */ setVacationMode(enabled: boolean): void; /** * Sets safe mode for error handling */ setSafeMode(safe?: boolean): void; /** * Mutes or unmutes notification sounds */ muteSound(mute: boolean): void; /** * Toggles the operator count display */ toggleOperatorCount(enabled: boolean): void; /** * Registers a callback for website availability changed event */ onWebsiteAvailabilityChanged(callback: Function): void; /** * Unregisters the website availability changed callback */ offWebsiteAvailabilityChanged(): void; /** * Creates the $crisp singleton if it does not exist */ createSingletonIfNecessary(): void; /** * Auto-injects the Crisp client if not already injected */ autoInjectIfNecessary(): void; /** * Checks if the Crisp client is injected */ isCrispInjected(): boolean; /** * Defers loading until DOM is ready */ private deferredLoading; } /************************************************************************** * EXPORTS ***************************************************************************/ declare const singleton: Crisp; export { singleton as Crisp, Crisp as CrispClass };