@sheetxl/io-xlsx 0.8.0-beta.14 → 0.8.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/BQaNticMfvf7-y0L.mjs +2474 -0
  3. package/browser/esm/{DbygDdjktfjoU4DI.mjs → BalqIL4s8nR3NbK8.mjs} +2528 -1702
  4. package/browser/esm/{Bs0IJqyry5ZycCBU.mjs → BiueQ3eVPDOEdEeL.mjs} +1321 -1087
  5. package/browser/esm/{CIRY1QIACITHu_lA.mjs → BtLo1V0gnJ3ktOw9.mjs} +2 -2
  6. package/browser/esm/{QuYxg3ec6kN-djPF.mjs → C3H8HKjSun-wLDrE.mjs} +5 -5
  7. package/browser/esm/{DN7ig6HovGU5gMbr.mjs → CCGqD5BzdZMq2pTI.mjs} +2 -2
  8. package/browser/esm/{BjkdoGjLpkKUlK5q.mjs → DT-3sV5qGuHTFmnB.mjs} +3295 -2163
  9. package/browser/esm/{DiNNY0EgHikWbrDz.mjs → W3dYk6brWDUtMZca.mjs} +3 -3
  10. package/browser/esm/{DAYdoS9sLmYf8kzD.mjs → X5YJn8ZwrgDKMwwO.mjs} +3 -3
  11. package/browser/esm/{Cs4lg7bxClbTkldF.mjs → ekV6d7YNDF6FkKLw.mjs} +423 -318
  12. package/browser/esm/{DKWU_JYjVmtOzTGr.mjs → idgOmd_zpVTKLyek.mjs} +3 -3
  13. package/browser/esm/index.mjs +3 -3
  14. package/node/esm/{TPq4Re0SQgONsX_u.mjs → BO8o53Yo-gLFNELS.mjs} +3 -3
  15. package/node/esm/{CvcAx132Yp5uUDUB.mjs → BT0HKieizRDqDegH.mjs} +440 -330
  16. package/node/esm/BmIrpH_719z1aqvw.mjs +2562 -0
  17. package/node/esm/CJYMs5EGkLOZKyF0.mjs +4676 -0
  18. package/node/esm/{H9egT6kWCw8RAf76.mjs → CZsPzV1CsMPKiICx.mjs} +2 -2
  19. package/node/esm/CdFqKswnjeM_u8-g.mjs +7242 -0
  20. package/node/esm/CnYiZh1EVKY4BNVs.mjs +6851 -0
  21. package/node/esm/{CkenuXqno-ffP331.mjs → OO5K_WYvAj-UV14K.mjs} +3 -3
  22. package/node/esm/index.mjs +5 -5
  23. package/package.json +4 -4
  24. package/types/src/AutoFilterRules.d.ts +26 -4
  25. package/types/src/OOXMLExtensions.d.ts +12 -1
  26. package/types/src/pivot/PivotArea.d.ts +20 -0
  27. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  28. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  29. package/types/src/pivot/PivotFilters.d.ts +29 -0
  30. package/types/src/pivot/PivotFormats.d.ts +60 -0
  31. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  32. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  33. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  34. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  35. package/types/src/reader/PivotButtons.d.ts +14 -0
  36. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  37. package/types/src/reader/SlicerJoin.d.ts +6 -4
  38. package/types/src/reader/_SlicerRecord.d.ts +22 -0
  39. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +5 -0
  40. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -2
  41. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +2 -0
  42. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  43. package/types/src/reader/domVisitors/index.d.ts +2 -0
  44. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  45. package/types/src/writer/builder/Types.d.ts +13 -0
  46. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  47. package/types/src/writer/emitters/SlicerEmitter.d.ts +81 -18
  48. package/types/src/writer/emitters/StylesEmitter.d.ts +32 -1
  49. package/types/src/writer/emitters/WorkbookEmitter.d.ts +19 -2
  50. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  51. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  52. package/browser/esm/Bomb4K5f16UyiyED.mjs +0 -2265
  53. package/node/esm/BCSJ_kqVLXkZlYh3.mjs +0 -5693
  54. package/node/esm/BCXSNXHvNQ9JQMLE.mjs +0 -6367
  55. package/node/esm/BycDf9HTtfpzL-zt.mjs +0 -2346
  56. package/node/esm/CTdvEKRTM-W1L1KU.mjs +0 -4437
  57. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,5 +1,6 @@
1
1
  import { IPivotTable } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext } from '../builder';
