-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
45 lines (39 loc) · 1.38 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import type ExcelJS from "@tinkie101/exceljs-wrapper";
import type originalPl from "polars";
export type RowData = Record<
string,
string | number | boolean | null | undefined
>;
export type TableStyle = ExcelJS.TableStyleProperties["theme"];
type ExcelSpreadsheetEngine = "exceljs" | "xslx";
type SchemaDict = Record<string, unknown>;
// deno-fmt-ignore
export interface ExtendedDataFrame extends originalPl.DataFrame {
writeExcel: (filePath: string, options?: WriteExcelOptions) => Promise<void>;
withColumn: (columns: originalPl.Series | originalPl.Expr) => ExtendedDataFrame;
withColumns: (...columns: (originalPl.Expr | originalPl.Series)[]) => ExtendedDataFrame;
}
export interface ReadExcelOptions {
sheetId?: number | null;
sheetName?: string[] | [string] | null;
engine?: ExcelSpreadsheetEngine;
engineOptions?: Record<string, unknown>;
readOptions?: Record<string, unknown>;
hasHeader?: boolean;
columns?: number[] | string[] | null;
schemaOverrides?: SchemaDict | null;
inferSchemaLength?: number;
includeFilePaths?: string | null;
dropEmptyRows?: boolean;
dropEmptyCols?: boolean;
raiseIfEmpty?: boolean;
}
export interface WriteExcelOptions {
sheetName?: string | string[];
includeHeader?: boolean;
autofitColumns?: boolean;
tableStyle?: TableStyle;
header?: string;
footer?: string;
withWorkbook?: (workbook: ExcelJS.Workbook) => void;
}