/** * @license * Copyright 2023 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ import type { ChatbotPlugin } from '../core/types.js'; import { ChatPluginBase } from './chat-plugin.js'; /** * Print job data interface */ export interface PrintJobData { jobId: string; documentName: string; printerName: string; status: 'queued' | 'printing' | 'completed' | 'paused' | 'error' | 'cancelled'; pagesPrinted?: number; totalPages: number; copies?: number; userName?: string; submittedAt: string; completedAt?: string; priority?: 'low' | 'normal' | 'high'; colorMode?: 'color' | 'grayscale'; paperSize?: string; estimatedTime?: string; errorMessage?: string; } /** * Print Job Card Plugin - transforms print job status into visual cards * * This plugin detects print job information in messages and renders them as styled status cards. * * @example Basic usage * ```typescript * const printJobPlugin = new PrintJobCardPlugin(); * controller.registerPlugin(printJobPlugin); * ``` * * @example JSON format in message * ```json * { * "jobId": "PRT-2024-1234", * "documentName": "Q4_Financial_Report.pdf", * "printerName": "HP LaserJet Pro MFP M428", * "status": "printing", * "pagesPrinted": 15, * "totalPages": 45, * "copies": 3, * "userName": "John Doe", * "submittedAt": "2024-10-28T14:30:00Z", * "priority": "high", * "colorMode": "color", * "paperSize": "A4", * "estimatedTime": "5 min" * } * ``` */ export declare class PrintJobCardPlugin extends ChatPluginBase implements ChatbotPlugin { readonly id = "print-job-card"; readonly name = "Print Job Card Plugin"; readonly version = "1.0.0"; readonly htmlTags: { name: string; open: string; close: string; }[]; protected cssPrefix: string; /** * Render a skeleton placeholder while the print job data is loading */ renderHtmlBlockPlaceholder?(name: string): string; onInit(): void; /** * Render a completed [PRINTJOB]...[/PRINTJOB] block */ renderHtmlBlock(name: string, content: string): string; /** * Render the complete print job card */ protected renderPrintJobCard(data: PrintJobData): string; /** * Get status color for styling */ protected getStatusColor(status: string): string; /** * Get status icon */ protected getStatusIcon(status: string): string; /** * Format status text */ protected formatStatus(status: string): string; /** * Capitalize first letter */ protected capitalize(text: string): string; /** * Format timestamp */ protected formatTimestamp(timestamp: string): string; /** * Escape HTML to prevent XSS */ protected escapeHtml(text: string): string; /** * Get styles for the print job card */ protected getStyles(): string; } //# sourceMappingURL=print-job-card-plugin.d.ts.map