3
+ import { PivotStylesWrite } from '../../pivot/PivotFormats';
3
4
  /** The relationship a pivot table has to the cache it summarizes. */
4
5
  export declare const REL_TYPE_PIVOT_CACHE_DEFINITION = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition";
5
6
  /**
@@ -8,6 +9,8 @@ export declare const REL_TYPE_PIVOT_CACHE_DEFINITION = "http://schemas.openxmlfo
8
9
  * {@link writePivotCaches}.
9
10
  */
10
11
  export declare const SHARED_STATE_PIVOT_CACHE_PATHS = "pivotCachePaths";
12
+ /** The `pivotCacheId` the cache with this id was written with, for a pivot slicer's items; `null` if none. */
13
+ export declare const slicerPivotCacheIdOf: (ctx: EmitContext, cacheId: number) => string | null;
11
14
  /**
12
15
  * Writes a sheet's {@link IPivotTable | pivot table} back out as the part it was read from.
13
16
  *
@@ -27,18 +30,44 @@ export declare class PivotTableEmitter extends Emitter<IPivotTable.JSON> {
27
30
  /** @inheritdoc IEmitter.emit */
28
31
  emit(pivotTable: IPivotTable.JSON, ctx: EmitContext): Promise<void>;
29
32
  }
33
+ /**
34
+ * The sheet's pivot rules as written: each rule's key (`IConditionalFormat.JSON.pivotKey`, its
35
+ * priority as read) to the priority it was written with.
36
+ */
37
+ export type PivotConditionalKeys = Map<number, number>;
38
+ /**
39
+ * `xml` with each `<conditionalFormat priority>` of the table restated as the priority its sheet
40
+ * rule was written with, and one whose rule was not written removed.
41
+ *
42
+ * @remarks
43
+ * The table names its conditional formats by the sheet-wide `<cfRule priority>`, and the writer
44
+ * renumbers those 1..N. A table entry that names no pivot rule, or a rule that is not the table's,
45
+ * is a file Excel opens only through repair (`pivot-probes/probe-pivot-cf.ps1`, 2026-10-24).
46
+ */
47
+ export declare const remapConditionalFormats: (xml: string, keys: PivotConditionalKeys) => string;
48
+ /**
49
+ * The save's ids for the formats a pivot part cites: number formats from the styles laid out
50
+ * before any part emits ({@link STYLES_LAYOUT_SHARED_STATE}), differential formats added to the
51
+ * dxfs the worksheets collect.
52
+ */
53
+ export declare const pivotStylesWriteOf: (ctx: EmitContext) => PivotStylesWrite;
30
54
  /** Where the workbook wrote the cache with this id, or `null` if it wrote none. */
31
55
  export declare const cachePathFor: (ctx: EmitContext, cacheId: number) => string | null;
32
56
  /**
33
57
  * Adds the workbook's pivot caches to the package, each with the records part its definition
34
58
  * references, and leaves where each landed in the shared states for the tables to find.
35
59
  *
60
+ * A cache is written as the part it was read from while it has one (it is unchanged since load),
61
+ * its source restated where the engine moved it, and from its model otherwise.
62
+ *
36
63
  * @remarks
37
64
  * Called by `WorkbookEmitter` **before** it schedules the sheets, since a table's relationship to
38
65
  * its cache needs the cache's path to exist by the time the sheet's part emits; the `<pivotCaches>`
39
66
  * element itself is written later, where `CT_Workbook` puts it, from the ids returned here.
67
+ *
68
+ * @param slicerCacheIds The caches pivot slicers index: each is written with a `pivotCacheId`.
40
69
  */
