`dense` types

This commit is contained in:
SheetJS 2023-09-21 04:12:13 -04:00
parent 766fc4f4d2
commit 248108b667
3 changed files with 15 additions and 7 deletions

View File

@ -2,7 +2,7 @@ function parse_ws_xml_dim(ws/*:Worksheet*/, s/*:string*/) {
var d = safe_decode_range(s);
if(d.s.r<=d.e.r && d.s.c<=d.e.c && d.s.r>=0 && d.s.c>=0) ws["!ref"] = encode_range(d);
}
var mergecregex = /<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g;
var mergecregex = /<(?:\w:)?mergeCell ref=["'][A-Z0-9:]+['"]\s*[\/]?>/g;
var sheetdataregex = /<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/;
var hlinkregex = /<(?:\w:)?hyperlink [^>]*>/mg;
var dimregex = /"(\w*:\w*)"/;

View File

@ -636,10 +636,13 @@ function parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {
case 'help-message': break; // 9.4.6 <table:
case 'error-message': break; // 9.4.7 <table:
case 'database-ranges': break; // 9.4.14 <table:database-ranges>
/* 9.5 Filters */
case 'filter': break; // 9.5.2 <table:filter>
case 'filter-and': break; // 9.5.3 <table:filter-and>
case 'filter-or': break; // 9.5.4 <table:filter-or>
case 'filter-condition': break; // 9.5.5 <table:filter-condition>
case 'filter-set-item': break; // 9.5.6 <table:filter-condition>
case 'list-level-style-bullet': break; // 16.31 <text:
case 'list-level-style-number': break; // 16.32 <text:

17
types/index.d.ts vendored
View File

@ -151,8 +151,13 @@ export interface UTCOption {
UTC?: boolean;
}
export interface DenseOption {
/** If true, generate dense-mode worksheets */
dense?: boolean;
}
/** Options for read and readFile */
export interface ParsingOptions extends UTCOption, CommonOptions {
export interface ParsingOptions extends UTCOption, CommonOptions, DenseOption {
/** Input data encoding */
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
@ -239,9 +244,6 @@ export interface ParsingOptions extends UTCOption, CommonOptions {
/** If true, preserve _xlfn. prefixes in formula function names */
xlfn?: boolean;
/** If true, generate dense-mode worksheets */
dense?: boolean;
/**
* For single-sheet formats (including CSV), override the worksheet name
* @default "Sheet1"
@ -275,6 +277,9 @@ export interface WritingOptions extends CommonOptions {
*/
compression?: boolean;
/** Overwride theme XML when exporting to XLSX/XLSM/XLSB */
themeXLSX?: string;
/**
* Suppress "number stored as text" errors in generated files
* @default true
@ -841,7 +846,7 @@ export interface UTCDateOption {
UTC?: boolean;
}
export interface AOA2SheetOpts extends CommonOptions, UTCDateOption, DateNFOption {
export interface AOA2SheetOpts extends CommonOptions, UTCDateOption, DateNFOption, DenseOption {
/**
* Create cell objects for stub cells
* @default false
@ -851,7 +856,7 @@ export interface AOA2SheetOpts extends CommonOptions, UTCDateOption, DateNFOptio
export interface SheetAOAOpts extends AOA2SheetOpts, OriginOption {}
export interface JSON2SheetOpts extends CommonOptions, UTCDateOption, DateNFOption, OriginOption {
export interface JSON2SheetOpts extends CommonOptions, UTCDateOption, DateNFOption, OriginOption, DenseOption {
/** Use specified column order */
header?: string[];