@xlsx-editor.dev/core 0.0.0-placeholder.0 → 0.1.0-beta.0

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 (55) hide show
  1. package/LICENSE +217 -0
  2. package/README.md +254 -2
  3. package/THIRD_PARTY_NOTICES.md +78 -0
  4. package/dist/automation.d.ts +299 -0
  5. package/dist/automation.js +42 -0
  6. package/dist/builtins-nmHrq2Et.d.ts +37 -0
  7. package/dist/cascade.d.ts +196 -0
  8. package/dist/cascade.js +60 -0
  9. package/dist/cell-format-DW8yF-c-.d.ts +226 -0
  10. package/dist/chunk-2DLJYRJC.js +3171 -0
  11. package/dist/chunk-2ZU4337U.js +204 -0
  12. package/dist/chunk-44L37ENZ.js +8219 -0
  13. package/dist/chunk-77N55BLP.js +911 -0
  14. package/dist/chunk-7PV5HQPE.js +84 -0
  15. package/dist/chunk-E4VJJ556.js +756 -0
  16. package/dist/chunk-KG4IL4JI.js +436 -0
  17. package/dist/chunk-PLDK4XO6.js +9125 -0
  18. package/dist/chunk-PRHLYXHL.js +1699 -0
  19. package/dist/chunk-TE4FXG5T.js +3156 -0
  20. package/dist/contracts.d.ts +32 -0
  21. package/dist/contracts.js +0 -0
  22. package/dist/dist-C7NLNUMD.js +2850 -0
  23. package/dist/editor.d.ts +3167 -0
  24. package/dist/editor.js +309 -0
  25. package/dist/harfbuzz-measurer-CkKfsEyu.d.ts +128 -0
  26. package/dist/harfbuzz.wasm +0 -0
  27. package/dist/index.d.ts +11 -0
  28. package/dist/index.js +309 -0
  29. package/dist/layout.d.ts +111 -0
  30. package/dist/layout.js +104 -0
  31. package/dist/merge-commands-DthcNpfw.d.ts +53 -0
  32. package/dist/node-module-shim-LQXGL47O.js +18 -0
  33. package/dist/ops-CfUCjyph.d.ts +629 -0
  34. package/dist/output.d.ts +177 -0
  35. package/dist/output.js +29 -0
  36. package/dist/sheet-index-P5vevMWX.d.ts +52 -0
  37. package/dist/sheet-layout-D9M_4EBn.d.ts +494 -0
  38. package/dist/sheet-protection-D8goxm58.d.ts +209 -0
  39. package/dist/store.d.ts +615 -0
  40. package/dist/store.js +272 -0
  41. package/dist/theme-BprDji6x.d.ts +16 -0
  42. package/dist/units-D6CD_A5I.d.ts +13 -0
  43. package/dist/workbook-index-DsbeR8Kb.d.ts +294 -0
  44. package/licenses/Emscripten-LICENSE.txt +102 -0
  45. package/licenses/HarfBuzz-COPYING.txt +42 -0
  46. package/licenses/HarfBuzz-USE-MIT.txt +21 -0
  47. package/licenses/HarfBuzz-source-notices.txt +4508 -0
  48. package/licenses/README.md +19 -0
  49. package/licenses/Unicode-LICENSE.txt +39 -0
  50. package/licenses/compiler-rt-LICENSE.txt +311 -0
  51. package/licenses/harfbuzz-manifest.json +84 -0
  52. package/licenses/musl-COPYRIGHT.txt +193 -0
  53. package/package.json +79 -6
  54. package/src/styles/editor.css +1933 -0
  55. package/src/styles/editor.css.d.ts +2 -0