41
- export declare const writePivotCaches: (ctx: EmitContext, pivotCaches: readonly IPivotTable.CacheJSON[] | undefined) => Promise<{
70
+ export declare const writePivotCaches: (ctx: EmitContext, pivotCaches: readonly IPivotTable.CacheJSON[] | undefined, date1904?: boolean, slicerCacheIds?: ReadonlySet<number>) => Promise<{
42
71
  cacheId: number;
43
72
  relId: string;
44
73
  }[]>;
@@ -1,25 +1,38 @@
1
- import { IWorksheet, ISlicer, IWorkbook } from '@sheetxl/sdk';
1
+ import { ISheet, IWorksheet, ISlicer, IWorkbook } from '@sheetxl/sdk';
2
2
  import { Emitter, EmitContext, IXmlWriter } from '../builder';
3
3
  /** The relationship a sheet has to its slicer part. */
4
4
  export declare const REL_TYPE_SLICER = "http://schemas.microsoft.com/office/2007/relationships/slicer";
5
5
  /** The relationship the workbook has to each slicer cache part. */
6
6
  export declare const REL_TYPE_SLICER_CACHE = "http://schemas.microsoft.com/office/2007/relationships/slicerCache";
7
- /** A sheet's slicer part: every table slicer placed on the sheet, in its movable order. */
7
+ /** The relationship a sheet has to its timeline part. */
8
+ export declare const REL_TYPE_TIMELINE = "http://schemas.microsoft.com/office/2011/relationships/timeline";
9
+ /** The relationship the workbook has to each timeline cache part. */
10
+ export declare const REL_TYPE_TIMELINE_CACHE = "http://schemas.microsoft.com/office/2011/relationships/timelineCache";
11
+ /**
12
+ * A sheet's slicer part: the table slicers, the pivot slicers, or the timelines placed on the
13
+ * sheet, in their movable order. Excel cites each kind from its own list, so each has its own part.
14
+ */
8
15
  export interface SlicersPartHandle {
9
16
  sheet: IWorksheet;
10
17
  slicers: ISlicer[];
11
18
  }
19
+ /** A slicer on pivot tables (read from a file): its pivot tables and cache as carried. */
20
+ export declare const pivotOf: (slicer: ISlicer) => ISlicer.PivotJSON | null;
21
+ /** Whether a slicer is a timeline: a slicer on pivot tables whose items are dates. */
22
+ export declare const isTimeline: (slicer: ISlicer) => boolean;
12
23
  /**
13
- * The table slicers placed on a sheet, in movable order: those whose source names a live table.
14
- * A slicer that names none has no column to filter and no cache to write, so it is not written.
24
+ * The slicers placed on a sheet that can be written, in movable order: a table slicer whose
25
+ * source names a live table, and every pivot slicer, which Excel keeps when its pivot tables are
26
+ * gone. A table slicer that names none has no column to filter and no cache to write, so it is not
27
+ * written.
15
28
  */
16
29
  export declare const collectSheetSlicers: (sheet: IWorksheet) => ISlicer[];
17
30
  /**
18
- * Writes a sheet's slicer part, `xl/slicers/slicerN.xml`: one `slicer` per table slicer placed on
19
- * the sheet, as Excel writes them, each naming the cache the workbook writes for it.
31
+ * Writes a sheet's slicer part, `xl/slicers/slicerN.xml`: one `slicer` per slicer of the handle,
32
+ * as Excel writes them, each naming the cache the workbook writes for it.
20
33
  *
21
34
  * @remarks
22
- * Scheduled from `WorksheetEmitter`, which cites the part from the sheet's `x14:slicerList` ext.
35
+ * Scheduled from `WorksheetEmitter`, which cites the part from one of the sheet's slicer-list exts.
23
36
  * Only what differs from a default is written beside the name, cache and caption; the row height
24
37
  * always, in EMU, as Excel does.
25
38
  */
@@ -41,29 +54,79 @@ export declare class SlicerCacheEmitter extends Emitter<ISlicer> {
41
54
  constructor();
42
55
  /** @inheritdoc IEmitter.emit */
43
56
  emit(slicer: ISlicer, ctx: EmitContext): Promise<void>;
57
+ /**
58
+ * A pivot slicer's cache: its pivot tables, then its items. A slicer on worksheet pivot tables
59
+ * writes every item of its field once, in its order, selected as the first pivot table shows it
60
+ * (`pivot-probes/probe-pivot-slicer-edits.ps1`); a data-model slicer's are written as read.
61
+ */
62
+ emitPivot(slicer: ISlicer, pivot: ISlicer.PivotJSON, ctx: EmitContext): void;
44
63
  }
45
64
  /**
46
- * Schedules a cache part for every table slicer of the workbook, in sheet order and then movable
47
- * order, and returns the relationship ids the workbook cites them by and the caches' names.
65
+ * The pivot caches the workbook's slicers on worksheet pivot tables index: each is written with a
66
+ * `pivotCacheId` for the slicer to name it by.
67
+ */
68
+ export declare const pivotSlicerCacheIdsOf: (workbook: IWorkbook) => Set<number>;
69
+ /**
70
+ * Writes a sheet's timeline part, `xl/timelines/timelineN.xml`: one `timeline` per timeline of the
71
+ * handle, its name, cache and caption from the slicer and everything else as read.
72
+ */
73
+ export declare class TimelinesEmitter extends Emitter<SlicersPartHandle> {
74
+ constructor();
75
+ /** @inheritdoc IEmitter.emit */
76
+ emit(handle: SlicersPartHandle, ctx: EmitContext): Promise<void>;
77
+ }
78
+ /**
79
+ * Writes one timeline's cache part, `xl/timelineCaches/timelineCacheN.xml`: its name, source name
80
+ * and pivot tables, then its state as read.
81
+ */
82
+ export declare class TimelineCacheEmitter extends Emitter<ISlicer> {
83
+ constructor();
84
+ /** @inheritdoc IEmitter.emit */
85
+ emit(slicer: ISlicer, ctx: EmitContext): Promise<void>;
86
+ }
87
+ /** Shared-states key under which `WorkbookEmitter` leaves the `sheetId` each sheet is written with. */
88
+ export declare const SHARED_STATE_SHEET_IDS = "sheetIdsBySheet";
89
+ /** The `sheetId` each sheet is written with; a pivot slicer's cache names its pivot table's sheet by it. */
90
+ export declare const sheetIdsOf: (ctx: EmitContext) => Map<ISheet, number>;
91
+ /** The relationships to the slicer caches written, by the list the workbook cites each kind from. */
92
+ export interface SlicerCacheRelIds {
93
+ /** Table slicers' caches, cited from `x15:slicerCaches`. */
94
+ table: string[];
95
+ /** Pivot slicers' caches, cited from `x14:slicerCaches`. */
96
+ pivot: string[];
97
+ /** Timelines' caches, cited from `x15:timelineCacheRefs`. */
98
+ timeline: string[];
99
+ /** The names of the slicer caches written, table and pivot; each needs a workbook name. */
100
+ cacheNames: string[];
101
+ }
102
+ /**
103
+ * Schedules a cache part for every slicer of the workbook, in sheet order and then movable order,
104
+ * and returns the relationship ids the workbook cites them by and the slicer caches' names.
48
105
  *
49
106
  * @remarks
50
107
  * Called by `WorkbookEmitter` **after** the sheets have been written, since a cache names its table
51
- * by the id the sheet minted when it scheduled the table part. A slicer whose table was not
108
+ * by the id the sheet minted when it scheduled the table part. A table slicer whose table was not
52
109
  * scheduled is left out, with its slicer element still in the sheet's part; Excel repairs that
53
110
  * rather than refuse the file.
54
111
  */
55
- export declare const writeSlicerCaches: (ctx: EmitContext, workbook: IWorkbook) => {
56
- relIds: string[];
57
- cacheNames: string[];
58
- };
112
+ export declare const writeSlicerCaches: (ctx: EmitContext, workbook: IWorkbook) => SlicerCacheRelIds;
59
113
  /**
60
- * The sheet's `x15` slicer-list ext: schedules the sheet's slicer part and cites it. Written inside
61
- * the worksheet's `extLst`, after the conditional formats and data validations, where Excel puts it.
114
+ * The sheet's slicer-list exts: schedules a slicer part for the sheet's pivot slicers, one for its
115
+ * table slicers and a timeline part for its timelines, and cites each from the list Excel reads it
116
+ * from: pivot slicers from the `x14` list, table slicers from the `x15` one, timelines from
117
+ * `x15:timelineRefs`. Written inside the worksheet's `extLst`, after the conditional formats and
118
+ * data validations, where Excel puts them.
62
119
  */
63
120
  export declare const writeSlicerListExt: (ctx: EmitContext, xml: IXmlWriter, handle: SlicersPartHandle) => void;
121
+ /** The workbook's `x15:timelineCacheRefs` ext: one `x15:timelineCacheRef` per timeline cache written. */
122
+ export declare const writeTimelineCacheRefsExt: (xml: IXmlWriter, relIds: readonly string[]) => void;
123
+ /**
124
+ * The workbook's `x14:slicerCaches` ext: one `x14:slicerCache` per pivot slicer cache written.
125
+ */
126
+ export declare const writePivotSlicerCachesExt: (xml: IXmlWriter, relIds: readonly string[]) => void;
64
127
  /**
65
- * The workbook's `x15:slicerCaches` ext: one `x14:slicerCache` per cache part written. Written
66
- * inside the workbook's `extLst`, before the calc features, where Excel puts it.
128
+ * The workbook's `x15:slicerCaches` ext: one `x14:slicerCache` per table slicer cache written.
129
+ * Written inside the workbook's `extLst`, before the calc features, where Excel puts it.
67
130
  */
68
131
  export declare const writeSlicerCachesExt: (xml: IXmlWriter, relIds: readonly string[]) => void;
69
132
  //# sourceMappingURL=SlicerEmitter.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ICellStyle, ITheme, IStyleCollection } from '@sheetxl/sdk';
1
+ import { ICellStyle, IFill, ITheme, IStyleCollection, IFontStyle, IBorders } from '@sheetxl/sdk';
2
2
  import { Emitter, IXmlWriter, EmitContext } from '../builder';
3
3
  /**
4
4
  * Emits the styles.xml part.
@@ -8,6 +8,25 @@ export declare class StylesEmitter extends Emitter<ModelHandle> {
8
8
  /** @inheritdoc IEmitter.emit */
9
9
  emit(handle: ModelHandle, ctx: EmitContext): Promise<void>;
10
10
  }
