@agentman/chat-widget
Version:
Agentman Chat Widget for easy integration with web applications
80 lines (79 loc) • 1.78 kB
TypeScript
import type { Message } from '../types/types';
import { UIManager } from '../components/UIManager';
export interface AttachmentHandlerConfig {
features?: {
attachments?: boolean;
};
maxFileSize?: number;
maxAttachments?: number;
acceptedFileTypes?: string[];
debug?: boolean | import('../types/types').DebugConfig;
}
/**
* Simplified AttachmentHandler that demonstrates the pattern
* without depending on the full FileUploadManager API
*/
export declare class AttachmentHandlerSimple {
private config;
private uiManager;
private logger;
private fileInput;
private attachedFiles;
constructor(config: AttachmentHandlerConfig, uiManager: UIManager);
/**
* Initialize hidden file input
*/
private initializeFileInput;
/**
* Handle attachment button click
*/
handleAttachmentClick(): void;
/**
* Handle file selection
*/
handleFileSelect(files: FileList): void;
/**
* Get attached files
*/
getAttachedFiles(): File[];
/**
* Clear attachments
*/
clearAttachments(): void;
/**
* Update attachment preview UI
*/
updateAttachmentPreview(): void;
/**
* Remove file by index
*/
private removeFile;
/**
* Render attachments in a message
*/
renderMessageAttachments(message: Message): string;
/**
* Get file type category
*/
private getFileType;
/**
* Get attachment icon
*/
private getAttachmentIcon;
/**
* Format file size
*/
private formatFileSize;
/**
* Escape HTML
*/
private escapeHtml;
/**
* Show error message
*/
private showError;
/**
* Clean up resources
*/
destroy(): void;
}