@@ -0,0 +1,494 @@
1
+ import { E as Element, X as XlsxPackage, W as WorkbookIndex } from './workbook-index-DsbeR8Kb.js';
2
+ import { j as ResolvedFont, a as Rgb, h as ResolvedAlignment, b as ResolvedFill, i as ResolvedBorder, c as CascadeProblem } from './cell-format-DW8yF-c-.js';
3
+ import { N as NumberLocale } from './builtins-nmHrq2Et.js';
4
+ import { S as SheetIndex } from './sheet-index-P5vevMWX.js';
5
+ import { d as ResolvedFace, T as TextMeasurer, a as FaceMetrics } from './harfbuzz-measurer-CkKfsEyu.js';
6
+ import { W as WorkbookTheme } from './theme-BprDji6x.js';
7
+
8
+ /** A resolved color: sRGB 0–255 integers and alpha 0–1. */
9
+ interface Rgba {
10
+ readonly r: number;
11
+ readonly g: number;
12
+ readonly b: number;
13
+ readonly a: number;
14
+ }
15
+
16
+ /** One evaluated path command, absolute shape-local EMU. Arcs are already cubic Béziers. */
17
+ type PathCommand = {
18
+ readonly op: 'M' | 'L';
19
+ readonly x: number;
20
+ readonly y: number;
21
+ } | {
22
+ readonly op: 'C';
23
+ readonly x1: number;
24
+ readonly y1: number;
25
+ readonly x2: number;
26
+ readonly y2: number;
27
+ readonly x: number;
28
+ readonly y: number;
29
+ } | {
30
+ readonly op: 'Q';
31
+ readonly x1: number;
32
+ readonly y1: number;
33
+ readonly x: number;
34
+ readonly y: number;
35
+ } | {
36
+ readonly op: 'Z';
37
+ };
38
+ /** One evaluated path with its fill mode and stroke flag. */
39
+ interface GeometryPath {
40
+ readonly commands: readonly PathCommand[];
41
+ readonly fill: 'none' | 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'darkenLess';
42
+ readonly stroke: boolean;
43
+ }
44
+ /** Evaluated geometry: paths and the text rectangle (shape-local EMU). */
45
+ interface EvaluatedGeometry {
46
+ readonly paths: readonly GeometryPath[];
47
+ readonly textRect: {
48
+ readonly l: number;
49
+ readonly t: number;
50
+ readonly r: number;
51
+ readonly b: number;
52
+ };
53
+ /** True when the preset name is unknown and a rectangle was substituted. */
54
+ readonly unknownPreset?: string;
55
+ }
56
+
57
+ /** A run of indexes with one size. Indexes are 0-based and inclusive. */
58
+ interface AxisSegment {
59
+ readonly first: number;
60
+ readonly last: number;
61
+ /** Size in points. 0 for a hidden row or column. */
62
+ readonly size: number;
63
+ }
64
+ declare class AxisIndex {
65
+ /** The number of indexes on the axis: 1048576 rows or 16384 columns. */
66
+ readonly count: number;
67
+ readonly defaultSize: number;
68
+ private readonly segments;
69
+ /** The offset of each segment's first index. */
70
+ private readonly starts;
71
+ /**
72
+ * `segments` may arrive in any order. Where two overlap, the one that starts first keeps
73
+ * the shared indexes (and, for equal starts, the one given first); the other is clipped.
74
+ */
75
+ constructor(count: number, defaultSize: number, segments: readonly AxisSegment[]);
76
+ /** The index of the last segment whose first index is at most `i`, or -1. */
77
+ private segmentAt;
78
+ /** The size of index `i`, in points. */
79
+ sizeOf(i: number): number;
80
+ /** The offset of the start of index `i` from the start of the axis, in points. */
81
+ offsetOf(i: number): number;
82
+ /** The length of the whole axis, in points. */
83
+ get total(): number;
84
+ /**
85
+ * The index that holds `offset`: the last index whose start is at most `offset`, skipping
86
+ * indexes of size 0. Offsets before the axis give 0, and offsets past it give the last index.
87
+ */
88
+ indexAt(offset: number): number;
89
+ /** The first index at or after `i` with a size above 0, or `i` when there is none. */
90
+ private firstVisibleFrom;
91
+ }
92
+
93
+ /** The facts of the default font and the pixel grid that geometry needs. */
94
+ interface GridMetrics {
95
+ /** The maximum digit width of the default font, in whole pixels. */
96
+ readonly maxDigitWidth: number;
97
+ /** Pixels per inch of the layout grid: 72 in both profiles (metrics.ts). */
98
+ readonly pixelsPerInch: number;
99
+ /** The row height that the default font needs, in points, before `rowScale`. */
100
+ readonly defaultRowHeight: number;
101
+ /** The factor of every row height before it rounds down to whole pixels (`GridProfile`). */
102
+ readonly rowScale: number;
103
+ }
104
+ /** The geometry of one sheet. */
105
+ interface SheetGeometry {
106
+ readonly columns: AxisIndex;
107
+ readonly rows: AxisIndex;
108
+ }
109
+ /** Whole pixels of a column `width` in characters, `x:col/@width` (`CT_Col`, Part 1, 18.3.1.13). */
110
+ declare function columnPixels(width: number, mdw: number): number;
111
+ /**
112
+ * The inverse of `columnPixels`: the smallest width in characters, in steps of 1/256 of a
113
+ * character as `columnPixels` reads them, whose whole pixels are `pixels` (Part 1, 18.3.1.13).
114
+ * `columnPixels(columnWidthForPixels(p, mdw), mdw)` is `p` for every whole `p` up to the widest
115
+ * column of 255 characters, the editor's limit of a column width. Clamped to 0 to 255.
116
+ */
117
+ declare function columnWidthForPixels(pixels: number, mdw: number): number;
118
+ /**
119
+ * The inverse of the row snap of `sheetGeometry`: a row height in points, to 1/100 of a point,
120
+ * whose height on the layout grid is `pixels` whole pixels. Clamped to 0 to 409, the editor's
121
+ * limit of a row height (`MAX_ROW_HEIGHT` of the store).
122
+ */
123
+ declare function rowHeightForPixels(pixels: number, metrics: Pick<GridMetrics, 'pixelsPerInch' | 'rowScale'>): number;
124
+ /**
125
+ * The width in characters of a default column of `base` characters,
126
+ * `x:sheetFormatPr/@baseColWidth` (`CT_SheetFormatPr`, Part 1, 18.3.1.81). The width formula is
127
+ * the one of Part 1, 18.3.1.13, with the measured padding of `columnPadding`.
128
+ */
129
+ declare function baseColumnWidth(base: number, mdw: number): number;
130
+ /**
131
+ * The height in points of a row without `@ht`, from the fonts and wrapped text of its cells, or
132
+ * undefined for the default row height. `rowIndex` is 0-based, and `columns` is the column axis
133
+ * of the sheet, for the width that wrapped text breaks at. Layout passes one that reads the
134
+ * cell formats (`row-height.ts`).
135
+ */
136
+ type AutoRowHeight = (row: Element, rowIndex: number, columns: AxisIndex) => number | undefined;
137
+ /**
138
+ * The column and row geometry of a worksheet. A row without `@ht` takes `autoHeight` when the
139
+ * sheet's default row height is not custom; the cost is the cells of those rows, which is in
140
+ * proportion to the content of the file.
141
+ */
142
+ declare function sheetGeometry(sheet: SheetIndex, metrics: GridMetrics, autoHeight?: AutoRowHeight): SheetGeometry;
143
+
144
+ /** How a target rounds the grid: its pixel density and the padding of a row. */
145
+ interface GridProfile {
146
+ /** Pixels for each inch of the grid. */
147
+ readonly pixelsPerInch: number;
148
+ /** Pixels that a row without `@ht` adds to the line height of its font. */
149
+ readonly rowPadding: number;
150
+ /** The factor of every row height before it rounds down to whole pixels. */
151
+ readonly rowScale: number;
152
+ }
153
+ /** The printed page of the reference PDFs: the profile that the fidelity harness measures. */
154
+ declare const PRINT_PROFILE: GridProfile;
155
+ /**
156
+ * The screen: rows of the line height plus 2 pixels (15 points for Carlito 11), not scaled. No
157
+ * committed reference shows them: the approximation "Screen geometry".
158
+ */
159
+ declare const SCREEN_PROFILE: GridProfile;
160
+ /**
161
+ * The screen profile at a zoom: 96 CSS pixels to the inch at zoom 1. Grid pixels are CSS
162
+ * pixels, so gridlines stay sharp.
163
+ */
164
+ declare const zoomProfile: (zoom: number) => GridProfile;
165
+ /** The font facts that layout needs, in whole pixels of a profile. */
166
+ interface FontPixels {
167
+ readonly face: ResolvedFace;
168
+ /** The font size in pixels (not rounded). */
169
+ readonly sizePx: number;
170
+ readonly ascent: number;
171
+ readonly descent: number;
172
+ /** `ascent + descent`. */
173
+ readonly lineHeight: number;
174
+ /** The widest digit advance, rounded. */
175
+ readonly maxDigitWidth: number;
176
+ }
177
+ /** The font properties that select a face and its size. */
178
+ type FontKey = Pick<ResolvedFont, 'family' | 'bold' | 'italic' | 'sizePt'>;
179
+ /** Font facts of one font in a profile. Cached for each measurer. */
180
+ declare function fontPixels(measurer: TextMeasurer, font: FontKey, profile: GridProfile): FontPixels;
181
+ /**
182
+ * The width of text in whole pixels: each advance rounds on its own. `advances` are em for each
183
+ * UTF-16 code unit, as the measurer returns them.
184
+ */
185
+ declare function pixelWidth(advances: ArrayLike<number>, sizePx: number): number;
186
+ /**
187
+ * The height in points of a row without `@ht` whose tallest font has these facts, before the
188
+ * row scale of the profile: the height that `@ht` would state.
189
+ */
190
+ declare function autoRowHeight(font: FontPixels, profile: GridProfile): number;
191
+ /** The grid metrics of a workbook in a profile: from its default font. */
192
+ declare function gridMetrics(pkg: XlsxPackage, index: WorkbookIndex, measurer: TextMeasurer, profile: GridProfile): GridMetrics;
193
+
194
+ /** A cell range, 0-based and inclusive. */
195
+ interface CellRange {
196
+ readonly firstRow: number;
197
+ readonly firstCol: number;
198
+ readonly lastRow: number;
199
+ readonly lastCol: number;
200
+ }
201
+ /** Frozen rows and columns: the count of each that stays in place. */
202
+ interface FrozenPanes {
203
+ readonly rows: number;
204
+ readonly cols: number;
205
+ }
206
+ /**
207
+ * The frozen panes of the first `x:sheetView` of a worksheet (`CT_SheetView`), or zero rows and
208
+ * columns.
209
+ */
210
+ declare function frozenPanes(worksheet: Element): FrozenPanes;
211
+ /** A range reference such as `B2:D4`, or a single cell, as a range; undefined when invalid. */
212
+ declare function parseRange(ref: string): CellRange | undefined;
213
+ /** The merged ranges of a worksheet. */
214
+ interface MergeIndex {
215
+ /** Sorted by first row, then first column. */
216
+ readonly ranges: readonly CellRange[];
217
+ /** Merges past {@link MAX_MERGES}, or with a reference that does not parse. */
218
+ readonly dropped: number;
219
+ /** Merges skipped because their top-left cell lies inside an earlier merge. */
220
+ readonly overlapping: number;
221
+ }
222
+ /** The merged ranges of a worksheet root, sorted by first row. Cached per root. */
223
+ declare function mergedRanges(worksheet: Element): MergeIndex;
224
+
225
+ /** A rectangle in points. */
226
+ interface Rect {
227
+ readonly x: number;
228
+ readonly y: number;
229
+ readonly width: number;
230
+ readonly height: number;
231
+ }
232
+ /** One run of cell text with its font. */
233
+ interface TextRunInput {
234
+ readonly text: string;
235
+ readonly font: ResolvedFont;
236
+ /** Spaces of `text` that are as wide as another character (`FormattedValue.pads`). */
237
+ readonly pads?: readonly TextPad[];
238
+ }
239
+ /** A space at `index` of a run's text that is as wide as `char` in the run's font. */
240
+ interface TextPad {
241
+ readonly index: number;
242
+ readonly char: string;
243
+ }
244
+ /** What kind of value the text shows: `general` alignment depends on it. */
245
+ type ValueKind = 'text' | 'number' | 'boolean' | 'error';
246
+ interface CellTextInput {
247
+ readonly runs: readonly TextRunInput[];
248
+ readonly kind: ValueKind;
249
+ /** The kind that `general` alignment follows, when it is not `kind` (`FormattedValue.alignAsText`). */
250
+ readonly alignKind?: ValueKind;
251
+ readonly alignment: ResolvedAlignment;
252
+ /** The cell, merged range, or centered-across span that holds the text. */
253
+ readonly box: Rect;
254
+ /** The color of the number format section, over the font color. */
255
+ readonly color?: Rgb;
256
+ }
257
+ /** What a painter needs to draw a span: the measured face and the font properties. */
258
+ interface TextStyle {
259
+ /** The id of the measured face (`ResolvedFace.id`): paint draws exactly these bytes. */
260
+ readonly faceId: string;
261
+ readonly family: string;
262
+ readonly sizePt: number;
263
+ readonly bold: boolean;
264
+ readonly italic: boolean;
265
+ readonly synthBold: boolean;
266
+ readonly synthItalic: boolean;
267
+ readonly underline: ResolvedFont['underline'];
268
+ readonly strike: boolean;
269
+ readonly color: Rgb;
270
+ /** The metrics of the measured face, in em: paint draws underlines and strikes from them. */
271
+ readonly metrics: FaceMetrics;
272
+ }
273
+ interface TextSpan {
274
+ readonly text: string;
275
+ /** Left edge of the span, in points. */
276
+ readonly x: number;
277
+ readonly width: number;
278
+ /**
279
+ * The left edge of each UTF-16 unit of `text`, in points: whole-pixel advances, as layout
280
+ * measured them, so paint draws each glyph where layout put it.
281
+ */
282
+ readonly positions: readonly number[];
283
+ readonly style: TextStyle;
284
+ }
285
+ interface TextLine {
286
+ readonly x: number;
287
+ readonly baseline: number;
288
+ readonly width: number;
289
+ readonly spans: readonly TextSpan[];
290
+ /** Extra space after each space character, for `justify` and `distributed`. */
291
+ readonly wordSpacing?: number;
292
+ }
293
+ interface CellTextLayout {
294
+ /** In points. With `rotation`, relative to the rotation origin. */
295
+ readonly lines: readonly TextLine[];
296
+ /** Counterclockwise degrees and the point that line coordinates are relative to. */
297
+ readonly rotation?: {
298
+ readonly angle: number;
299
+ readonly originX: number;
300
+ readonly originY: number;
301
+ };
302
+ /** The leftmost and rightmost point that the text covers. */
303
+ readonly left: number;
304
+ readonly right: number;
305
+ /** The text area of the box, in points: where text shows without overflow. */
306
+ readonly areaLeft: number;
307
+ readonly areaRight: number;
308
+ /** One unwrapped, unrotated line of text that may show across empty neighbor cells. */
309
+ readonly mayOverflow: boolean;
310
+ }
311
+ interface TextContext {
312
+ readonly measurer: TextMeasurer;
313
+ readonly profile: GridProfile;
314
+ /** The maximum digit width of the default font, in pixels: the indent unit. */
315
+ readonly maxDigitWidth: number;
316
+ /**
317
+ * The descent of the default font, in pixels. Bottom-aligned text keeps at least this much
318
+ * below its last baseline (text-layout.pdf: Carlito 6 and 8 end 3 points above the bottom of
319
+ * their cells, as Carlito 11 does). Zero when absent.
320
+ */
321
+ readonly minDescent?: number;
322
+ }
323
+ /** Lay out the text of one cell in its box. */
324
+ declare function layoutCellText(input: CellTextInput, ctx: TextContext): CellTextLayout;
325
+
326
+ /** At most this many anchors are read from one drawing part. */
327
+ declare const MAX_ANCHORS = 10000;
328
+ interface DrawingCommon {
329
+ /** The position of the anchor in the drawing part. */
330
+ readonly index: number;
331
+ readonly name: string;
332
+ /** In points, from the top-left corner of the sheet. */
333
+ readonly rect: Rect;
334
+ /** Clockwise degrees (`a:xfrm/@rot`), in [0, 360). */
335
+ readonly rotation: number;
336
+ readonly flipH: boolean;
337
+ readonly flipV: boolean;
338
+ }
339
+ /** A picture: the painter reads the bytes of `partName`, a part of the package. */
340
+ interface PictureLayout extends DrawingCommon {
341
+ readonly kind: 'picture';
342
+ readonly partName: string;
343
+ readonly contentType: string | undefined;
344
+ }
345
+ /** A shape: paths in points relative to the top-left corner of `rect`. */
346
+ interface ShapeLayout extends DrawingCommon {
347
+ readonly kind: 'shape';
348
+ readonly geometry: EvaluatedGeometry;
349
+ readonly fill: Rgba | undefined;
350
+ readonly line: {
351
+ readonly color: Rgba;
352
+ readonly width: number;
353
+ } | undefined;
354
+ }
355
+ /**
356
+ * An object that layout places but does not draw: a group, a chart frame, an external image, or
357
+ * a picture without its image part.
358
+ */
359
+ interface UnsupportedDrawing extends DrawingCommon {
360
+ readonly kind: 'unsupported';
361
+ /**
362
+ * The local name of the object element; `externalImage` for a picture that links an external
363
+ * image, and `missingImage` for a picture whose embed names no image part of the package.
364
+ */
365
+ readonly element: string;
366
+ }
367
+ type DrawingLayout = PictureLayout | ShapeLayout | UnsupportedDrawing;
368
+ /** The drawing part of a worksheet (`x:drawing/@r:id`), or undefined. */
369
+ declare function drawingPartOf(pkg: XlsxPackage, sheetPart: string, worksheet: Element): string | undefined;
370
+ /**
371
+ * The area that a drawing can paint, in the points of its `rect`: the bounding box of the
372
+ * rotated rectangle, grown by half the line width of a shape. A straight connector has a zero
373
+ * width or height; its bounds still have the width of its line.
374
+ */
375
+ declare function drawingBounds(d: DrawingLayout): Rect;
376
+ /**
377
+ * Every drawing of a worksheet, placed on its geometry, in document order (the order paint
378
+ * stacks them). Cached per drawing part revision, geometry, and theme.
379
+ */
380
+ declare function sheetDrawings(pkg: XlsxPackage, drawingPart: string | undefined, geometry: SheetGeometry, theme: WorkbookTheme): readonly DrawingLayout[];
381
+
382
+ /** The visible area, in points, and the scroll position of the scrolling pane. */
383
+ interface Viewport {
384
+ readonly width: number;
385
+ readonly height: number;
386
+ readonly scrollX: number;
387
+ readonly scrollY: number;
388
+ }
389
+ interface LayoutOptions {
390
+ readonly measurer: TextMeasurer;
391
+ /**
392
+ * How the grid rounds: `PRINT_PROFILE` for the printed page of the reference PDFs (the
393
+ * fidelity harness), `SCREEN_PROFILE` for a viewer. Required, so that no caller lays out
394
+ * printed row heights on a screen by accident.
395
+ */
396
+ readonly profile: GridProfile;
397
+ /** `EN_US` when absent. */
398
+ readonly locale?: NumberLocale;
399
+ }
400
+ /** A cell (or merged range) that has a fill or a border to paint. */
401
+ interface CellBox {
402
+ readonly row: number;
403
+ readonly col: number;
404
+ /** In viewport points. */
405
+ readonly rect: Rect;
406
+ readonly fill: ResolvedFill;
407
+ readonly border: ResolvedBorder;
408
+ readonly merge?: CellRange;
409
+ }
410
+ /** The text of one cell, clipped to its cell or to the empty cells it shows across. */
411
+ interface CellTextBox {
412
+ readonly row: number;
413
+ readonly col: number;
414
+ readonly clip: Rect;
415
+ readonly text: CellTextLayout;
416
+ /** A cached formula result that may be out of date. */
417
+ readonly stale: boolean;
418
+ /** The complete text, when `text` holds only the spans that can reach `clip`. */
419
+ readonly shownText?: string;
420
+ }
421
+ interface AxisEntry {
422
+ readonly index: number;
423
+ /** Viewport position and size, in points. */
424
+ readonly start: number;
425
+ readonly size: number;
426
+ }
427
+ interface PaneLayout {
428
+ readonly range: CellRange;
429
+ /** The part of the viewport that the pane paints into. */
430
+ readonly clip: Rect;
431
+ /**
432
+ * Where the top-left corner of the sheet lies in this pane, in viewport points: it moves with
433
+ * the scroll position, so a pattern fill that starts its tile grid here moves with its cells.
434
+ */
435
+ readonly sheetOrigin: {
436
+ readonly x: number;
437
+ readonly y: number;
438
+ };
439
+ readonly columns: readonly AxisEntry[];
440
+ readonly rows: readonly AxisEntry[];
441
+ readonly cells: readonly CellBox[];
442
+ /**
443
+ * The text boxes of the pane. The box of a stale formula with no text to show has no lines,
444
+ * and `PaintStats.texts` counts it with the others.
445
+ */
446
+ readonly texts: readonly CellTextBox[];
447
+ /** Drawings that meet the pane, with `rect` in viewport points. */
448
+ readonly drawings: readonly DrawingLayout[];
449
+ }
450
+ interface LayoutProblem {
451
+ readonly code: CascadeProblem['code'] | 'window-truncated' | 'merges-dropped' | 'merges-overlapping' | 'image-missing'
452
+ /** Conditional formatting rules past `LAYOUT_CHECK_BUDGET` were not evaluated. */
453
+ | 'conditional-budget';
454
+ /** The cell reference, as row and column, where there is one. */
455
+ readonly row?: number;
456
+ readonly col?: number;
457
+ readonly detail?: string;
458
+ }
459
+ interface SheetLayout {
460
+ readonly sheet: string;
461
+ readonly metrics: GridMetrics;
462
+ readonly geometry: SheetGeometry;
463
+ readonly frozen: FrozenPanes;
464
+ /** `x:sheetView/@showGridLines` of the first sheet view (`CT_SheetView`, default true). */
465
+ readonly showGridLines: boolean;
466
+ /** `x:printOptions/@gridLines` (`CT_PrintOptions`, default false). */
467
+ readonly printGridLines: boolean;
468
+ /** Viewport points of the frozen pane edges, when the sheet freezes rows or columns. */
469
+ readonly frozenEdges: {
470
+ readonly x?: number;
471
+ readonly y?: number;
472
+ };
473
+ readonly panes: readonly PaneLayout[];
474
+ readonly problems: readonly LayoutProblem[];
475
+ /**
476
+ * The layout used up its conditional formatting check budget (`LAYOUT_CHECK_BUDGET`), so some
477
+ * cells show their cell formats without their rules. Unlike the `conditional-budget` problem,
478
+ * the problem cap never drops it.
479
+ */
480
+ readonly conditionalCut: boolean;
481
+ }
482
+ /** A pane shows at most this many rows and this many columns. */
483
+ declare const MAX_WINDOW = 2000;
484
+ /** Unwrapped text shows across at most this many empty neighbor cells. */
485
+ declare const OVERFLOW_REACH = 64;
486
+ /**
487
+ * The layout of the visible window of a worksheet, or undefined when the workbook has no
488
+ * worksheet of that name. Viewport and records are in points; the grid rounds to the pixels of
489
+ * `options.profile`.
490
+ */
491
+ declare function layoutSheet(pkg: XlsxPackage, sheetName: string, viewport: Viewport, options: LayoutOptions): SheetLayout | undefined;
492
+
493
+ export { sheetGeometry as $, columnWidthForPixels as B, drawingBounds as E, drawingPartOf as H, fontPixels as I, frozenPanes as J, gridMetrics as K, MAX_ANCHORS as M, layoutCellText as N, OVERFLOW_REACH as O, PRINT_PROFILE as P, layoutSheet as Q, SCREEN_PROFILE as S, mergedRanges as W, parseRange as X, pixelWidth as Y, rowHeightForPixels as Z, sheetDrawings as _, zoomProfile as a0, AxisIndex as b, MAX_WINDOW as l, autoRowHeight as x, baseColumnWidth as y, columnPixels as z };
494
+ export type { AutoRowHeight as A, CellBox as C, DrawingLayout as D, FontKey as F, GridProfile as G, LayoutOptions as L, Rect as R, TextContext as T, UnsupportedDrawing as U, ValueKind as V, AxisEntry as a, AxisSegment as c, CellRange as d, CellTextBox as e, CellTextInput as f, CellTextLayout as g, FontPixels as h, FrozenPanes as i, GridMetrics as j, LayoutProblem as k, MergeIndex as m, PaneLayout as n, PictureLayout as o, ShapeLayout as p, SheetGeometry as q, SheetLayout as r, TextLine as s, TextRunInput as t, TextSpan as u, TextStyle as v, Viewport as w };