@arslankhan/doc-forge 0.0.0-stage → 0.1.1

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 (246) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +13 -0
  3. package/LICENSING.md +80 -0
  4. package/README.md +547 -2
  5. package/RELEASE.md +50 -0
  6. package/dist/binding-path.d.ts +15 -0
  7. package/dist/binding-path.d.ts.map +1 -0
  8. package/dist/binding-path.js +37 -0
  9. package/dist/binding-path.js.map +1 -0
  10. package/dist/binding.d.ts +91 -0
  11. package/dist/binding.d.ts.map +1 -0
  12. package/dist/binding.js +229 -0
  13. package/dist/binding.js.map +1 -0
  14. package/dist/designer/Canvas.d.ts +51 -0
  15. package/dist/designer/Canvas.d.ts.map +1 -0
  16. package/dist/designer/Canvas.js +188 -0
  17. package/dist/designer/Canvas.js.map +1 -0
  18. package/dist/designer/DocumentDesigner.d.ts +14 -0
  19. package/dist/designer/DocumentDesigner.d.ts.map +1 -0
  20. package/dist/designer/DocumentDesigner.js +351 -0
  21. package/dist/designer/DocumentDesigner.js.map +1 -0
  22. package/dist/designer/HtmlPreview.d.ts +9 -0
  23. package/dist/designer/HtmlPreview.d.ts.map +1 -0
  24. package/dist/designer/HtmlPreview.js +20 -0
  25. package/dist/designer/HtmlPreview.js.map +1 -0
  26. package/dist/designer/ImageBindingFields.d.ts +11 -0
  27. package/dist/designer/ImageBindingFields.d.ts.map +1 -0
  28. package/dist/designer/ImageBindingFields.js +106 -0
  29. package/dist/designer/ImageBindingFields.js.map +1 -0
  30. package/dist/designer/InvoiceFields.d.ts +13 -0
  31. package/dist/designer/InvoiceFields.d.ts.map +1 -0
  32. package/dist/designer/InvoiceFields.js +85 -0
  33. package/dist/designer/InvoiceFields.js.map +1 -0
  34. package/dist/designer/PreviewDataDialog.d.ts +13 -0
  35. package/dist/designer/PreviewDataDialog.d.ts.map +1 -0
  36. package/dist/designer/PreviewDataDialog.js +16 -0
  37. package/dist/designer/PreviewDataDialog.js.map +1 -0
  38. package/dist/designer/PropertiesPanel.d.ts +15 -0
  39. package/dist/designer/PropertiesPanel.d.ts.map +1 -0
  40. package/dist/designer/PropertiesPanel.js +63 -0
  41. package/dist/designer/PropertiesPanel.js.map +1 -0
  42. package/dist/designer/ReportFields.d.ts +14 -0
  43. package/dist/designer/ReportFields.d.ts.map +1 -0
  44. package/dist/designer/ReportFields.js +257 -0
  45. package/dist/designer/ReportFields.js.map +1 -0
  46. package/dist/designer/StyleFields.d.ts +16 -0
  47. package/dist/designer/StyleFields.d.ts.map +1 -0
  48. package/dist/designer/StyleFields.js +138 -0
  49. package/dist/designer/StyleFields.js.map +1 -0
  50. package/dist/designer/TextBindingFields.d.ts +11 -0
  51. package/dist/designer/TextBindingFields.d.ts.map +1 -0
  52. package/dist/designer/TextBindingFields.js +105 -0
  53. package/dist/designer/TextBindingFields.js.map +1 -0
  54. package/dist/designer/Toolbar.d.ts +52 -0
  55. package/dist/designer/Toolbar.d.ts.map +1 -0
  56. package/dist/designer/Toolbar.js +62 -0
  57. package/dist/designer/Toolbar.js.map +1 -0
  58. package/dist/designer/Toolbox.d.ts +8 -0
  59. package/dist/designer/Toolbox.d.ts.map +1 -0
  60. package/dist/designer/Toolbox.js +43 -0
  61. package/dist/designer/Toolbox.js.map +1 -0
  62. package/dist/designer/border-preview.d.ts +15 -0
  63. package/dist/designer/border-preview.d.ts.map +1 -0
  64. package/dist/designer/border-preview.js +34 -0
  65. package/dist/designer/border-preview.js.map +1 -0
  66. package/dist/designer/history.d.ts +13 -0
  67. package/dist/designer/history.d.ts.map +1 -0
  68. package/dist/designer/history.js +51 -0
  69. package/dist/designer/history.js.map +1 -0
  70. package/dist/designer/index.d.ts +5 -0
  71. package/dist/designer/index.d.ts.map +1 -0
  72. package/dist/designer/index.js +3 -0
  73. package/dist/designer/index.js.map +1 -0
  74. package/dist/designer/page-geometry.d.ts +35 -0
  75. package/dist/designer/page-geometry.d.ts.map +1 -0
  76. package/dist/designer/page-geometry.js +123 -0
  77. package/dist/designer/page-geometry.js.map +1 -0
  78. package/dist/designer/styles.d.ts +3 -0
  79. package/dist/designer/styles.d.ts.map +1 -0
  80. package/dist/designer/styles.js +594 -0
  81. package/dist/designer/styles.js.map +1 -0
  82. package/dist/designer/template-edits.d.ts +26 -0
  83. package/dist/designer/template-edits.d.ts.map +1 -0
  84. package/dist/designer/template-edits.js +323 -0
  85. package/dist/designer/template-edits.js.map +1 -0
  86. package/dist/designer/theme.d.ts +31 -0
  87. package/dist/designer/theme.d.ts.map +1 -0
  88. package/dist/designer/theme.js +92 -0
  89. package/dist/designer/theme.js.map +1 -0
  90. package/dist/examples/bound-invoice.d.ts +143 -0
  91. package/dist/examples/bound-invoice.d.ts.map +1 -0
  92. package/dist/examples/bound-invoice.js +99 -0
  93. package/dist/examples/bound-invoice.js.map +1 -0
  94. package/dist/examples/full-invoice-data.d.ts +81 -0
  95. package/dist/examples/full-invoice-data.d.ts.map +1 -0
  96. package/dist/examples/full-invoice-data.js +86 -0
  97. package/dist/examples/full-invoice-data.js.map +1 -0
  98. package/dist/examples/full-invoice.d.ts +402 -0
  99. package/dist/examples/full-invoice.d.ts.map +1 -0
  100. package/dist/examples/full-invoice.js +199 -0
  101. package/dist/examples/full-invoice.js.map +1 -0
  102. package/dist/examples/invoice-data.d.ts +51 -0
  103. package/dist/examples/invoice-data.d.ts.map +1 -0
  104. package/dist/examples/invoice-data.js +51 -0
  105. package/dist/examples/invoice-data.js.map +1 -0
  106. package/dist/examples/invoice.d.ts +90 -0
  107. package/dist/examples/invoice.d.ts.map +1 -0
  108. package/dist/examples/invoice.js +62 -0
  109. package/dist/examples/invoice.js.map +1 -0
  110. package/dist/examples/jobs-report-data.d.ts +84 -0
  111. package/dist/examples/jobs-report-data.d.ts.map +1 -0
  112. package/dist/examples/jobs-report-data.js +79 -0
  113. package/dist/examples/jobs-report-data.js.map +1 -0
  114. package/dist/examples/jobs-report.d.ts +182 -0
  115. package/dist/examples/jobs-report.d.ts.map +1 -0
  116. package/dist/examples/jobs-report.js +96 -0
  117. package/dist/examples/jobs-report.js.map +1 -0
  118. package/dist/index.d.ts +31 -0
  119. package/dist/index.d.ts.map +1 -0
  120. package/dist/index.js +21 -0
  121. package/dist/index.js.map +1 -0
  122. package/dist/invoice/calculate.d.ts +59 -0
  123. package/dist/invoice/calculate.d.ts.map +1 -0
  124. package/dist/invoice/calculate.js +270 -0
  125. package/dist/invoice/calculate.js.map +1 -0
  126. package/dist/invoice/context.d.ts +15 -0
  127. package/dist/invoice/context.d.ts.map +1 -0
  128. package/dist/invoice/context.js +79 -0
  129. package/dist/invoice/context.js.map +1 -0
  130. package/dist/invoice/format.d.ts +10 -0
  131. package/dist/invoice/format.d.ts.map +1 -0
  132. package/dist/invoice/format.js +95 -0
  133. package/dist/invoice/format.js.map +1 -0
  134. package/dist/license/capabilities.d.ts +17 -0
  135. package/dist/license/capabilities.d.ts.map +1 -0
  136. package/dist/license/capabilities.js +46 -0
  137. package/dist/license/capabilities.js.map +1 -0
  138. package/dist/license/client.d.ts +109 -0
  139. package/dist/license/client.d.ts.map +1 -0
  140. package/dist/license/client.js +346 -0
  141. package/dist/license/client.js.map +1 -0
  142. package/dist/license/codec.d.ts +5 -0
  143. package/dist/license/codec.d.ts.map +1 -0
  144. package/dist/license/codec.js +26 -0
  145. package/dist/license/codec.js.map +1 -0
  146. package/dist/license/errors.d.ts +11 -0
  147. package/dist/license/errors.d.ts.map +1 -0
  148. package/dist/license/errors.js +19 -0
  149. package/dist/license/errors.js.map +1 -0
  150. package/dist/license/features.d.ts +20 -0
  151. package/dist/license/features.d.ts.map +1 -0
  152. package/dist/license/features.js +28 -0
  153. package/dist/license/features.js.map +1 -0
  154. package/dist/license/index.d.ts +16 -0
  155. package/dist/license/index.d.ts.map +1 -0
  156. package/dist/license/index.js +9 -0
  157. package/dist/license/index.js.map +1 -0
  158. package/dist/license/provider.d.ts +59 -0
  159. package/dist/license/provider.d.ts.map +1 -0
  160. package/dist/license/provider.js +150 -0
  161. package/dist/license/provider.js.map +1 -0
  162. package/dist/license/redact.d.ts +4 -0
  163. package/dist/license/redact.d.ts.map +1 -0
  164. package/dist/license/redact.js +15 -0
  165. package/dist/license/redact.js.map +1 -0
  166. package/dist/license/store.d.ts +26 -0
  167. package/dist/license/store.d.ts.map +1 -0
  168. package/dist/license/store.js +90 -0
  169. package/dist/license/store.js.map +1 -0
  170. package/dist/license/token.d.ts +45 -0
  171. package/dist/license/token.d.ts.map +1 -0
  172. package/dist/license/token.js +195 -0
  173. package/dist/license/token.js.map +1 -0
  174. package/dist/pdf/browser-blocked.d.ts +12 -0
  175. package/dist/pdf/browser-blocked.d.ts.map +1 -0
  176. package/dist/pdf/browser-blocked.js +25 -0
  177. package/dist/pdf/browser-blocked.js.map +1 -0
  178. package/dist/pdf/browser.d.ts +12 -0
  179. package/dist/pdf/browser.d.ts.map +1 -0
  180. package/dist/pdf/browser.js +69 -0
  181. package/dist/pdf/browser.js.map +1 -0
  182. package/dist/pdf/errors.d.ts +6 -0
  183. package/dist/pdf/errors.d.ts.map +1 -0
  184. package/dist/pdf/errors.js +11 -0
  185. package/dist/pdf/errors.js.map +1 -0
  186. package/dist/pdf/index.d.ts +10 -0
  187. package/dist/pdf/index.d.ts.map +1 -0
  188. package/dist/pdf/index.js +9 -0
  189. package/dist/pdf/index.js.map +1 -0
  190. package/dist/pdf/options.d.ts +143 -0
  191. package/dist/pdf/options.d.ts.map +1 -0
  192. package/dist/pdf/options.js +322 -0
  193. package/dist/pdf/options.js.map +1 -0
  194. package/dist/pdf/render-pdf.d.ts +13 -0
  195. package/dist/pdf/render-pdf.d.ts.map +1 -0
  196. package/dist/pdf/render-pdf.js +195 -0
  197. package/dist/pdf/render-pdf.js.map +1 -0
  198. package/dist/render/appearance.d.ts +25 -0
  199. package/dist/render/appearance.d.ts.map +1 -0
  200. package/dist/render/appearance.js +149 -0
  201. package/dist/render/appearance.js.map +1 -0
  202. package/dist/render/css.d.ts +17 -0
  203. package/dist/render/css.d.ts.map +1 -0
  204. package/dist/render/css.js +170 -0
  205. package/dist/render/css.js.map +1 -0
  206. package/dist/render/errors.d.ts +6 -0
  207. package/dist/render/errors.d.ts.map +1 -0
  208. package/dist/render/errors.js +11 -0
  209. package/dist/render/errors.js.map +1 -0
  210. package/dist/render/escape.d.ts +7 -0
  211. package/dist/render/escape.d.ts.map +1 -0
  212. package/dist/render/escape.js +27 -0
  213. package/dist/render/escape.js.map +1 -0
  214. package/dist/render/image-policy.d.ts +21 -0
  215. package/dist/render/image-policy.d.ts.map +1 -0
  216. package/dist/render/image-policy.js +62 -0
  217. package/dist/render/image-policy.js.map +1 -0
  218. package/dist/render/render-html.d.ts +28 -0
  219. package/dist/render/render-html.d.ts.map +1 -0
  220. package/dist/render/render-html.js +364 -0
  221. package/dist/render/render-html.js.map +1 -0
  222. package/dist/render/render-report.d.ts +23 -0
  223. package/dist/render/render-report.d.ts.map +1 -0
  224. package/dist/render/render-report.js +313 -0
  225. package/dist/render/render-report.js.map +1 -0
  226. package/dist/report/process.d.ts +48 -0
  227. package/dist/report/process.d.ts.map +1 -0
  228. package/dist/report/process.js +347 -0
  229. package/dist/report/process.js.map +1 -0
  230. package/dist/schema.d.ts +30 -0
  231. package/dist/schema.d.ts.map +1 -0
  232. package/dist/schema.js +8 -0
  233. package/dist/schema.js.map +1 -0
  234. package/dist/serialize.d.ts +13 -0
  235. package/dist/serialize.d.ts.map +1 -0
  236. package/dist/serialize.js +42 -0
  237. package/dist/serialize.js.map +1 -0
  238. package/dist/types.d.ts +335 -0
  239. package/dist/types.d.ts.map +1 -0
  240. package/dist/types.js +40 -0
  241. package/dist/types.js.map +1 -0
  242. package/dist/validate.d.ts +15 -0
  243. package/dist/validate.d.ts.map +1 -0
  244. package/dist/validate.js +977 -0
  245. package/dist/validate.js.map +1 -0
  246. package/package.json +105 -4
