xlport
Version:
55 lines • 1.69 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { ReadStream } from 'fs';
import * as Shared from './shared.types';
export declare namespace Export {
type Body = FileBody | UrlBody | TemplateIdBody;
type FileBody = {
template: Buffer | ReadStream;
data: DataWithSheets;
};
const bodyHasFile: (body: Body) => body is FileBody;
type UrlBody = {
templateUrl: string;
data: DataWithSheets;
};
type TemplateIdBody = {
templateId: string;
data: DataWithSheets;
};
type NamedRange = Value;
type Value = Shared.Primitives | ScalarWithOptions;
type ScalarWithOptions = {
data: Shared.Primitives;
format?: string;
indent?: IndentLevel;
};
type IndentLevel = number;
type Table = TableData | TableWithColumnModifications;
type TableData = Record<string, Value>[];
type TableWithColumnModifications = {
columns: ColumnDefinition[];
data: TableData;
};
type SheetName = string;
type ColumnName = string;
type ColumnDefinition = {
name: ColumnName;
fromTemplateColumn: ColumnName;
format?: string;
indent?: IndentLevel;
};
type DataElement = NamedRange | Table;
type DataWithoutSheets = Record<string, any>;
type DataWithSheets = DataWithoutSheets & {
sheets?: Sheet[];
};
type Sheet = {
name: SheetName;
fromTemplateSheet: SheetName;
tabColor?: HexColor;
data: DataWithoutSheets;
};
type HexColor = `#${string}`;
}
//# sourceMappingURL=export.types.d.ts.map