werkmap 0.2.0 → 0.3.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.
- package/README.md +3 -1
- package/lib/index.d.ts +5 -0
- package/lib/index.js +661 -430
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -143,10 +143,12 @@ Freeze the top `rows` rows. `0` clears.
|
|
|
143
143
|
|
|
144
144
|
### `sheet.print(setup)`
|
|
145
145
|
|
|
146
|
-
How this worksheet prints: `{ margin, size, orientation, fit }`, every key optional. `margin` is all four page margins in points, `size` one of `letter`, `tabloid`, `legal`, `A3`, `A4`, `A5`, `orientation` either `portrait` or `landscape`, and `fit: true` scales the sheet to one page wide and as many pages tall as it takes.
|
|
146
|
+
How this worksheet prints: `{ margin, size, orientation, fit, titles }`, every key optional. `margin` is all four page margins in points, `size` one of `letter`, `tabloid`, `legal`, `A3`, `A4`, `A5`, `orientation` either `portrait` or `landscape`, and `fit: true` scales the sheet to one page wide and as many pages tall as it takes.
|
|
147
147
|
|
|
148
148
|
A worksheet that never calls this carries **no print setup at all**, so a reader applies its own defaults rather than this writer's opinion. Calls merge, so two calls naming different keys both take effect. Print setup is per worksheet, which is where OOXML puts it.
|
|
149
149
|
|
|
150
|
+
`titles: n` repeats the top `n` rows at the top of every printed page — the paper counterpart of `freeze`, which keeps them in view on screen. `0` clears it, as it does for a freeze. This one is written as a `_xlnm.Print_Titles` defined name in `xl/workbook.xml` rather than in the sheet part, and it is scoped to this worksheet alone, so each sheet of a workbook repeats its own rows.
|
|
151
|
+
|
|
150
152
|
### `sheet.place(id, { row, col, width, height })`
|
|
151
153
|
|
|
152
154
|
One floating picture anchored to the top-left of a 1-based cell, drawn at `width` × `height` CSS pixels at 96 dpi.
|
package/lib/index.d.ts
CHANGED
|
@@ -84,6 +84,11 @@ export interface PrintSetup {
|
|
|
84
84
|
orientation?: "portrait" | "landscape";
|
|
85
85
|
/** Scale the sheet to one page wide, and as many pages tall as it takes. */
|
|
86
86
|
fit?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Repeat the top `rows` rows at the top of every printed page. `0` clears,
|
|
89
|
+
* the way a `freeze` of `0` does. Scoped to this worksheet alone.
|
|
90
|
+
*/
|
|
91
|
+
titles?: number;
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
export interface Sheet {
|