@restnfeel/agentc-starter-kit
Version:
한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템
45 lines • 1.51 kB
TypeScript
/**
* @fileoverview Utility functions for the RAG chatbot system
* @module utils
*
* This module provides common utility functions used across the
* RAG chatbot system.
*/
import type { ChatbotError } from "../core/contexts/ChatbotContext";
/**
* Creates a standardized ChatbotError object
*/
export declare const createChatbotError: (code: string, message: string, details?: any) => ChatbotError;
/**
* Formats a file size in bytes to a human-readable string
*/
export declare const formatFileSize: (bytes: number) => string;
/**
* Generates a unique ID for chatbot entities
*/
export declare const generateId: (prefix?: string) => string;
/**
* Debounces a function call
*/
export declare const debounce: <T extends (...args: any[]) => any>(func: T, wait: number) => ((...args: Parameters<T>) => void);
/**
* Throttles a function call
*/
export declare const throttle: <T extends (...args: any[]) => any>(func: T, limit: number) => ((...args: Parameters<T>) => void);
/**
* Validates an email address
*/
export declare const isValidEmail: (email: string) => boolean;
/**
* Truncates text to a specified length
*/
export declare const truncateText: (text: string, maxLength: number) => string;
/**
* Safely parses JSON with error handling
*/
export declare const safeJsonParse: <T = any>(jsonString: string) => T | null;
/**
* Formats a timestamp to a relative time string
*/
export declare const formatRelativeTime: (timestamp: Date) => string;
//# sourceMappingURL=index.d.ts.map