@sparta-utils/excel-validate-helper
Version:
Excel 读取、校验、错误标注和导出工具库
28 lines (27 loc) • 781 B
TypeScript
import ExcelJS from 'exceljs';
export type ErrorLevel = 'error' | 'warning' | 'info';
export interface CellError {
row: number;
col: number;
reason?: string;
level?: ErrorLevel;
sheetName?: string;
}
export interface CellStyle {
font?: Partial<ExcelJS.Font>;
alignment?: Partial<ExcelJS.Alignment>;
fill?: Partial<ExcelJS.Fill>;
border?: Partial<ExcelJS.Borders>;
}
export interface MarkerOptions {
style?: CellStyle;
defaultNote?: string;
outputType?: 'note' | 'column' | 'both';
sheetName?: string;
errorColumnTitle?: string;
allowMultiSheet?: boolean;
errorColumnIndex?: number;
}
export declare class ExcelMarker {
static markErrors(file: File, errors: CellError[], options?: MarkerOptions): Promise<Blob>;
}