UNPKG

koishi-plugin-toram

Version:
26 lines (25 loc) 912 B
import xlsx, { type WorkSheet } from 'xlsx'; import { Completer } from './completer'; /** Excel表格管理器,用于读取Excel表格数据 */ export declare class ExcelMgr { /** 单例模式 */ private static _instance; /** 获取单例 */ static get Inst(): ExcelMgr; /** 工作簿映射 */ private _map; /** 工作簿文件夹路径 */ private _pathWay; /** 私有构造函数 */ private constructor(); loaded: Completer<void>; /** 读取Excel表格 */ private loadExcel; /** 获取工作簿 */ getWB(name: string): xlsx.WorkBook; /** 获取工作表 */ getWS(wbName: string, wsName: string): xlsx.WorkSheet; /** 获取工作表内容,转为ExcelObj */ getRowsAsObjs<T extends object, C extends new (...args: any[]) => any>(ws: WorkSheet, Cls: C): T[]; } export declare function getExcelValue(v: string, keyType: string): any;