datainout
Version:
Import and reports data
50 lines (47 loc) • 1.39 kB
TypeScript
import { Cell, Style, PaperSize, Location } from 'exceljs';
import { BaseAttribute, SheetExcelOption } from './common-type.js';
/** Excel report template */
type CellReportOptions = {
address: string;
fullAddress: Cell["fullAddress"];
value: {
hardValue?: any;
fieldName?: string;
};
style: Partial<Style>;
isVariable: boolean;
formula?: Cell["formula"];
formatValue?: (data: any) => any;
} & BaseAttribute;
type SheetReportOptions = SheetExcelOption<CellReportOptions> & {
pageSize?: PaperSize;
merges?: Record<string, {
model: Location;
}>;
columnWidths?: (number | undefined)[];
rowHeights: Record<string, number>;
};
type ReportOptions = {
onError?: (data: any) => void;
chunkSize?: number;
useStyle?: boolean;
};
type ReportStreamOptions = {
useStyles?: boolean;
useSharedStrings?: boolean;
workerSize?: number;
sleepTime?: number;
};
declare enum CellReportTypeEnum {
VARIABLE = "VARIABLE",
FORMULA = "FORMULA",
LABEL = "LABEL"
}
type CellReportOptionsV2 = {
value: any;
typeCell: CellReportTypeEnum;
style: Partial<Style>;
address: string;
fullAddress: Cell["fullAddress"];
} & BaseAttribute;
export { type CellReportOptions, type CellReportOptionsV2, CellReportTypeEnum, type ReportOptions, type ReportStreamOptions, type SheetReportOptions };