@@ -0,0 +1,335 @@
1
+ export declare const PAGE_ORIENTATIONS: readonly ["portrait", "landscape"];
2
+ export type PageOrientation = (typeof PAGE_ORIENTATIONS)[number];
3
+ export declare const LAYOUT_MODES: readonly ["fixed", "flow"];
4
+ /** `fixed` uses coordinates. `flow` keeps document order for a later renderer. */
5
+ export type LayoutMode = (typeof LAYOUT_MODES)[number];
6
+ export declare const LENGTH_UNITS: readonly ["mm", "pt", "in", "px"];
7
+ export type LengthUnit = (typeof LENGTH_UNITS)[number];
8
+ export declare const PAPER_SIZES: readonly ["A4", "Letter", "Legal", "custom"];
9
+ export type PaperSize = (typeof PAPER_SIZES)[number];
10
+ export type PaperSizeName = Exclude<PaperSize, "custom">;
11
+ export interface PageDimensions {
12
+ width: number;
13
+ height: number;
14
+ unit: LengthUnit;
15
+ }
16
+ export interface PageMargins {
17
+ top: number;
18
+ right: number;
19
+ bottom: number;
20
+ left: number;
21
+ }
22
+ export interface PageConfiguration {
23
+ paperSize: PaperSize;
24
+ orientation: PageOrientation;
25
+ /** Required when `paperSize` is `custom`. Standard sizes may omit this. */
26
+ dimensions?: PageDimensions;
27
+ margins: PageMargins;
28
+ layoutMode: LayoutMode;
29
+ }
30
+ /** Portrait page sizes in millimeters. Landscape swaps width and height. */
31
+ export declare const PAPER_SIZES_MM: Record<PaperSizeName, {
32
+ readonly width: number;
33
+ readonly height: number;
34
+ }>;
35
+ export declare function standardPageDimensions(paperSize: PaperSizeName, orientation: PageOrientation): PageDimensions;
36
+ export interface ElementPosition {
37
+ x: number;
38
+ y: number;
39
+ }
40
+ export interface ElementDimensions {
41
+ width: number;
42
+ height: number;
43
+ }
44
+ export declare const TEXT_ALIGNS: readonly ["left", "center", "right", "justify"];
45
+ export type TextAlign = (typeof TEXT_ALIGNS)[number];
46
+ export declare const FONT_STYLES: readonly ["normal", "italic"];
47
+ export type FontStyle = (typeof FONT_STYLES)[number];
48
+ export declare const FONT_WEIGHT_NAMES: readonly ["normal", "medium", "bold", "lighter", "bolder"];
49
+ export type FontWeightName = (typeof FONT_WEIGHT_NAMES)[number];
50
+ export type FontWeight = FontWeightName | number;
51
+ export declare const VERTICAL_ALIGNS: readonly ["top", "middle", "bottom"];
52
+ export type VerticalAlign = (typeof VERTICAL_ALIGNS)[number];
53
+ export declare const TEXT_DECORATIONS: readonly ["none", "underline", "line-through"];
54
+ export type TextDecoration = (typeof TEXT_DECORATIONS)[number];
55
+ export declare const BORDER_STYLES: readonly ["solid", "dashed", "dotted", "double", "none"];
56
+ export type BorderStyleName = (typeof BORDER_STYLES)[number];
57
+ /** Padding or an edge length in the page unit. Omitted edges are 0 when any edge is set. */
58
+ export interface BoxEdges {
59
+ top?: number;
60
+ right?: number;
61
+ bottom?: number;
62
+ left?: number;
63
+ }
64
+ /** One side of a border. Omitted fields inherit the element's shared border settings. */
65
+ export interface BorderEdge {
66
+ width?: number;
67
+ color?: string;
68
+ style?: BorderStyleName;
69
+ }
70
+ export interface ElementStyle {
71
+ color?: string;
72
+ backgroundColor?: string;
73
+ fontFamily?: string;
74
+ fontSize?: number;
75
+ fontWeight?: FontWeight;
76
+ fontStyle?: FontStyle;
77
+ textAlign?: TextAlign;
78
+ verticalAlign?: VerticalAlign;
79
+ textDecoration?: TextDecoration;
80
+ lineHeight?: number;
81
+ borderColor?: string;
82
+ borderWidth?: number;
83
+ borderStyle?: BorderStyleName;
84
+ borderRadius?: number;
85
+ borderTop?: BorderEdge;
86
+ borderRight?: BorderEdge;
87
+ borderBottom?: BorderEdge;
88
+ borderLeft?: BorderEdge;
89
+ padding?: BoxEdges;
90
+ opacity?: number;
91
+ strokeColor?: string;
92
+ strokeWidth?: number;
93
+ }
94
+ /**
95
+ * Stored data path such as `company.name` or `items.0.name`.
96
+ * This is not an expression. `resolveBinding` reads the path and does not execute it.
97
+ * `fallback` is used when the path is missing, null, or not a scalar.
98
+ * `prefix` and `suffix` are added to that scalar or fallback.
99
+ */
100
+ export declare const VALUE_FORMAT_STYLES: readonly ["decimal", "currency", "percent", "date"];
101
+ export type ValueFormatStyle = (typeof VALUE_FORMAT_STYLES)[number];
102
+ export declare const DATE_FORMAT_STYLES: readonly ["iso", "short", "medium", "long"];
103
+ export type DateFormatStyle = (typeof DATE_FORMAT_STYLES)[number];
104
+ /**
105
+ * Display formatting for a bound scalar.
106
+ * Currency and decimal formats do not change the calculated number.
107
+ * When `style` is `currency` and `currency` is omitted, the renderer reads `invoice.currency`.
108
+ * `percent` uses the formatted fraction: `0.15` is shown as 15%.
109
+ */
110
+ export interface ValueFormat {
111
+ style: ValueFormatStyle;
112
+ locale?: string;
113
+ currency?: string;
114
+ minimumFractionDigits?: number;
115
+ maximumFractionDigits?: number;
116
+ dateStyle?: DateFormatStyle;
117
+ }
118
+ export interface DataBinding {
119
+ path: string;
120
+ fallback?: string;
121
+ prefix?: string;
122
+ suffix?: string;
123
+ format?: ValueFormat;
124
+ }
125
+ interface ElementBase {
126
+ id: string;
127
+ position: ElementPosition;
128
+ style?: ElementStyle;
129
+ }
130
+ export interface TextElement extends ElementBase {
131
+ type: "text";
132
+ dimensions: ElementDimensions;
133
+ text?: string;
134
+ binding?: DataBinding;
135
+ }
136
+ export interface ImageElement extends ElementBase {
137
+ type: "image";
138
+ dimensions: ElementDimensions;
139
+ /**
140
+ * Static source. This is the image URL when `binding` is absent.
141
+ * A binding reads `binding.path` instead. `src` stays on the saved template and is not the runtime value.
142
+ */
143
+ src?: string;
144
+ alt?: string;
145
+ /**
146
+ * Optional source binding. `path` and `fallback` are used.
147
+ * `prefix` and `suffix` are stored for compatibility and are not added to an image URL.
148
+ */
149
+ binding?: DataBinding;
150
+ }
151
+ export interface LineElement extends ElementBase {
152
+ type: "line";
153
+ /**
154
+ * Span from `position` to `position + dimensions`.
155
+ * One side may be 0 for a horizontal or vertical line.
156
+ */
157
+ dimensions: ElementDimensions;
158
+ }
159
+ export interface RectangleElement extends ElementBase {
160
+ type: "rectangle";
161
+ dimensions: ElementDimensions;
162
+ }
163
+ /** One column of a repeating items table. `binding.path` is relative to the current item. */
164
+ export interface ItemsColumn {
165
+ id: string;
166
+ header: string;
167
+ binding: DataBinding;
168
+ /** Relative width. Columns without a width share the remaining space equally. */
169
+ width?: number;
170
+ align?: TextAlign;
171
+ /** Defaults to visible. */
172
+ visible?: boolean;
173
+ }
174
+ export interface ItemsElement extends ElementBase {
175
+ type: "items";
176
+ dimensions: ElementDimensions;
177
+ /** Root path of the item array, usually `invoice.items`. */
178
+ itemsPath: string;
179
+ columns: ItemsColumn[];
180
+ /** Defaults to true. */
181
+ showHeader?: boolean;
182
+ /** Shown when the array is missing or empty. Defaults to "No items". */
183
+ emptyText?: string;
184
+ headerStyle?: ElementStyle;
185
+ /** Cell padding in the page unit. */
186
+ padding?: number;
187
+ }
188
+ export interface TotalsRow {
189
+ id: string;
190
+ label: string;
191
+ /** Root path such as `invoice.grandTotal`. */
192
+ binding: DataBinding;
193
+ visible?: boolean;
194
+ /** When true, a numeric zero is omitted. */
195
+ hideWhenZero?: boolean;
196
+ }
197
+ export interface TotalsElement extends ElementBase {
198
+ type: "totals";
199
+ dimensions: ElementDimensions;
200
+ rows: TotalsRow[];
201
+ }
202
+ export declare const AGGREGATES: readonly ["sum", "count", "min", "max"];
203
+ export type Aggregate = (typeof AGGREGATES)[number];
204
+ export declare const SORT_DIRECTIONS: readonly ["asc", "desc"];
205
+ export type SortDirection = (typeof SORT_DIRECTIONS)[number];
206
+ /** One column of a report table. `binding.path` is relative to the current record. */
207
+ export interface ReportColumn {
208
+ id: string;
209
+ header: string;
210
+ binding: DataBinding;
211
+ /** Relative width. Columns without a width share the remaining space equally. */
212
+ width?: number;
213
+ /** Data alignment. A column `style.textAlign` replaces this for body cells. */
214
+ align?: TextAlign;
215
+ /** Defaults to visible. */
216
+ visible?: boolean;
217
+ /** When set, group subtotals and the grand total include this column. */
218
+ aggregate?: Aggregate;
219
+ /** Header-cell overrides. Only properties set here replace the table header style. */
220
+ headerStyle?: ElementStyle;
221
+ /** Body-cell overrides. Only properties set here replace the table body style. */
222
+ style?: ElementStyle;
223
+ }
224
+ export declare const ROW_RULE_OPERATORS: readonly ["eq", "neq", "gt", "gte", "lt", "lte", "blank"];
225
+ export type RowRuleOperator = (typeof ROW_RULE_OPERATORS)[number];
226
+ /**
227
+ * Compares one record field with a literal.
228
+ * `blank` matches a missing path, null, or an empty string. `value` is ignored for `blank`.
229
+ */
230
+ export interface RowStyleRule {
231
+ path: string;
232
+ operator: RowRuleOperator;
233
+ value?: string | number | boolean;
234
+ style: ElementStyle;
235
+ }
236
+ export interface ReportGroupLevel {
237
+ /** Record field path, such as `technician`. */
238
+ path: string;
239
+ /** Optional text before the group value. */
240
+ label?: string;
241
+ }
242
+ export interface ReportSort {
243
+ path: string;
244
+ direction: SortDirection;
245
+ }
246
+ export interface ReportTableElement extends ElementBase {
247
+ type: "reportTable";
248
+ dimensions: ElementDimensions;
249
+ /** Root path of the record array, such as `data.jobs`. */
250
+ collectionPath: string;
251
+ columns: ReportColumn[];
252
+ /** Defaults to true. */
253
+ showHeader?: boolean;
254
+ /** Shown when the collection is missing or empty. */
255
+ emptyText?: string;
256
+ headerStyle?: ElementStyle;
257
+ /** Cell padding in the page unit. */
258
+ padding?: number;
259
+ /** Optional even-row background. Used when `evenRowColor` is omitted. */
260
+ alternateRowColor?: string;
261
+ /** Odd record rows, counting from 1. Ignored when `stripeRows` is false. */
262
+ oddRowColor?: string;
263
+ /** Even record rows. Falls back to `alternateRowColor`. */
264
+ evenRowColor?: string;
265
+ /** Set false to turn zebra striping off without deleting the colors. Defaults to on when a stripe color is set. */
266
+ stripeRows?: boolean;
267
+ /** Body cells. Overrides the table style only for properties set here. */
268
+ bodyStyle?: ElementStyle;
269
+ groupStyle?: ElementStyle;
270
+ subtotalStyle?: ElementStyle;
271
+ grandTotalStyle?: ElementStyle;
272
+ /** Places the table using its width. Omitted tables stay full width. */
273
+ tableAlign?: "left" | "center" | "right";
274
+ /** Header row minimum height in the page unit. */
275
+ headerHeight?: number;
276
+ /**
277
+ * Safe row colors. The first matching rule supplies the cell style.
278
+ * Paths are read from the record. They are not expressions.
279
+ */
280
+ rowRules?: RowStyleRule[];
281
+ /** Up to three levels. The first level is the outermost group. */
282
+ groupBy?: ReportGroupLevel[];
283
+ /** Applied before grouping. The original record order breaks ties. */
284
+ sort?: ReportSort[];
285
+ /** Defaults to false. Requires at least one column aggregate. */
286
+ showGrandTotal?: boolean;
287
+ grandTotalLabel?: string;
288
+ /** Starts this table on a new printed page when the browser supports `break-before`. */
289
+ pageBreakBefore?: boolean;
290
+ }
291
+ export declare const REPORT_BAND_TYPES: readonly ["text", "image"];
292
+ export type ReportBandType = (typeof REPORT_BAND_TYPES)[number];
293
+ export interface ReportTextBand {
294
+ id: string;
295
+ type: "text";
296
+ text?: string;
297
+ binding?: DataBinding;
298
+ }
299
+ export interface ReportImageBand {
300
+ id: string;
301
+ type: "image";
302
+ src?: string;
303
+ alt?: string;
304
+ binding?: DataBinding;
305
+ }
306
+ export type ReportBandEntry = ReportTextBand | ReportImageBand;
307
+ /**
308
+ * Optional report layout. Ignored by generic documents and invoices.
309
+ * Page size, orientation, and margins stay on `page`.
310
+ */
311
+ export interface ReportOptions {
312
+ /** Static title printed once at the start of the report. */
313
+ title?: string;
314
+ description?: string;
315
+ /** Used when a report table does not set its own empty text. */
316
+ emptyText?: string;
317
+ /**
318
+ * Prints a CSS page counter in the page footer.
319
+ * The screen preview does not know the page number. Total page count is not rendered.
320
+ */
321
+ showPageNumber?: boolean;
322
+ /** Repeats with each report table header when the table breaks across printed pages. */
323
+ pageHeader?: ReportBandEntry[];
324
+ /** Best-effort repeating footer. See the report pagination notes. */
325
+ pageFooter?: ReportBandEntry[];
326
+ /** Printed once before the report body. */
327
+ reportHeader?: ReportBandEntry[];
328
+ /** Printed once after the report body. */
329
+ reportFooter?: ReportBandEntry[];
330
+ }
331
+ export type DocumentElement = TextElement | ImageElement | LineElement | RectangleElement | ItemsElement | TotalsElement | ReportTableElement;
332
+ export declare const ELEMENT_TYPES: readonly ["text", "image", "line", "rectangle", "items", "totals", "reportTable"];
333
+ export type ElementType = (typeof ELEMENT_TYPES)[number];
334
+ export {};
335
+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AAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,eAAe,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wFAAwF;IACxF,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,qEAAqE;IACrE,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,2CAA2C;IAC3C,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,YAAY,GACZ,aAAa,GACb,kBAAkB,CAAC;AAEvB,eAAO,MAAM,aAAa,mFAAoF,CAAC;AAE/G,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,40 @@
1
+ export const PAGE_ORIENTATIONS = ["portrait", "landscape"];
2
+ export const LAYOUT_MODES = ["fixed", "flow"];
3
+ export const LENGTH_UNITS = ["mm", "pt", "in", "px"];
4
+ export const PAPER_SIZES = ["A4", "Letter", "Legal", "custom"];
5
+ /** Portrait page sizes in millimeters. Landscape swaps width and height. */
6
+ export const PAPER_SIZES_MM = {
7
+ A4: { width: 210, height: 297 },
8
+ Letter: { width: 215.9, height: 279.4 },
9
+ Legal: { width: 215.9, height: 355.6 },
10
+ };
11
+ export function standardPageDimensions(paperSize, orientation) {
12
+ const size = PAPER_SIZES_MM[paperSize];
13
+ if (orientation === "landscape") {
14
+ return { width: size.height, height: size.width, unit: "mm" };
15
+ }
16
+ return { width: size.width, height: size.height, unit: "mm" };
17
+ }
18
+ export const TEXT_ALIGNS = ["left", "center", "right", "justify"];
19
+ export const FONT_STYLES = ["normal", "italic"];
20
+ export const FONT_WEIGHT_NAMES = ["normal", "medium", "bold", "lighter", "bolder"];
21
+ export const VERTICAL_ALIGNS = ["top", "middle", "bottom"];
22
+ export const TEXT_DECORATIONS = ["none", "underline", "line-through"];
23
+ export const BORDER_STYLES = ["solid", "dashed", "dotted", "double", "none"];
24
+ /**
25
+ * Stored data path such as `company.name` or `items.0.name`.
26
+ * This is not an expression. `resolveBinding` reads the path and does not execute it.
27
+ * `fallback` is used when the path is missing, null, or not a scalar.
28
+ * `prefix` and `suffix` are added to that scalar or fallback.
29
+ */
30
+ export const VALUE_FORMAT_STYLES = ["decimal", "currency", "percent", "date"];
31
+ export const DATE_FORMAT_STYLES = ["iso", "short", "medium", "long"];
32
+ export const AGGREGATES = ["sum", "count", "min", "max"];
33
+ export const SORT_DIRECTIONS = ["asc", "desc"];
34
+ export const ROW_RULE_OPERATORS = ["eq", "neq", "gt", "gte", "lt", "lte", "blank"];
35
+ export const REPORT_BAND_TYPES = ["text", "image"];
36
+ export const ELEMENT_TYPES = ["text", "image", "line", "rectangle", "items", "totals", "reportTable"];
37
+ /** Keeps the element registry aligned with the element union. */
38
+ const elementTypesCovered = true;
39
+ void elementTypesCovered;
40
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"m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15 @@
1
+ export interface TemplateValidationIssue {
2
+ path: string;
3
+ code: string;
4
+ message: string;
5
+ }
6
+ export interface TemplateValidationResult {
7
+ valid: boolean;
8
+ errors: TemplateValidationIssue[];
9
+ }
10
+ export declare class TemplateValidationError extends Error {
11
+ readonly errors: readonly TemplateValidationIssue[];
12
+ constructor(errors: readonly TemplateValidationIssue[]);
13
+ }
14
+ export declare function validateTemplate(input: unknown): TemplateValidationResult;
15
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,uBAAuB,EAAE,CAAC;CACnC;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAC;gBAExC,MAAM,EAAE,SAAS,uBAAuB,EAAE;CAMvD;AAoJD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAqBzE"}