11
+ /** Shared-states key under which `WorkbookEmitter` leaves the save's {@link StylesLayout}. */
12
+ export declare const STYLES_LAYOUT_SHARED_STATE = "stylesLayout";
13
+ /**
14
+ * The save's styles as the styles part writes them: the direct xfs and the indexes into its
15
+ * fonts, fills, borders and number formats. Laid out once, before any part that cites a number
16
+ * format by id, so that id is final when that part is written.
17
+ */
18
+ export interface StylesLayout {
19
+ readonly styles: IStyleCollection;
20
+ readonly directXfs: ICellStyle.JSON[];
21
+ readonly denormalized: DenormalizedStyles;
22
+ }
23
+ /** Lays out the save's styles ({@link StylesLayout}). */
24
+ export declare const layOutStyles: (styles: IStyleCollection, json: IStyleCollection.JSON) => StylesLayout;
25
+ /**
26
+ * The `numFmtId` a number format is written with: a built-in's own id, or the custom id this
27
+ * save gives its code, added to the styles part's `<numFmts>` when no cell uses it.
28
+ */
29
+ export declare const numFmtIdOf: (layout: StylesLayout, format: string | number) => number;
11
30
  /** The namespace of the feature property bags and the xf complement. */
12
31
  export declare const NS_FEATURE_PROPERTY_BAG = "http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag";
