import './styles/widget.css'; import type { ChatgramConfig, ChatgramTheme, ChatgramEventMap, ChatgramEventHandler } from './core/types'; import { ChatgramError } from './core/types'; export type { ChatgramConfig, ChatgramTheme, ChatgramTexts, TicketType, TicketPayload, TicketResponse, WidgetState, ChatgramErrorCode, ChatgramEventMap, ChatgramEventHandler, } from './core/types'; export { ChatgramError } from './core/types'; /** * Initializes the Chatgram widget. * * @param config - Configuration object. * * @example * init({ * theme: { primaryColor: '#EE6055' }, * onSuccess: (data) => console.log('Ticket:', data), * }); */ export declare function init(config: ChatgramConfig): void; /** * Opens the contact form modal. * @throws {ChatgramError} if init() has not been called */ export declare function open(): void; /** * Closes the contact form modal. */ export declare function close(): void; /** * Removes the widget entirely from the DOM. * Call init() again to re-mount. */ export declare function destroy(): void; /** * Updates the widget theme at runtime. * * @example * updateTheme({ primaryColor: '#6366f1', secondaryColor: '#4f46e5' }); */ export declare function updateTheme(theme: ChatgramTheme): void; /** * Subscribe to widget events. * * @example * on('success', (data) => console.log('Ticket:', data.ticketId)); * on('error', (err) => console.error(err.code, err.message)); * on('open', () => analytics.track('widget_opened')); */ export declare function on(event: K, handler: ChatgramEventHandler): void; /** * Unsubscribe from a widget event. */ export declare function off(event: K, handler: ChatgramEventHandler): void; /** * Subscribe to a widget event once (auto-removes after first call). */ export declare function once(event: K, handler: ChatgramEventHandler): void; /** * Returns whether the modal is currently visible. */ export declare function isOpen(): boolean; /** * Returns the current widget state. */ export declare function getState(): string; /** * Returns the widget version. */ export declare function getVersion(): string; declare const _default: { init: typeof init; open: typeof open; close: typeof close; destroy: typeof destroy; updateTheme: typeof updateTheme; on: typeof on; off: typeof off; once: typeof once; isOpen: typeof isOpen; getState: typeof getState; getVersion: typeof getVersion; ChatgramError: typeof ChatgramError; }; export default _default;