/** * 将Date对象或时间戳转换为指定格式的字符串 * @description 支持多种日期格式输出,包括年月日时分秒、季度、星期等 * @param {Date|number|string} [date=Date.now()] - 日期对象、时间戳或日期字符串 * @param {string} [fmt='yyyy-MM-dd HH:mm:ss'] - 格式化字符串: * - y: 年(1-4位) * - M: 月(1-2位) * - d: 日(1-2位) * - h: 12小时制(1-2位) * - H: 24小时制(1-2位) * - m: 分钟(1-2位) * - s: 秒(1-2位) * - q: 季度(1位) * - S: 毫秒(1-3位) * - E: 星期(1-3位) * @returns {string} 格式化后的日期字符串 * @throws {Error} 当日期参数无效时抛出 * @example * formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss'); * // => '2023-06-15 14:30:45' */ export declare function formatDate(date?: Date | number | string, fmt?: string): string;