13
32
  /**
@@ -21,6 +40,18 @@ export declare const NS_FEATURE_PROPERTY_BAG = "http://schemas.microsoft.com/off
21
40
  * @returns `numFmtId`, advanced if this dxf consumed one.
22
41
  */
23
42
  export declare function writeDxf(ctx: EmitContext, xml: IXmlWriter, dxf: ICellStyle.Properties, styles: IStyleCollection, theme: ITheme, tag?: string, numFmtId?: number): number;
43
+ export interface DenormalizedStyles {
44
+ fontMap: Map<string, string>;
45
+ fonts: IFontStyle.Properties[];
46
+ fillMap: Map<string, string>;
47
+ fills: (IFill.NoneProperties | IFill.SolidProperties | IFill.PatternProperties | IFill.GradientProperties)[];
48
+ borderMap: Map<string, string>;
49
+ borders: IBorders.Properties[];
50
+ numFmtMap: Map<string | number, string>;
51
+ numFmtsCustom: string[];
52
+ namedStyleMap: Map<string, string>;
53
+ namedStyles: ICellStyle.NamedJSON[];
54
+ }
24
55
  type ModelHandle = {
25
56
  json: IStyleCollection.JSON;
26
57
  styles: IStyleCollection;
@@ -9,8 +9,25 @@ export declare class WorkbookEmitter extends Emitter<IWorkbook> {
9
9
  export declare const SHARED_STATE_FILE_VERSION = "fileVersion";
10
10
  /** Shared-states key under which `XLSXWriter` leaves the source's `calcPr@calcId`, verbatim. */
11
11
  export declare const SHARED_STATE_CALC_ID = "calcId";
12
- /** Shared-states key under which `XLSXWriter` leaves the source's `xcalcf:calcFeatures` `<ext>`, verbatim. */
13
- export declare const SHARED_STATE_CALC_FEATURES = "calcFeatures";
12
+ /** One `<ext>` of the source workbook's `<extLst>`, as `XLSXWriter` reads it from the retained bytes. */
13
+ export interface SourceWorkbookExt {
14
+ /** The `uri` attribute, as written. */
15
+ readonly uri: string;
16
+ /** The whole `<ext>` element, verbatim. */
17
+ readonly xml: string;
18
+ /**
19
+ * The source relationship behind each `r:id` the element cites, once per id. `target` is the
20
+ * resolved part path (or URL, when `external`), `null` when the source's rels do not define the id.
21
+ */
22
+ readonly rels: readonly {
23
+ id: string;
24
+ type: string;
25
+ target: string | null;
26
+ external: boolean;
27
+ }[];
28
+ }
29
+ /** Shared-states key under which `XLSXWriter` leaves the source's workbook `<ext>` elements, as {@link SourceWorkbookExt}s. */
30
+ export declare const SHARED_STATE_WORKBOOK_EXTS = "workbookExts";
14
31
  /**
15
32
  * Shared-states key under which `XLSXWriter` leaves the source package's worksheet part path per
16
33
  * `sheetId`. See {@link resolveSheetPaths}.
@@ -0,0 +1,6 @@
1
+ import { EmitContext } from '../builder/Types';
2
+ /** Leaves the workbook's date system for every part written after it ({@link date1904Of}). */
3
+ export declare const setDate1904: (ctx: EmitContext, date1904: boolean) => void;
4
+ /** Whether the workbook being written counts dates from 1904, for a part that writes a serial. */
5
+ export declare const date1904Of: (ctx: EmitContext) => boolean;
6
+ //# sourceMappingURL=DateSystem.d.ts.map
@@ -0,0 +1,61 @@
1
+ import { ICellStyle, IStyleCollection } from '@sheetxl/sdk';
2
+ export declare const XF_VARIANTS_SHARED_STATE = "xfVariants";
3
+ /**
4
+ * The cell xfs written as twins of a direct style, carrying what the model keeps somewhere other
5
+ * than the style:
6
+ *
7
+ * - `hidden="1"`, for sheets whose protection hides formulas. xlsx has no sheet-level form of
8
+ * `IWorksheetProtection.showFormulas: false`; Excel only hides a formula whose format says
9
+ * `hidden="1"`. So a sheet that hides formulas writes every format it uses as a hidden twin,
10
+ * unless the format itself grants `showFormulas`.
11
+ * - `pivotButton="1"`, for the cells a pivot table shows a field button on. The button is the
12
+ * table's (`IPivotTable.JSON.buttons`), not the format's.
13
+ * - what a pivot table's definition gives a cell (`IPivotTable.getStyleAt`): a row label set left
14
+ * and indented by its level, a data field's or a field's number format, and the formats a user
15
+ * put on the table (`IPivotTable.JSON.formats`). Excel reads them from the cell's format; the
16
+ * model derives them from the table's definition. The cell's own format wins where it sets them,
17
+ * as it does in the model.
18
+ *
19
+ * Twins are appended after the direct styles and shared by every sheet that asks for one.
20
+ * `cellXfs[0]` is never changed in place: it is workbook-wide, and each twin is per sheet or per
21
+ * cell.
22
+ *
23
+ * Worksheets allocate while they emit; `StylesEmitter` writes the twins afterwards.
24
+ */
25
+ export declare class XfVariants {
26
+ private _json;
27
+ private _styles;
28
+ /** The cellXfs written for the direct styles; the twins start here. */
29
+ private _directCount;
30
+ /** Twin by xf, flags, label indent, number format and user format. */
31
+ private _variants;
32
+ /** A user format's key, by the object a table answered with. */
33
+ private _userKeys;
34
+ private _sources;
35
+ private _shown;
36
+ constructor(json: IStyleCollection.JSON | undefined, styles: IStyleCollection);
37
+ /**
38
+ * The xf to write in place of `xf`.
39
+ *
40
+ * @param hidden The sheet hides formulas.
41
+ * @param pivotButton The cell shows a pivot table's field button.
42
+ * @param labelIndent The cell is a pivot table's row label, indented by this many characters.
43
+ * @param numberFormat The number format a pivot table gives the cell.
44
+ * @param user The style the formats a user put on a pivot table give the cell.
45
+ */
46
+ getXf(xf: number, hidden: boolean, pivotButton: boolean, labelIndent?: number | null, numberFormat?: string | null, user?: ICellStyle.Properties | null): number;
47
+ /** The direct xf behind each twin and its flags, in twin order. */
48
+ getSources(): readonly XfVariants.Source[];
49
+ private _isShown;
50
+ }
51
+ export declare namespace XfVariants {
52
+ interface Source {
53
+ xf: number;
54
+ hidden: boolean;
55
+ pivotButton: boolean;
56
+ labelIndent: number | null;
57
+ numberFormat: string | null;
58
+ user: ICellStyle.Properties | null;
59
+ }
60
+ }
61
+ //# sourceMappingURL=XfVariants.d.ts.map