UNPKG

starchild-widget

Version:

Starchild Widget

99 lines 2.58 kB
import { WidgetConfig, Position, Locale, ThemeMode, ComponentType, AuthCredentials } from '../types'; export declare class StarChildWidget { private root; private container; private config; private mounted; private static instance; private internalConfig; constructor(config: WidgetConfig); /** * Initialize and mount Widget */ private init; /** * Destroy Widget */ destroy(): void; /** * Update configuration */ updateConfig(newConfig: Partial<WidgetConfig>): void; /** * Get current configuration with real-time state from store */ getConfig(): WidgetConfig; /** * Check if initialized */ isInitialized(): boolean; /** * Get current singleton instance */ static getInstance(): StarChildWidget | null; /** * Check if instance exists */ static hasInstance(): boolean; /** * Configure chat component */ configureChatState(config: { visible?: boolean; position?: Position; disabled?: boolean; }): void; /** * Configure search component */ configureSearchState(config: { visible?: boolean; disabled?: boolean; value?: string; placeholder?: string; }): void; /** * Configure common components (theme, language, environment, etc.) */ configureCommonState(config: { themeMode?: ThemeMode; locale?: Locale; environment?: 'testnet' | 'mainnet'; }): void; /** * Configure authentication credentials */ configureAuthState(config: Partial<AuthCredentials>): void; /** * Show chat modal directly * @param containerId - Optional container element ID to render the modal into */ showChatModal(containerId?: string): void; /** * Reset component position to default * @param componentType - Component type to reset (currently only supports CHAT) */ resetPosition(componentType: ComponentType): void; /** * Render components */ private render; } /** * Convenient method to initialize Widget */ export declare const init: (config: WidgetConfig) => StarChildWidget; /** * Get global Widget instance */ export declare const getInstance: () => StarChildWidget | null; /** * Destroy global Widget instance */ export declare const destroy: () => void; export type * from '../types'; declare const _default: { StarChildWidget: typeof StarChildWidget; }; export default _default; //# sourceMappingURL=index.d.ts.map