@helping-desk/web-sdk
Version:
Web SDK for Helping Desk - Ticket creation and support widget integration
74 lines (73 loc) • 1.55 kB
TypeScript
/**
* Support Widget Component
*
* A floating support widget that provides ticket creation functionality
*/
export interface WidgetConfig {
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
primaryColor?: string;
bubbleIcon?: string;
}
export declare class ChatBubbleWidget {
private container;
private bubble;
private widget;
private isOpen;
private config;
private onCreateTicket;
private stylesInjected;
constructor(config: WidgetConfig, onCreateTicket: (data: {
title: string;
description: string;
priority: string;
category: string;
}) => Promise<any>);
/**
* Initialize and inject the widget into the page
*/
init(): void;
/**
* Inject CSS styles into the page
*/
private injectStyles;
/**
* Get CSS styles for the widget
*/
private getStyles;
/**
* Create the widget DOM structure
*/
private createWidget;
/**
* Get widget HTML structure
*/
private getWidgetHTML;
/**
* Get ticket form HTML
*/
private getTicketFormHTML;
/**
* Attach event listeners
*/
private attachEventListeners;
/**
* Toggle widget open/close
*/
private toggleWidget;
/**
* Open widget
*/
private openWidget;
/**
* Close widget
*/
private closeWidget;
/**
* Handle form submission
*/
private handleFormSubmit;
/**
* Destroy the widget
*/
destroy(): void;
}