@formancy/report-spec 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/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/version.d.ts
2
1
  /**
3
2
  * The format's name. A canonical hash of a report is taken over an envelope
4
3
  * that names it, so a report and a form whose JSON bodies happen to be equal
@@ -33,376 +32,320 @@ type SpecVersionCheck = {
33
32
  * hides a row or changes a total.
34
33
  */
35
34
  export declare function checkSpecVersion(document: unknown): SpecVersionCheck;
36
- //#endregion
37
- //#region src/e-invoice.d.ts
38
- /** The kinds of e-invoice. A kind this version does not know is refused, never skipped. */
39
- export declare const E_INVOICE_KINDS: readonly ["facturX"];
40
- type EInvoiceKind = (typeof E_INVOICE_KINDS)[number];
41
- /** The Factur-X profiles this version writes: EN 16931 alone, which Germany counts as an e-invoice and FeRD recommends. */
42
- export declare const E_INVOICE_PROFILES: readonly ["en16931"];
43
- type EInvoiceProfile = (typeof E_INVOICE_PROFILES)[number];
44
- /** The invoice type codes (BT-3, UNTDID 1001) this version writes: 380, a commercial invoice. No credit note yet. */
45
- export declare const INVOICE_TYPE_CODES: readonly ["380"];
46
- type InvoiceTypeCode = (typeof INVOICE_TYPE_CODES)[number];
47
- /** The currencies (BT-5, ISO 4217) this version writes: EUR. A second would bring BT-6 and BT-111 with it. */
48
- export declare const E_INVOICE_CURRENCIES: readonly ["EUR"];
49
- type EInvoiceCurrency = (typeof E_INVOICE_CURRENCIES)[number];
35
+ export declare const PAGE_SIZE_NAMES: readonly ["A4", "Letter"];
36
+ type PageSizeName = (typeof PAGE_SIZE_NAMES)[number];
37
+ export declare const ORIENTATIONS: readonly ["portrait", "landscape"];
38
+ type Orientation = (typeof ORIENTATIONS)[number];
39
+ interface Margins {
40
+ readonly top: number;
41
+ readonly right: number;
42
+ readonly bottom: number;
43
+ readonly left: number;
44
+ }
45
+ interface PageSettings {
46
+ readonly size: PageSizeName;
47
+ readonly orientation: Orientation;
48
+ readonly margins: Margins;
49
+ }
50
+ interface PageDimensions {
51
+ readonly width: number;
52
+ readonly height: number;
53
+ }
50
54
  /**
51
- * The VAT categories (BT-118, BT-151; UNCL 5305) this version writes:
52
- * standard rated, exempt from VAT, and reverse charge. CEN's BR-CL-17 and
53
- * BR-CL-18 take seven more, Z, K, G, O, L, M and B, which wait.
55
+ * Portrait sizes in points. A4 is ISO 216's 210 x 297 mm, converted and
56
+ * rounded like any other length (595.28 x 841.89, the values PDF engines
57
+ * use); Letter is 8.5 x 11 inches, exactly 612 x 792.
54
58
  */
55
- export declare const VAT_CATEGORY_CODES: readonly ["S", "E", "AE"];
56
- type VatCategoryCode = (typeof VAT_CATEGORY_CODES)[number];
57
- /** The payment means (BT-81, UNTDID 4461) this version writes: 58, a SEPA credit transfer, and 30, a credit transfer. */
58
- export declare const PAYMENT_MEANS_CODES: readonly ["58", "30"];
59
- type PaymentMeansCode = (typeof PAYMENT_MEANS_CODES)[number];
59
+ export declare const PAGE_SIZES: { readonly [S in PageSizeName]: PageDimensions; };
60
+ /** The page's width and height as oriented: landscape swaps the sides. */
61
+ export declare function pageDimensions(page: {
62
+ readonly size: PageSizeName;
63
+ readonly orientation: Orientation;
64
+ }): PageDimensions;
65
+ /** What the margins leave of the oriented page, to the hundredth of a point that lengths are stored at. */
66
+ export declare function printableArea(page: PageSettings): PageDimensions;
60
67
  /**
61
- * The units of measure (BT-130; UN/ECE Recommendation 20, revision 11e) a
62
- * line's quantity may be in, and no other (BR-CL-23): the counted, time,
63
- * mass, length, area, volume and energy units a German invoice is written
64
- * in. CEN takes 2,162; the packaging codes of Recommendation 21 among them
65
- * wait.
68
+ * The largest square `area` holds: the length of its shorter side, and
69
+ * which side that is, the width when the two are equal. The validator
70
+ * measures a QR code's square against it and refuses one that overruns it
71
+ * on that side; the builders size a new code by it and name it as the room
72
+ * a refused size lacks.
66
73
  */
67
- export declare const UNIT_CODES: readonly ["C62", "H87", "SET", "PR", "LS", "MIN", "HUR", "DAY", "WEE", "MON", "ANN", "GRM", "KGM", "TNE", "MTR", "KMT", "MTK", "MTQ", "MLT", "LTR", "KWH"];
68
- type UnitCode = (typeof UNIT_CODES)[number];
74
+ export declare function squareRoom(area: PageDimensions): {
75
+ readonly side: 'width' | 'height';
76
+ readonly length: number;
77
+ };
69
78
  /**
70
- * The countries (BT-40, BT-55; ISO 3166-1 alpha-2) a seller or a buyer may
71
- * be in, and no other (BR-CL-14): the 27 member states of the EU, the EEA's
72
- * Iceland, Liechtenstein and Norway, Switzerland, and the United Kingdom.
73
- * CEN takes 251. Greece is GR here, and EL only as a VAT prefix.
79
+ * The data a report reads: the datasets it names by the contract each
80
+ * promises, the one way the format refers to one of their fields, and the
81
+ * parameters a person supplies before it renders. The template names them;
82
+ * the deployment supplies what each resolves to.
74
83
  */
75
- export declare const COUNTRY_CODES: readonly ["AT", "BE", "BG", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GR", "HR", "HU", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PL", "PT", "RO", "SE", "SI", "SK", "IS", "LI", "NO", "CH", "GB"];
76
- type CountryCode = (typeof COUNTRY_CODES)[number];
84
+ export declare const FIELD_TYPES: readonly ["string", "integer", "decimal", "boolean", "date", "datetime", "instant", "image"];
85
+ type FieldType = (typeof FIELD_TYPES)[number];
77
86
  /**
78
- * The prefixes a VAT identifier (BT-31, BT-48) may begin with (BR-CO-09):
79
- * a country of `COUNTRY_CODES`, or EL, which Greece writes its VAT
80
- * identifiers with. BR-CO-09's message allows EL in both releases, but only
81
- * 1.3.16's test, which the pinned validators run, holds it; 1.3.17's does
82
- * not. EL is taken while the pinned oracle takes it, and the gate fails on
83
- * the release that does not.
87
+ * How a choice's answer prints, where it does not print its label (0042):
88
+ * the value the submission stores. Its label -- the one its option has in
89
+ * the form version that collected it, in the locale the render names, the
90
+ * report's own when it names none (0063) -- is what it prints when `read`
91
+ * is left out, and has no spelling of its own, so that one binding has
92
+ * one hash.
84
93
  */
85
- export declare const VAT_PREFIXES: readonly string[];
94
+ export declare const FORM_READS: readonly ["value"];
95
+ type FormRead = (typeof FORM_READS)[number];
86
96
  /**
87
- * The schemes (BT-30-1, BT-47-1; ISO 6523 ICD) a legal registration
88
- * identifier may be given in, and no other (BR-CL-11). An identifier may be
89
- * given without one, as a German commercial register number is. France's
90
- * SIREN and SIRET, since a French buyer's SIREN is the one detail of
91
- * France's the XML holds; and the two that name a company anywhere. CEN
92
- * takes 246; the Leitweg-ID, 0204, which routes an invoice to a German
93
- * public buyer in BT-10, waits with XRechnung.
97
+ * Where a formancy form's submission holds a field's answer (0042): its
98
+ * data path in the dataset's scope, as formancy writes one -- field keys
99
+ * joined by dots, a group's child `address.street`; a page scopes nothing
100
+ * and has no key in it. The header's scope and one row per submission's is
101
+ * the submission's; a repeater's rows' is the row's.
94
102
  */
95
- export declare const SCHEME_IDS: readonly ["0002", "0009", "0060", "0088"];
96
- type SchemeId = (typeof SCHEME_IDS)[number];
97
- /** What names each profile, in the XML and in the PDF that carries it. */
98
- interface FacturXProfileTerms {
99
- /** The specification identifier (BT-24), which the XML opens with. */
100
- readonly guideline: string;
101
- /** The XMP's `fx:ConformanceLevel` [S]. */
102
- readonly conformanceLevel: string;
103
- /** The embedded file's `/AFRelationship` [S]. */
104
- readonly relationship: 'Alternative';
103
+ interface FieldFormBinding {
104
+ readonly path: string;
105
+ /** A matrix row's value, whose chosen column the field prints, or a selectboxes option's value, whether it is ticked. */
106
+ readonly member?: string;
107
+ /** How a choice prints -- a select, a radio, a matrix row's column: `value`, its stored value; absent, its label. Only a string field reads a choice. */
108
+ readonly read?: FormRead;
109
+ /**
110
+ * What a review decided for a form version (0048), keyed by the
111
+ * version's `schemaHash`: where that version holds the field -- `path`
112
+ * itself, for the version a followed rename moved `path` to -- or that
113
+ * the report prints nothing of it from that version. Every version not
114
+ * named is read at `path`.
115
+ */
116
+ readonly overrides?: Readonly<Record<string, FieldFormOverride>>;
105
117
  }
106
118
  /**
107
- * Each profile's names. A table over every profile, so a profile added to
108
- * `E_INVOICE_PROFILES` without them does not compile.
109
- * - BT-24 is the EN 16931 profile's identifier as the Factur-X 1.09.2
110
- * schematron's code list 1 gives it (`FACTUR-X_EN16931_codedb.xml`, read
111
- * in akretion's copy). Mustang refuses the old `urn:factur-x.eu:1p0:en16931`.
112
- * - `Alternative` is Germany's relationship for EN 16931, and one of the
113
- * three France allows [S].
114
- */
115
- export declare const FACTUR_X_PROFILES: { readonly [P in EInvoiceProfile]: FacturXProfileTerms; };
116
- /**
117
- * The file a Factur-X PDF embeds, and the XMP that describes it [S]: the
118
- * name, the media type, the fx extension's namespace (its trailing `#`
119
- * required) and prefix, and the document type and the version it states.
120
- * The namespace is the transcription's section 6.3.1; its BR-HYBRID-04
121
- * gives it without `:invoice`, an inconsistency the transcription resolves
122
- * for section 6.3.1, as akretion's generator and PDFlib's sample do (0031).
123
- * No validator checks the namespace: Mustang reads the four properties by
124
- * local name, and veraPDF checks only that the extension schema describes
125
- * them. The renderer embeds what these say (0031), and its test holds the
126
- * PDF to the transcription's values, written there and not read from here;
127
- * the official package's XMP example, which would hold them to more, waits
128
- * for a registration with FeRD nobody here has made.
119
+ * How one form version's submissions fill a field, where it is not as the
120
+ * binding says (0048): from another data path in the same scope, the
121
+ * member and the reading kept; or not at all, null in every submission of
122
+ * that version, which only a field that may be null takes.
129
123
  */
130
- export declare const FACTUR_X: {
131
- readonly fileName: "factur-x.xml";
132
- readonly mediaType: "text/xml";
133
- readonly xmpNamespace: "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#";
134
- readonly xmpPrefix: "fx";
135
- readonly documentType: "INVOICE";
136
- readonly version: "1.0";
124
+ type FieldFormOverride = {
125
+ readonly path: string;
126
+ } | {
127
+ readonly omit: true;
137
128
  };
138
129
  /**
139
- * The names an expression reads in a report that is an e-invoice, beside
140
- * `EXPRESSION_NAMES`'s, and in no other report (0027, an addition to
141
- * 0007's names): `invoice` holds the document's totals (BG-22), and
142
- * `vatBasis` and `vatAmount` each declared VAT category's taxable and tax
143
- * amount (BG-23) by the category's id, null when no line is in it. The
144
- * runtime computes each once, from the lines, for the page and the XML
145
- * alike. They are read wherever `totals` is, except where they are
146
- * computed from: an aggregate's expression, the e-invoice's own, and the
147
- * columns that print a line's terms. The editing core refuses a read
148
- * there, and in any other report.
149
- */
150
- export declare const E_INVOICE_NAMES: readonly ["invoice", "vatBasis", "vatAmount"];
151
- type EInvoiceName = (typeof E_INVOICE_NAMES)[number];
152
- /**
153
- * The members of `invoice`, each one of the document's totals (BG-22), as a
154
- * refusal names it: every one a decimal of two places in the invoice's
155
- * currency. With no allowances and no charges, the total without VAT is
156
- * the sum of the lines. `paid` is a member only of an invoice that
157
- * declares a paid amount, and is what that gives; with none, the amount
158
- * due is the total with VAT.
130
+ * What of a formancy form's submissions a dataset reads (0042): the header
131
+ * one submission's answers; the detail one of its repeater's rows, or one
132
+ * row for each submission of a report of many, which has no header. Which
133
+ * version of which form is the render's input, never the report's: each
134
+ * submission is read against the version that collected it.
159
135
  */
160
- export declare const INVOICE_TOTALS: {
161
- readonly lineTotal: "the sum of the invoice line net amounts (BT-106)";
162
- readonly taxBasisTotal: "the invoice total amount without VAT (BT-109)";
163
- readonly taxTotal: "the invoice total VAT amount (BT-110)";
164
- readonly grandTotal: "the invoice total amount with VAT (BT-112)";
165
- readonly paid: "the paid amount (BT-113)";
166
- readonly duePayable: "the amount due for payment (BT-115)";
136
+ export declare const DATASET_FORM_KINDS: readonly ["submission", "repeater", "submissions"];
137
+ type DatasetFormKind = (typeof DATASET_FORM_KINDS)[number];
138
+ type DatasetFormBinding = {
139
+ readonly kind: 'submission';
140
+ } | {
141
+ readonly kind: 'repeater';
142
+ /** The repeater's data path in the submission's scope. */
143
+ readonly repeater: string;
144
+ /** Where a form version holds the rows, keyed by its `schemaHash`, as a review decided (0048) -- `repeater` itself, for the version a followed rename moved it to; its rows' fields are read at their own paths in them. Every version not named reads `repeater`. */
145
+ readonly overrides?: Readonly<Record<string, {
146
+ readonly repeater: string;
147
+ }>>;
148
+ } | {
149
+ readonly kind: 'submissions';
167
150
  };
168
- type InvoiceTotal = keyof typeof INVOICE_TOTALS;
169
- /** What `vatBasis` and `vatAmount` hold of each declared category, as a refusal names it. */
170
- export declare const VAT_BREAKDOWN: { readonly [N in Exclude<EInvoiceName, 'invoice'>]: string; };
171
151
  /**
172
- * A postal address (BG-5, BG-8): the first line, the post code, the city
173
- * and the country are needed, the second line may be left out. Each is
174
- * runs; the country is a code of `COUNTRY_CODES`.
152
+ * A field a dataset contract promises.
153
+ *
154
+ * Values of exact types arrive as strings, never as JavaScript numbers. An
155
+ * `image` field's value is an approved asset -- its id and its `sha256:`
156
+ * digest -- which the host resolves to bytes, never an address: a photo or
157
+ * a signature captured with a form arrives this way, and prints only as an
158
+ * image. A field that is not nullable never holds null; one that is prints
159
+ * null as nothing. A field the data lacks altogether is the runtime's error,
160
+ * never an empty string.
175
161
  */
176
- interface EInvoiceAddress {
177
- readonly line1: readonly Inline[];
178
- readonly line2?: readonly Inline[];
179
- readonly postalCode: readonly Inline[];
180
- readonly city: readonly Inline[];
181
- readonly country: readonly Inline[];
162
+ interface FieldContract {
163
+ /** A field key: what an expression reads it as, `header.<id>` or `row.<id>`. */
164
+ readonly id: string;
165
+ readonly type: FieldType;
166
+ readonly label: string;
167
+ readonly nullable: boolean;
168
+ /** Digits after the decimal point; decimal fields only. */
169
+ readonly scale?: number;
170
+ /** Where a formancy form's submission holds it, in a dataset read from one; absent in any other. */
171
+ readonly form?: FieldFormBinding;
182
172
  }
183
- /** A legal registration identifier (BT-30, BT-47), and the scheme it is given in, if one. */
184
- interface LegalIdentifier {
185
- readonly id: readonly Inline[];
186
- readonly scheme?: SchemeId;
173
+ /**
174
+ * A dataset the report reads, by the logical id a deployment's binding set
175
+ * maps to a provider. The fields are the contract the template was written
176
+ * against, so the template itself records which revision of the contract it
177
+ * expects.
178
+ */
179
+ interface DatasetContract {
180
+ readonly id: string;
181
+ readonly fields: readonly FieldContract[];
182
+ /** What of a formancy form's submissions it reads; absent, the host hands its data over as it captured it. */
183
+ readonly form?: DatasetFormBinding;
187
184
  }
188
- /** The seller (BG-4): its name (BT-27), its VAT identifier (BT-31), its tax number (BT-32), its legal registration (BT-30) and its address (BG-5). */
189
- interface EInvoiceSeller {
190
- readonly name: readonly Inline[];
191
- readonly vatId?: readonly Inline[];
192
- readonly taxNumber?: readonly Inline[];
193
- readonly legalId?: LegalIdentifier;
194
- readonly address: EInvoiceAddress;
185
+ /** The two datasets a version-0 report can read: one row of header data, and the one primary detail dataset. */
186
+ export declare const DATASET_ROLES: readonly ["header", "detail"];
187
+ type DatasetRole = (typeof DATASET_ROLES)[number];
188
+ interface Datasets {
189
+ readonly header?: DatasetContract;
190
+ readonly detail?: DatasetContract;
195
191
  }
196
- /** The buyer (BG-7): its name (BT-44), its VAT identifier (BT-48), its legal registration (BT-47) and its address (BG-8). A buyer has no BT-32. */
197
- interface EInvoiceBuyer {
198
- readonly name: readonly Inline[];
199
- readonly vatId?: readonly Inline[];
200
- readonly legalId?: LegalIdentifier;
201
- readonly address: EInvoiceAddress;
192
+ /** A field of the header or the detail dataset: the one way the format refers to one. */
193
+ interface FieldRef {
194
+ readonly dataset: DatasetRole;
195
+ readonly field: string;
202
196
  }
203
- /**
204
- * A VAT category the invoice's lines are in, one VAT breakdown (BG-23) each
205
- * when a line uses it.
206
- */
207
- interface VatCategory {
208
- /** A field key: what the page reads its basis and its amount as, `vatBasis.<id>` and `vatAmount.<id>`, and what a line names it by. */
197
+ export declare const PARAMETER_TYPES: readonly ["string", "integer", "decimal", "boolean", "date"];
198
+ type ParameterType = (typeof PARAMETER_TYPES)[number];
199
+ /** A value a person supplies before rendering, on a formancy form whose field key is the parameter's id (plan 12.4). */
200
+ interface ParameterDef {
201
+ /** A field key: what an expression reads it as, `params.<id>`. */
209
202
  readonly id: string;
210
- readonly code: VatCategoryCode;
211
- /** The rate in per cent (BT-119, BT-152), an exact decimal: more than 0 when standard rated, 0 otherwise. */
212
- readonly rate: string;
213
- /** The exemption reason (BT-120): needed for E and AE, never for S. */
214
- readonly reason?: readonly Inline[];
203
+ readonly type: ParameterType;
204
+ readonly label: string;
205
+ readonly required: boolean;
206
+ /** A boolean for a boolean parameter; for every other type, the exact value as a string. */
207
+ readonly default?: string | boolean;
215
208
  }
216
- /** The invoicing period (BG-14): its start (BT-73), its end (BT-74), or both. */
217
- interface InvoicingPeriod {
218
- readonly start?: Expression;
219
- readonly end?: Expression;
209
+ /** A CEL expression, compiled and bounded by the runtime, not here. */
210
+ interface Expression {
211
+ readonly cel: string;
220
212
  }
221
213
  /**
222
- * The lines (BG-25), one per row of the table over the detail dataset. The
223
- * name, the quantity, the net price and the net amount are column ids of
224
- * that table: what each column prints, once per row, is what the line
225
- * holds. The identifier, the unit and the VAT category are read from each
226
- * row, as an aggregate reads it.
214
+ * Where a value is read, which decides what it can name (plan 15's "current
215
+ * row, group or report"): `row` in a table cell and a table's row
216
+ * condition, once per detail row; `group` in a group header or footer,
217
+ * once per group; `table` in a table's total rows, once per table (0062);
218
+ * `report` everywhere else.
227
219
  */
228
- interface EInvoiceLines {
229
- /** The id of the table over the detail dataset. */
230
- readonly table: string;
231
- /** The column that prints the item name (BT-153). */
232
- readonly name: string;
233
- /** The column that prints the invoiced quantity (BT-129). */
234
- readonly quantity: string;
235
- /** The column that prints the item net price (BT-146). */
236
- readonly netPrice: string;
237
- /** The column that prints the line net amount (BT-131), a whole number of cents. */
238
- readonly netAmount: string;
239
- /** The line identifier (BT-126). */
240
- readonly id: RowValue;
241
- /** The unit of measure (BT-130), a code of `UNIT_CODES`. */
242
- readonly unit: RowValue;
243
- /** The id of the line's VAT category (BT-151, BT-152): one the invoice declares. */
244
- readonly vat: RowValue;
245
- }
246
- /** The payment instructions (BG-16): how the invoice is paid, and to which account. */
247
- interface PaymentInstructions {
248
- /** BT-81. */
249
- readonly means: PaymentMeansCode;
250
- /** The payment account (BT-84): an IBAN. Spaces are for reading, and are dropped. */
251
- readonly iban: readonly Inline[];
252
- /** The BIC of the account's bank (BT-86). */
253
- readonly bic?: readonly Inline[];
254
- /** The account's name (BT-85). */
255
- readonly accountName?: readonly Inline[];
256
- /** The remittance information (BT-83): what a payer writes on the transfer. */
257
- readonly remittance?: readonly Inline[];
258
- }
259
- /**
260
- * A Factur-X invoice in the EN 16931 profile. Each text is runs, one at
261
- * least where it is present; an optional one absent is a term the XML
262
- * leaves out, never an empty list of runs, so that one invoice has one
263
- * spelling and one hash. Each expression is compiled and typed by the
264
- * editing core: the dates are dates, the paid amount a decimal.
265
- */
266
- interface FacturXInvoice {
267
- readonly kind: 'facturX';
268
- readonly profile: EInvoiceProfile;
269
- /** BT-3. */
270
- readonly type: InvoiceTypeCode;
271
- /** BT-5. */
272
- readonly currency: EInvoiceCurrency;
273
- /** The invoice number (BT-1). */
274
- readonly number: readonly Inline[];
275
- /** The issue date (BT-2). */
276
- readonly issued: Expression;
277
- readonly seller: EInvoiceSeller;
278
- readonly buyer: EInvoiceBuyer;
279
- /** The buyer's reference (BT-10). */
280
- readonly buyerReference?: readonly Inline[];
281
- /** The actual delivery date (BT-72). A delivery date, a period or both: a German invoice says when it was supplied. */
282
- readonly delivered?: Expression;
283
- readonly period?: InvoicingPeriod;
284
- /** The VAT categories its lines may be in, one at least. */
285
- readonly vat: readonly VatCategory[];
286
- readonly lines: EInvoiceLines;
287
- readonly payment?: PaymentInstructions;
288
- /** The payment due date (BT-9). */
289
- readonly due?: Expression;
290
- /** The payment terms (BT-20), where a Skonto is written. */
291
- readonly terms?: readonly Inline[];
292
- /** The amount already paid (BT-113), a whole number of cents. */
293
- readonly paid?: Expression;
294
- }
295
- type EInvoice = FacturXInvoice;
296
- //#endregion
297
- //#region src/epc-qr-code.d.ts
220
+ export declare const VALUE_SCOPES: readonly ["report", "table", "group", "row"];
221
+ type ValueScope = (typeof VALUE_SCOPES)[number];
298
222
  /**
299
- * What a code may be framed and captioned with: Austria's frame and the
300
- * words "Zahlen mit Code" (PSA v3.0 5), drawn inside the code's square.
301
- * Absent, the code is printed alone, as a QR code is.
223
+ * The names an expression reads in each scope, and nothing else: the
224
+ * runtime binds exactly these. `params` maps parameter ids to values,
225
+ * `header` the header dataset's fields, `row` the current detail row's,
226
+ * `totals` each aggregate over every detail row, `table` each aggregate
227
+ * over the rows the table prints (0062), and `group` each aggregate over
228
+ * the current group's rows and, as `GROUP_KEY`, the value the group is
229
+ * keyed by. A table's row condition is read in the row's scope, so it
230
+ * reads neither `table` nor `group`, which are totalled and made from the
231
+ * rows it selects.
232
+ *
233
+ * Whether an expression names only these is checked when the runtime
234
+ * compiles it (plan 15's second level), not here: a second, partial CEL
235
+ * parser would be a second place to disagree with the real one.
302
236
  */
303
- export declare const EPC_CAPTIONS: readonly ["zahlenMitCode"];
304
- type EpcCaption = (typeof EPC_CAPTIONS)[number];
237
+ export declare const EXPRESSION_NAMES: { readonly [S in ValueScope]: readonly string[]; };
305
238
  /**
306
- * An EPC QR code. Each text is runs, one at least where it is present; an
307
- * optional one absent is an element the code leaves empty, never an empty
308
- * list of runs, so that one code has one spelling and one hash.
239
+ * The member of `group` that is the value the group is keyed by: in a group
240
+ * header, `group.key` is the site a group of rows by site is for, of the
241
+ * type of the field the group's own table groups by, and null for the
242
+ * group of rows without one.
243
+ * An aggregate may not take the name (`reserved-id`), so `group.key` never
244
+ * reads one.
309
245
  */
310
- interface EpcQrCodeComponent extends ComponentBase {
311
- readonly kind: 'epcQrCode';
312
- /** The side of the square in points: the quiet zone, and the frame and caption when there are any, inside it. */
313
- readonly size: number;
314
- /** The beneficiary's name (AT-E001): at most 70 characters. */
315
- readonly beneficiary: readonly Inline[];
316
- /** The beneficiary's IBAN (AT-C001), of a country of SEPA. Spaces are for reading, and are dropped. */
317
- readonly iban: readonly Inline[];
318
- /** The BIC of the beneficiary's bank (AT-C002): needed for an account outside the EEA, and may be left out for one inside it. */
319
- readonly bic?: readonly Inline[];
320
- /** The amount in euro, a decimal of at most two places. Absent, or null, leaves the amount for the payer to fill in. */
321
- readonly amount?: Expression;
322
- /** The purpose code (AT-T007): four capital letters, written into the template. */
323
- readonly purpose?: string;
324
- /** A creditor reference (AT-T009, structured): RF and its check digits. Never with `text`. */
325
- readonly reference?: readonly Inline[];
326
- /** The remittance text (AT-T009, unstructured): at most 140 characters. Never with `reference`. */
327
- readonly text?: readonly Inline[];
328
- /** Information for the payer, shown by the banking app and not sent with the transfer: at most 70 characters. */
329
- readonly information?: readonly Inline[];
330
- readonly caption?: EpcCaption;
246
+ export declare const GROUP_KEY = "key";
247
+ export declare const FORMAT_KINDS: readonly ["number", "currency", "date", "text"];
248
+ type FormatKind = (typeof FORMAT_KINDS)[number];
249
+ export declare const DATE_STYLES: readonly ["short", "medium", "long"];
250
+ type DateStyle = (typeof DATE_STYLES)[number];
251
+ export declare const TEXT_TRANSFORMS: readonly ["upper", "lower"];
252
+ type TextTransform = (typeof TEXT_TRANSFORMS)[number];
253
+ interface NumberFormat {
254
+ readonly kind: 'number';
255
+ readonly scale: number;
256
+ readonly grouping: boolean;
331
257
  }
332
- //#endregion
333
- //#region src/payment-part.d.ts
334
- /**
335
- * The languages a QR-bill's headings may be printed in: German, French,
336
- * Italian, English, and Romansh since 1 January 2026 (IG 2.4, Annex C). A
337
- * report in any other language prints its slip in one of these.
338
- */
339
- export declare const QR_BILL_LANGUAGES: readonly ["de", "fr", "it", "en", "rm"];
340
- type QrBillLanguage = (typeof QR_BILL_LANGUAGES)[number];
341
- /** The currencies a QR-bill pays in, and the only ones (IG Table 8, Ccy). */
342
- export declare const QR_BILL_CURRENCIES: readonly ["CHF", "EUR"];
343
- type QrBillCurrency = (typeof QR_BILL_CURRENCIES)[number];
258
+ export declare const CURRENCY_SOURCE_KINDS: readonly ["code", "field", "parameter"];
259
+ type CurrencySourceKind = (typeof CURRENCY_SOURCE_KINDS)[number];
260
+ /** Which currency an amount is in: a code the template fixes, or a string field or parameter that supplies one per report or per row. */
261
+ type CurrencySource = {
262
+ readonly kind: 'code'; /** ISO 4217, upper case. */
263
+ readonly code: string;
264
+ } | {
265
+ readonly kind: 'field';
266
+ readonly field: FieldRef;
267
+ } | {
268
+ readonly kind: 'parameter';
269
+ readonly parameter: string;
270
+ };
271
+ interface CurrencyFormat {
272
+ readonly kind: 'currency';
273
+ readonly currency: CurrencySource;
274
+ readonly scale: number;
275
+ }
276
+ interface DateFormat {
277
+ readonly kind: 'date';
278
+ readonly style: DateStyle;
279
+ }
280
+ interface TextFormat {
281
+ readonly kind: 'text';
282
+ readonly transform?: TextTransform;
283
+ }
284
+ /** How a value is displayed. Display only: calculation precision is the runtime's, with its declared rounding. */
285
+ type Format = NumberFormat | CurrencyFormat | DateFormat | TextFormat;
344
286
  /**
345
- * A party's address, structured: the one address type SIX has taken since
346
- * version 2.3 removed the combined one. Each part is runs of text; what
347
- * each may hold is `QR_BILL_ADDRESS_RULES`.
287
+ * Where a run of a paragraph stands against its line (0061): set below it,
288
+ * a formula's digit, or above it, a unit's power, an exponent or a
289
+ * footnote's mark, smaller than the paragraph's text and moved, in any
290
+ * character its face draws. Absent, the run stands on the line. Only a
291
+ * text component's runs take one; a page counter takes none, and what a
292
+ * code encodes and a table's cells refuse one as `misplaced-baseline`.
348
293
  */
349
- interface QrBillAddress {
350
- /** A person's first and last name, or a company's: 70 characters. */
351
- readonly name: readonly Inline[];
352
- /** The street or post office box, without the building number: 70 characters. */
353
- readonly street?: readonly Inline[];
354
- readonly buildingNumber?: readonly Inline[];
355
- /** Without a country prefix. */
356
- readonly postalCode: readonly Inline[];
357
- readonly town: readonly Inline[];
358
- /** ISO 3166-1's two capital letters: CH. */
359
- readonly country: readonly Inline[];
294
+ export declare const BASELINE_SHIFTS: readonly ["subscript", "superscript"];
295
+ type BaselineShift = (typeof BASELINE_SHIFTS)[number];
296
+ interface TextInline {
297
+ readonly kind: 'text';
298
+ readonly text: string;
299
+ readonly baseline?: BaselineShift;
300
+ }
301
+ interface FieldInline {
302
+ readonly kind: 'field';
303
+ readonly field: FieldRef;
304
+ readonly format?: Format;
305
+ readonly baseline?: BaselineShift;
306
+ }
307
+ interface ParameterInline {
308
+ readonly kind: 'parameter';
309
+ readonly parameter: string;
310
+ readonly format?: Format;
311
+ readonly baseline?: BaselineShift;
312
+ }
313
+ interface ExpressionInline {
314
+ readonly kind: 'expression';
315
+ readonly expression: Expression;
316
+ readonly format?: Format;
317
+ readonly baseline?: BaselineShift;
360
318
  }
361
319
  /**
362
- * A Swiss QR-bill. Each text is runs, one at least where it is present; an
363
- * optional one absent is a field the bill leaves empty, never an empty
364
- * list of runs, so that one bill has one spelling and one hash.
320
+ * Whose rows an aggregate is taken over where it is printed: the current
321
+ * group's, the rows its table prints (0062), or every detail row.
365
322
  */
366
- interface SwissQrBill {
367
- readonly kind: 'swissQrBill';
368
- /** The language of the slip's headings, which may differ from the report's. */
369
- readonly language: QrBillLanguage;
370
- /** The creditor's IBAN or QR-IBAN, of Switzerland or Liechtenstein. Spaces are for reading, and are dropped. */
371
- readonly account: readonly Inline[];
372
- readonly creditor: QrBillAddress;
373
- readonly currency: QrBillCurrency;
374
- /** A decimal of at most two places. Absent, or null, leaves the amount for the payer to fill in. */
375
- readonly amount?: Expression;
376
- /** Who pays. Absent leaves a field for the payer's name and address. */
377
- readonly debtor?: QrBillAddress;
378
- /** A QR reference, with a QR-IBAN, or a creditor reference, with an IBAN. Absent, the bill has none. */
379
- readonly reference?: readonly Inline[];
380
- /** The unstructured message: what the payment is for. */
381
- readonly message?: readonly Inline[];
382
- /** Coded information for the payer's software, beginning with `//`. */
383
- readonly billingInformation?: readonly Inline[];
323
+ export declare const AGGREGATE_SCOPES: readonly ["group", "table", "report"];
324
+ type AggregateScope = (typeof AGGREGATE_SCOPES)[number];
325
+ interface AggregateInline {
326
+ readonly kind: 'aggregate';
327
+ /** An `AggregateDef` id. */
328
+ readonly aggregate: string;
329
+ readonly over: AggregateScope;
330
+ readonly format?: Format;
331
+ readonly baseline?: BaselineShift;
384
332
  }
385
- /** The kinds of payment part. A kind this version does not know is refused, never skipped. */
386
- export declare const PAYMENT_PART_KINDS: readonly ["swissQrBill"];
387
- type PaymentPartKind = (typeof PAYMENT_PART_KINDS)[number];
388
- type PaymentPart = SwissQrBill;
389
- //#endregion
390
- //#region src/types.d.ts
391
- export declare const PAGE_SIZE_NAMES: readonly ["A4", "Letter"];
392
- type PageSizeName = (typeof PAGE_SIZE_NAMES)[number];
393
- export declare const ORIENTATIONS: readonly ["portrait", "landscape"];
394
- type Orientation = (typeof ORIENTATIONS)[number];
395
- interface Margins {
396
- readonly top: number;
397
- readonly right: number;
398
- readonly bottom: number;
399
- readonly left: number;
333
+ /** The page's number, which the engine fills on each page; it takes no baseline. */
334
+ interface PageNumberInline {
335
+ readonly kind: 'pageNumber';
400
336
  }
401
- interface PageSettings {
402
- readonly size: PageSizeName;
403
- readonly orientation: Orientation;
404
- readonly margins: Margins;
337
+ /** How many pages the document has, which the engine fills; it takes no baseline. */
338
+ interface PageCountInline {
339
+ readonly kind: 'pageCount';
405
340
  }
341
+ export declare const INLINE_KINDS: readonly ["text", "field", "parameter", "expression", "aggregate", "pageNumber", "pageCount"];
342
+ type InlineKind = (typeof INLINE_KINDS)[number];
343
+ /**
344
+ * A run of text: literal, bound, computed, totalled or a page counter. The
345
+ * one shape for a paragraph's runs, a table cell, a footer cell and a group
346
+ * header. Null prints as nothing.
347
+ */
348
+ type Inline = TextInline | FieldInline | ParameterInline | ExpressionInline | AggregateInline | PageNumberInline | PageCountInline;
406
349
  export declare const FONT_FAMILIES: readonly ["sans", "serif", "mono"];
407
350
  type FontFamily = (typeof FONT_FAMILIES)[number];
408
351
  export declare const ALIGNMENTS: readonly ["left", "center", "right"];
@@ -423,191 +366,119 @@ interface PrintStyle {
423
366
  readonly color?: string;
424
367
  readonly align?: Alignment;
425
368
  }
426
- export declare const FIELD_TYPES: readonly ["string", "integer", "decimal", "boolean", "date", "datetime", "instant", "image"];
427
- type FieldType = (typeof FIELD_TYPES)[number];
369
+ /** A style applied when a condition holds: each rule that holds applies its style over the base one, in order, a later rule's property winning. */
370
+ interface StyleRule {
371
+ readonly when: Expression;
372
+ /** A `PrintStyle` id. */
373
+ readonly style: string;
374
+ }
428
375
  /**
429
- * A field a dataset contract promises.
430
- *
431
- * Values of exact types arrive as strings, never as JavaScript numbers. An
432
- * `image` field's value is an approved asset -- its id and its `sha256:`
433
- * digest -- which the host resolves to bytes, never an address: a photo or
434
- * a signature captured with a form arrives this way, and prints only as an
435
- * image. A field that is not nullable never holds null; one that is prints
436
- * null as nothing. A field the data lacks altogether is the runtime's error,
437
- * never an empty string.
438
- */
439
- interface FieldContract {
440
- /** A field key: what an expression reads it as, `header.<id>` or `row.<id>`. */
441
- readonly id: string;
442
- readonly type: FieldType;
443
- readonly label: string;
444
- readonly nullable: boolean;
445
- /** Digits after the decimal point; decimal fields only. */
446
- readonly scale?: number;
447
- }
448
- /**
449
- * A dataset the report reads, by the logical id a deployment's binding set
450
- * maps to a provider. The fields are the contract the template was written
451
- * against, so the template itself records which revision of the contract it
452
- * expects.
376
+ * The assets a report shows or prints in, each named by its id and pinned
377
+ * by its digest; the bytes are the deployment's. What a PNG's or a JPEG's
378
+ * bytes may be, `image-header.ts` reads, an SVG's, `svg.ts`, and a font's,
379
+ * `font.ts` (0040, 0043).
453
380
  */
454
- interface DatasetContract {
455
- readonly id: string;
456
- readonly fields: readonly FieldContract[];
457
- }
458
- /** The two datasets a version-0 report can read: one row of header data, and the one primary detail dataset. */
459
- export declare const DATASET_ROLES: readonly ["header", "detail"];
460
- type DatasetRole = (typeof DATASET_ROLES)[number];
461
- interface Datasets {
462
- readonly header?: DatasetContract;
463
- readonly detail?: DatasetContract;
464
- }
465
- export declare const PARAMETER_TYPES: readonly ["string", "integer", "decimal", "boolean", "date"];
466
- type ParameterType = (typeof PARAMETER_TYPES)[number];
467
- /** A value a person supplies before rendering, on a formancy form whose field key is the parameter's id (plan 12.4). */
468
- interface ParameterDef {
469
- /** A field key: what an expression reads it as, `params.<id>`. */
470
- readonly id: string;
471
- readonly type: ParameterType;
472
- readonly label: string;
473
- readonly required: boolean;
474
- /** A boolean for a boolean parameter; for every other type, the exact value as a string. */
475
- readonly default?: string | boolean;
476
- }
477
- /** An asset's bytes are a PNG, a JPEG, or an SVG in the form report-spec's `cleanSvg` writes (0030). */
381
+ /** An image asset's bytes are a PNG, a JPEG, or an SVG in the form report-spec's `cleanSvg` writes (0030). */
478
382
  export declare const ASSET_MEDIA_TYPES: readonly ["image/png", "image/jpeg", "image/svg+xml"];
479
383
  type AssetMediaType = (typeof ASSET_MEDIA_TYPES)[number];
384
+ /**
385
+ * A font asset's bytes are a TrueType font (`font/ttf`, RFC 8081), read by
386
+ * `readFont` (0040). An OpenType CFF font (`font/otf`) is not admitted:
387
+ * `readFont` reads no CFF outlines and refuses `OTTO` bytes, and the
388
+ * e-invoice gate has not proved a CFF face embeds in a PDF/A-3b (FT-Q15,
389
+ * 0043).
390
+ */
391
+ export declare const FONT_MEDIA_TYPES: readonly ["font/ttf"];
392
+ type FontMediaType = (typeof FONT_MEDIA_TYPES)[number];
393
+ /** Every media type an asset may declare: an image's, or a font's. */
394
+ export declare const ASSET_AND_FONT_MEDIA_TYPES: readonly ["image/png", "image/jpeg", "image/svg+xml", "font/ttf"];
395
+ type AnyAssetMediaType = AssetMediaType | FontMediaType;
396
+ /** Whether `mediaType` is a font's, not an image's. */
397
+ export declare function isFontMediaType(mediaType: string): mediaType is FontMediaType;
480
398
  /**
481
399
  * An approved asset, named by id and pinned by digest. The bytes never live
482
400
  * in the definition, and rendering never follows a mutable "latest" asset
483
- * (plan 17): a new logo is a new digest and a new template release.
401
+ * (plan 17): a new logo, or a new typeface, is a new digest and a new
402
+ * template release.
484
403
  */
485
404
  interface AssetRef {
486
405
  readonly id: string;
487
- readonly mediaType: AssetMediaType;
406
+ readonly mediaType: AnyAssetMediaType;
488
407
  /** `sha256:` and 64 lower-case hex digits. */
489
408
  readonly digest: string;
490
409
  }
491
- /** A CEL expression, compiled and bounded by the runtime, not here. */
492
- interface Expression {
493
- readonly cel: string;
494
- }
495
410
  /**
496
- * Where a value is read, which decides what it can name (plan 15's "current
497
- * row, group or report"): `row` in a table cell, once per detail row;
498
- * `group` in a group header or footer, once per group; `report` everywhere
499
- * else, the table's total rows included.
411
+ * The faces of one family a report may map, as pdfmake draws text in each
412
+ * weight and slant: `normal` always, and `bold`, `italic` and `boldItalic`
413
+ * where the report prints text in them. A face is never synthesised from
414
+ * another -- pdfmake's own faux bold and oblique are a substitution nobody
415
+ * sees until the PDF is read (plan 20) -- so a report that prints bold text
416
+ * in a mapped family maps that family's bold face, or the renderer refuses
417
+ * it.
500
418
  */
501
- export declare const VALUE_SCOPES: readonly ["report", "group", "row"];
502
- type ValueScope = (typeof VALUE_SCOPES)[number];
503
- /**
504
- * The names an expression reads in each scope, and nothing else: the
505
- * runtime binds exactly these. `params` maps parameter ids to values,
506
- * `header` the header dataset's fields, `row` the current detail row's,
507
- * `totals` each aggregate over every detail row, and `group` each aggregate
508
- * over the current group's rows and, as `GROUP_KEY`, the value the group
509
- * is keyed by.
419
+ export declare const FONT_FACE_KEYS: readonly ["normal", "bold", "italic", "boldItalic"];
420
+ type FontFaceKey = (typeof FONT_FACE_KEYS)[number];
421
+ /** The approved font assets a family's faces print in, each named by its asset id; `normal` is required, the rest are mapped where the report prints them. */
422
+ interface FontFaces {
423
+ readonly normal: string;
424
+ readonly bold?: string;
425
+ readonly italic?: string;
426
+ readonly boldItalic?: string;
427
+ }
428
+ /** A report's font map: the token-to-faces mapping for whichever of the three families it maps. Absent, or a token left out, the renderer prints that token in its own face. */
429
+ type FontMap = { readonly [F in FontFamily]?: FontFaces; };
430
+ /** The face a run of text in this weight and slant prints in. */
431
+ export declare function faceKey(bold: boolean, italic: boolean): FontFaceKey;
432
+ /**
433
+ * The characters a report prints, by code point (0043, FT-Q16).
510
434
  *
511
- * Whether an expression names only these is checked when the runtime
512
- * compiles it (plan 15's second level), not here: a second, partial CEL
513
- * parser would be a second place to disagree with the real one.
514
- */
515
- export declare const EXPRESSION_NAMES: { readonly [S in ValueScope]: readonly string[]; };
516
- /**
517
- * The member of `group` that is the value the group is keyed by: in a group
518
- * header, `group.key` is the site a group of rows by site is for, of the
519
- * type of the field grouped by, and null for the group of rows without one.
520
- * An aggregate may not take the name (`reserved-id`), so `group.key` never
521
- * reads one.
522
- */
523
- export declare const GROUP_KEY = "key";
524
- /** A field of the header or the detail dataset: the one way the format refers to one. */
525
- interface FieldRef {
526
- readonly dataset: DatasetRole;
527
- readonly field: string;
528
- }
529
- export declare const FORMAT_KINDS: readonly ["number", "currency", "date", "text"];
530
- type FormatKind = (typeof FORMAT_KINDS)[number];
531
- export declare const DATE_STYLES: readonly ["short", "medium", "long"];
532
- type DateStyle = (typeof DATE_STYLES)[number];
533
- export declare const TEXT_TRANSFORMS: readonly ["upper", "lower"];
534
- type TextTransform = (typeof TEXT_TRANSFORMS)[number];
535
- interface NumberFormat {
536
- readonly kind: 'number';
537
- readonly scale: number;
538
- readonly grouping: boolean;
539
- }
540
- export declare const CURRENCY_SOURCE_KINDS: readonly ["code", "field", "parameter"];
541
- type CurrencySourceKind = (typeof CURRENCY_SOURCE_KINDS)[number];
542
- /** Which currency an amount is in: a code the template fixes, or a string field or parameter that supplies one per report or per row. */
543
- type CurrencySource = {
544
- readonly kind: 'code'; /** ISO 4217, upper case. */
545
- readonly code: string;
546
- } | {
547
- readonly kind: 'field';
548
- readonly field: FieldRef;
549
- } | {
550
- readonly kind: 'parameter';
551
- readonly parameter: string;
552
- };
553
- interface CurrencyFormat {
554
- readonly kind: 'currency';
555
- readonly currency: CurrencySource;
556
- readonly scale: number;
557
- }
558
- interface DateFormat {
559
- readonly kind: 'date';
560
- readonly style: DateStyle;
561
- }
562
- interface TextFormat {
563
- readonly kind: 'text';
564
- readonly transform?: TextTransform;
565
- }
566
- /** How a value is displayed. Display only: calculation precision is the runtime's, with its declared rounding. */
567
- type Format = NumberFormat | CurrencyFormat | DateFormat | TextFormat;
568
- interface TextInline {
569
- readonly kind: 'text';
570
- readonly text: string;
571
- }
572
- interface FieldInline {
573
- readonly kind: 'field';
574
- readonly field: FieldRef;
575
- readonly format?: Format;
576
- }
577
- interface ParameterInline {
578
- readonly kind: 'parameter';
579
- readonly parameter: string;
580
- readonly format?: Format;
581
- }
582
- interface ExpressionInline {
583
- readonly kind: 'expression';
584
- readonly expression: Expression;
585
- readonly format?: Format;
586
- }
587
- /** Whose rows an aggregate is taken over where it is printed: the current group's, or every detail row. */
588
- export declare const AGGREGATE_SCOPES: readonly ["group", "report"];
589
- type AggregateScope = (typeof AGGREGATE_SCOPES)[number];
590
- interface AggregateInline {
591
- readonly kind: 'aggregate';
592
- /** An `AggregateDef` id. */
593
- readonly aggregate: string;
594
- readonly over: AggregateScope;
595
- readonly format?: Format;
596
- }
597
- interface PageNumberInline {
598
- readonly kind: 'pageNumber';
599
- }
600
- interface PageCountInline {
601
- readonly kind: 'pageCount';
602
- }
603
- export declare const INLINE_KINDS: readonly ["text", "field", "parameter", "expression", "aggregate", "pageNumber", "pageCount"];
604
- type InlineKind = (typeof INLINE_KINDS)[number];
605
- /**
606
- * A run of text: literal, bound, computed, totalled or a page counter. The
607
- * one shape for a paragraph's runs, a table cell, a footer cell and a group
608
- * header. Null prints as nothing.
609
- */
610
- type Inline = TextInline | FieldInline | ParameterInline | ExpressionInline | AggregateInline | PageNumberInline | PageCountInline;
435
+ * pdfmake lays text out left to right and reorders nothing, and the
436
+ * renderer removes a host face's layout tables before it embeds it
437
+ * (report-render-pdf's `strip-layout.ts`), so fontkit substitutes and
438
+ * positions nothing at print either: each character prints as the glyph
439
+ * its face maps it to. That prints Latin, Greek and Cyrillic, and the
440
+ * punctuation, symbols and combining marks written with them, which the
441
+ * corpus proves on the PDF. It does not print a right-to-left script, a
442
+ * script whose letters join or reorder, or CJK, and nothing here has proved
443
+ * any other. So the list is of what prints, not of what is refused: a
444
+ * character prints only where it lies in one of `PRINTED_BLOCKS` and is not
445
+ * one of `BIDI_CONTROLS`, and every other is refused, in any face, Roboto's
446
+ * included, until a fixture proves its script.
447
+ *
448
+ * The bounds are Unicode's blocks, read from `Blocks.txt` 18.0.0, and the
449
+ * controls are its `PropList.txt`'s Bidi_Control; 0043 gives both files'
450
+ * addresses and digests. Seven entries take part of a block and say so in
451
+ * their names: Spacing Modifier Letters and Greek and Coptic each in two,
452
+ * around the Bopomofo tone marks and the Coptic letters they hold; the
453
+ * Latin ligatures of Alphabetic Presentation Forms, whose rest is Armenian
454
+ * and Hebrew; the byte-order mark alone of Arabic Presentation Forms-B; and
455
+ * the two replacement characters of Specials.
456
+ * `font-scripts.test.ts` holds each entry's bounds and order, and
457
+ * report-render-pdf's `scripts.test.ts` every character of every entry to
458
+ * the script fontkit's own Unicode data gives it; that the bounds are
459
+ * Blocks.txt's is review-held.
460
+ */
461
+ /** The Unicode version the blocks and the controls were read from. */
462
+ export declare const UNICODE_VERSION = "18.0.0";
463
+ /** A run of code points that prints: a block, or the named part of one, with its inclusive bounds. */
464
+ interface PrintedBlock {
465
+ readonly block: string;
466
+ readonly from: number;
467
+ readonly to: number;
468
+ }
469
+ /** What prints, in code-point order, every entry in the Basic Multilingual Plane. */
470
+ export declare const PRINTED_BLOCKS: readonly PrintedBlock[];
471
+ /**
472
+ * The bidirectional controls in the blocks that print, PropList.txt's
473
+ * Bidi_Control but for U+061C, the Arabic letter mark, which is in no
474
+ * printed block. pdfmake reorders nothing and fontkit draws a control as a
475
+ * space, so each is refused rather than printed as one.
476
+ */
477
+ export declare const BIDI_CONTROLS: ReadonlySet<number>;
478
+ /** Why a report does not print a character: its script is one nothing here prints, or it is a bidirectional control. */
479
+ type CharacterRefusal = 'script' | 'bidi-control';
480
+ /** Why `point` does not print, or undefined where it does; a binary search of `PRINTED_BLOCKS`. */
481
+ export declare function refusedCharacter(point: number): CharacterRefusal | undefined;
611
482
  /** What an aggregate reads from each detail row: a detail field, or an expression over the row. */
612
483
  type RowValue = {
613
484
  readonly kind: 'field';
@@ -652,81 +523,246 @@ interface AggregateDef {
652
523
  readonly of?: RowValue;
653
524
  readonly rounding?: Rounding;
654
525
  }
655
- /** A style applied when a condition holds: each rule that holds applies its style over the base one, in order, a later rule's property winning. */
656
- interface StyleRule {
657
- readonly when: Expression;
658
- /** A `PrintStyle` id. */
659
- readonly style: string;
526
+ export declare const CHART_KINDS: readonly ["bar", "line", "pie"];
527
+ type ChartKind = (typeof CHART_KINDS)[number];
528
+ /** The order a chart lists its categories in: as the rows first have them, or sorted by the category, least or greatest first. */
529
+ export declare const CHART_ORDERS: readonly ["data", "asc", "desc"];
530
+ type ChartOrder = (typeof CHART_ORDERS)[number];
531
+ /** The types a category may be: text, a date, or a number. A boolean, a moment or an image names no group a reader would look for. Held by the validator. */
532
+ export declare const CHART_CATEGORY_TYPES: readonly FieldType[];
533
+ /** What a pie may total: a share of an average, a minimum or a maximum is no share of a whole. Held by the validator. */
534
+ export declare const PIE_FUNCTIONS: readonly AggregateFunction[];
535
+ /**
536
+ * The colours a series is drawn in, by its place in the chart (a pie's
537
+ * slices by the category's): eight, each at least 3:1 against white paper
538
+ * (WCAG 2.2 1.4.11), the least `#1b9e77` at 3.39. A chart's own `palette`
539
+ * overrides them. Held by `chart.test.ts`.
540
+ */
541
+ export declare const CHART_PALETTE: readonly ["#1f77b4", "#d95f02", "#1b9e77", "#7570b3", "#e7298a", "#5a8f1a", "#a6761d", "#666666"];
542
+ /** What the chart groups the detail rows by: one group, one category, for each value the field takes. */
543
+ interface ChartCategory {
544
+ readonly field: FieldRef;
545
+ readonly order: ChartOrder;
546
+ /** How the category prints; it must display the field's type. */
547
+ readonly format?: Format;
548
+ /** The label of the rows whose category is null, never blank; asked of a field that may be null. */
549
+ readonly nullLabel?: string;
660
550
  }
661
- /** What every component has: a stable id, and optionally a condition and print styles. */
662
- interface ComponentBase {
551
+ /** One thing a chart totals for each category: a function over a detail field, as an aggregate's, with `avg` declaring its rounding. */
552
+ interface ChartSeries {
553
+ /** Unique in the chart. */
663
554
  readonly id: string;
664
- readonly visibleWhen?: Expression;
665
- /** A `PrintStyle` id. */
666
- readonly style?: string;
667
- readonly styleWhen?: readonly StyleRule[];
668
- }
669
- interface TextComponent extends ComponentBase {
670
- readonly kind: 'text';
671
- readonly content: readonly Inline[];
672
- /** Never the last block on a page when something follows it: a heading moves with what it heads. */
673
- readonly keepWithNext?: boolean;
555
+ /** The legend's entry. */
556
+ readonly label: string;
557
+ readonly fn: AggregateFunction;
558
+ /** Absent only for `count`, which then counts rows. */
559
+ readonly of?: FieldRef;
560
+ readonly rounding?: Rounding;
674
561
  }
675
- export declare const IMAGE_FITS: readonly ["contain", "cover"];
676
- type ImageFit = (typeof IMAGE_FITS)[number];
677
- export declare const IMAGE_SOURCE_KINDS: readonly ["asset", "field"];
678
- type ImageSourceKind = (typeof IMAGE_SOURCE_KINDS)[number];
679
- /** What an image shows: an asset the template pins, the same in every render, or an image field of the header dataset, one per render. */
680
- type ImageSource = {
681
- readonly kind: 'asset'; /** An `AssetRef` id. */
682
- readonly asset: string;
683
- } | {
684
- readonly kind: 'field';
685
- readonly field: FieldRef;
686
- };
687
- /** An image drawn in a box of fixed size; the width and the height bound it whatever its source holds. */
688
- interface ImageComponent extends ComponentBase {
689
- readonly kind: 'image';
690
- readonly source: ImageSource;
562
+ /** A chart drawn in a box of fixed size; the width and the height bound it whatever its data holds. */
563
+ interface ChartComponent extends ComponentBase {
564
+ readonly kind: 'chart';
565
+ readonly chart: ChartKind;
566
+ readonly dataset: 'detail';
691
567
  readonly width: number;
692
568
  readonly height: number;
693
- readonly fit: ImageFit;
569
+ readonly category: ChartCategory;
570
+ readonly series: readonly ChartSeries[];
571
+ /**
572
+ * How every value prints: each tick, each value label, and a pie's values.
573
+ * A pie's shares, printed beside its values where it labels them, are not
574
+ * this format's: each is the exact ratio rounded once, half away from zero,
575
+ * to a percentage of one place, written as the locale writes one (the
576
+ * runtime's `SHARE_PLACES`).
577
+ */
578
+ readonly valueFormat: NumberFormat | CurrencyFormat;
579
+ /** What prints in place of a chart with nothing to draw. */
580
+ readonly emptyText: string;
581
+ readonly title?: string;
582
+ readonly categoryTitle?: string;
583
+ readonly valueTitle?: string;
584
+ readonly valueLabels?: boolean;
585
+ /** Replaces `CHART_PALETTE`: one to eight distinct colours, and in a bar or a line chart at least one for each series. */
586
+ readonly palette?: readonly string[];
694
587
  }
695
588
  /**
696
- * How much of a QR code may be lost and its content still read: ISO/IEC
697
- * 18004's four levels, which restore about 7, 15, 25 and 30 % of the
698
- * codewords. A higher level holds less content in the same square.
589
+ * What a code may be framed and captioned with: Austria's frame and the
590
+ * words "Zahlen mit Code" (PSA v3.0 5), drawn inside the code's square.
591
+ * Absent, the code is printed alone, as a QR code is.
699
592
  */
700
- export declare const QR_ERROR_CORRECTION: readonly ["L", "M", "Q", "H"];
701
- type QrErrorCorrection = (typeof QR_ERROR_CORRECTION)[number];
593
+ export declare const EPC_CAPTIONS: readonly ["zahlenMitCode"];
594
+ type EpcCaption = (typeof EPC_CAPTIONS)[number];
702
595
  /**
703
- * A QR code of the text its content prints, drawn as a square of fixed
704
- * size. The content is read once, as a paragraph's in the same place is,
705
- * and resolved whole before there are pages: it never holds a page number
706
- * or count, in any region.
596
+ * An EPC QR code. Each text is runs, one at least where it is present; an
597
+ * optional one absent is an element the code leaves empty, never an empty
598
+ * list of runs, so that one code has one spelling and one hash.
707
599
  */
708
- interface QrCodeComponent extends ComponentBase {
709
- readonly kind: 'qrCode';
710
- readonly content: readonly Inline[];
711
- /** The side of the square in points, the quiet zone around the modules included. */
600
+ interface EpcQrCodeComponent extends ComponentBase {
601
+ readonly kind: 'epcQrCode';
602
+ /** The side of the square in points: the quiet zone, and the frame and caption when there are any, inside it. */
712
603
  readonly size: number;
713
- readonly errorCorrection: QrErrorCorrection;
714
- }
715
- interface LineComponent extends ComponentBase {
716
- readonly kind: 'line';
717
- readonly thickness: number;
718
- readonly color?: string;
719
- }
720
- interface RectangleComponent extends ComponentBase {
721
- readonly kind: 'rectangle';
722
- readonly width: number;
723
- readonly height: number;
724
- readonly fill?: string;
725
- readonly stroke?: string;
604
+ /** The beneficiary's name (AT-E001): at most 70 characters. */
605
+ readonly beneficiary: readonly Inline[];
606
+ /** The beneficiary's IBAN (AT-C001), of a country of SEPA. Spaces are for reading, and are dropped. */
607
+ readonly iban: readonly Inline[];
608
+ /** The BIC of the beneficiary's bank (AT-C002): needed for an account outside the EEA, and may be left out for one inside it. */
609
+ readonly bic?: readonly Inline[];
610
+ /** The amount in euro, a decimal of at most two places. Absent, or null, leaves the amount for the payer to fill in. */
611
+ readonly amount?: Expression;
612
+ /** The purpose code (AT-T007): four capital letters, written into the template. */
613
+ readonly purpose?: string;
614
+ /** A creditor reference (AT-T009, structured): RF and its check digits. Never with `text`. */
615
+ readonly reference?: readonly Inline[];
616
+ /** The remittance text (AT-T009, unstructured): at most 140 characters. Never with `reference`. */
617
+ readonly text?: readonly Inline[];
618
+ /** Information for the payer, shown by the banking app and not sent with the transfer: at most 70 characters. */
619
+ readonly information?: readonly Inline[];
620
+ readonly caption?: EpcCaption;
726
621
  }
727
- interface SpacerComponent extends ComponentBase {
728
- readonly kind: 'spacer';
729
- readonly height: number;
622
+ export declare const SORT_DIRECTIONS: readonly ["asc", "desc"];
623
+ type SortDirection = (typeof SORT_DIRECTIONS)[number];
624
+ interface SortKey {
625
+ /** A detail field. */
626
+ readonly field: FieldRef;
627
+ readonly direction: SortDirection;
628
+ }
629
+ interface TableColumn {
630
+ /** Unique within its table. */
631
+ readonly id: string;
632
+ /** Its title in the header row, a literal; where every shown column's is empty or white space, the table has no header row (0078). */
633
+ readonly header: string;
634
+ readonly width: Width;
635
+ readonly align: Alignment;
636
+ /** Read once per detail row. */
637
+ readonly value: Inline;
638
+ /** Read once per report: a hidden column gives its width to the fill columns, and its footer cells hide with it. */
639
+ readonly visibleWhen?: Expression;
640
+ readonly style?: string;
641
+ /** Read once per detail row. */
642
+ readonly styleWhen?: readonly StyleRule[];
643
+ }
644
+ interface TableFooterCell {
645
+ /** A column id of the same table. */
646
+ readonly column: string;
647
+ readonly value: Inline;
648
+ }
649
+ /** A row under a group or under the table: a subtotal, a tax line, a total. One under the table is read in the `table` scope, where `table` totals the rows the table prints. */
650
+ interface TableFooterRow {
651
+ readonly cells: readonly TableFooterCell[];
652
+ readonly style?: string;
653
+ }
654
+ /**
655
+ * One grouping level, the only one version 0 has. Rows are ordered by the
656
+ * group's key first, then by the table's sort keys; rows whose keys are all
657
+ * equal keep the order the provider gave them.
658
+ */
659
+ interface TableGroup {
660
+ /** A detail field. */
661
+ readonly by: FieldRef;
662
+ readonly direction: SortDirection;
663
+ /** One line across the table, read once per group. */
664
+ readonly header: readonly Inline[];
665
+ readonly headerStyle?: string;
666
+ /**
667
+ * How many of the group's first rows its header is kept on its page
668
+ * with, from 1 to `MAX_KEEP_WITH_ROWS`; absent, one, the rule every group
669
+ * header has had. The group's own, so that each level of a later nesting
670
+ * states its own (0059).
671
+ */
672
+ readonly keepWithRows?: number;
673
+ readonly footer: readonly TableFooterRow[];
674
+ }
675
+ /**
676
+ * A table over the report's one detail dataset. Its header repeats on every
677
+ * page it reaches; version 0 has no other choice. A table none of whose
678
+ * shown columns' titles prints anything has no header row (0078).
679
+ */
680
+ interface TableComponent extends ComponentBase {
681
+ readonly kind: 'table';
682
+ readonly dataset: 'detail';
683
+ /**
684
+ * Read once per detail row, in its scope, in the provider's order and
685
+ * before anything is ordered: the table prints, orders, groups and
686
+ * totals the rows for which it holds. Absent, every row (0062).
687
+ */
688
+ readonly rowsWhen?: Expression;
689
+ readonly columns: readonly TableColumn[];
690
+ readonly headerStyle?: string;
691
+ readonly sort?: readonly SortKey[];
692
+ readonly group?: TableGroup;
693
+ readonly totals?: readonly TableFooterRow[];
694
+ readonly emptyText: string;
695
+ readonly repeatHeader: true;
696
+ }
697
+ /** What every component has: a stable id, and optionally a condition and print styles. */
698
+ interface ComponentBase {
699
+ readonly id: string;
700
+ readonly visibleWhen?: Expression;
701
+ /** A `PrintStyle` id. */
702
+ readonly style?: string;
703
+ readonly styleWhen?: readonly StyleRule[];
704
+ }
705
+ interface TextComponent extends ComponentBase {
706
+ readonly kind: 'text';
707
+ readonly content: readonly Inline[];
708
+ /** Never the last block on a page when something follows it: a heading moves with what it heads. */
709
+ readonly keepWithNext?: boolean;
710
+ }
711
+ export declare const IMAGE_FITS: readonly ["contain", "cover"];
712
+ type ImageFit = (typeof IMAGE_FITS)[number];
713
+ export declare const IMAGE_SOURCE_KINDS: readonly ["asset", "field"];
714
+ type ImageSourceKind = (typeof IMAGE_SOURCE_KINDS)[number];
715
+ /** What an image shows: an asset the template pins, the same in every render, or an image field of the header dataset, one per render. */
716
+ type ImageSource = {
717
+ readonly kind: 'asset'; /** An `AssetRef` id. */
718
+ readonly asset: string;
719
+ } | {
720
+ readonly kind: 'field';
721
+ readonly field: FieldRef;
722
+ };
723
+ /** An image drawn in a box of fixed size; the width and the height bound it whatever its source holds. */
724
+ interface ImageComponent extends ComponentBase {
725
+ readonly kind: 'image';
726
+ readonly source: ImageSource;
727
+ readonly width: number;
728
+ readonly height: number;
729
+ readonly fit: ImageFit;
730
+ }
731
+ /**
732
+ * How much of a QR code may be lost and its content still read: ISO/IEC
733
+ * 18004's four levels, which restore about 7, 15, 25 and 30 % of the
734
+ * codewords. A higher level holds less content in the same square.
735
+ */
736
+ export declare const QR_ERROR_CORRECTION: readonly ["L", "M", "Q", "H"];
737
+ type QrErrorCorrection = (typeof QR_ERROR_CORRECTION)[number];
738
+ /**
739
+ * A QR code of the text its content prints, drawn as a square of fixed
740
+ * size. The content is read once, as a paragraph's in the same place is,
741
+ * and resolved whole before there are pages: it never holds a page number
742
+ * or count, in any region.
743
+ */
744
+ interface QrCodeComponent extends ComponentBase {
745
+ readonly kind: 'qrCode';
746
+ readonly content: readonly Inline[];
747
+ /** The side of the square in points, the quiet zone around the modules included. */
748
+ readonly size: number;
749
+ readonly errorCorrection: QrErrorCorrection;
750
+ }
751
+ interface LineComponent extends ComponentBase {
752
+ readonly kind: 'line';
753
+ readonly thickness: number;
754
+ readonly color?: string;
755
+ }
756
+ interface RectangleComponent extends ComponentBase {
757
+ readonly kind: 'rectangle';
758
+ readonly width: number;
759
+ readonly height: number;
760
+ readonly fill?: string;
761
+ readonly stroke?: string;
762
+ }
763
+ interface SpacerComponent extends ComponentBase {
764
+ readonly kind: 'spacer';
765
+ readonly height: number;
730
766
  }
731
767
  /** A width in points, or a share of what fixed widths leave. */
732
768
  type Width = number | 'fill';
@@ -757,81 +793,478 @@ interface SectionComponent extends ComponentBase {
757
793
  /** Points between the border and the content. */
758
794
  readonly padding?: number;
759
795
  }
760
- export declare const SORT_DIRECTIONS: readonly ["asc", "desc"];
761
- type SortDirection = (typeof SORT_DIRECTIONS)[number];
762
- interface SortKey {
763
- /** A detail field. */
764
- readonly field: FieldRef;
765
- readonly direction: SortDirection;
796
+ interface PageBreakComponent extends ComponentBase {
797
+ readonly kind: 'pageBreak';
766
798
  }
767
- interface TableColumn {
768
- /** Unique within its table. */
799
+ interface KeepTogetherComponent extends ComponentBase {
800
+ readonly kind: 'keepTogether';
801
+ readonly components: readonly Component[];
802
+ }
803
+ export declare const COMPONENT_KINDS: readonly ["text", "image", "qrCode", "epcQrCode", "line", "rectangle", "spacer", "columns", "section", "table", "chart", "pageBreak", "keepTogether"];
804
+ type ComponentKind = (typeof COMPONENT_KINDS)[number];
805
+ type Component = TextComponent | ImageComponent | QrCodeComponent | EpcQrCodeComponent | LineComponent | RectangleComponent | SpacerComponent | ColumnsComponent | SectionComponent | TableComponent | ChartComponent | PageBreakComponent | KeepTogetherComponent;
806
+ /** The kinds of e-invoice. A kind this version does not know is refused, never skipped. */
807
+ export declare const E_INVOICE_KINDS: readonly ["facturX", "xrechnung"];
808
+ type EInvoiceKind = (typeof E_INVOICE_KINDS)[number];
809
+ /** The XRechnung versions this version writes: 3.0, the major and minor version its BT-24 names, of which KoSIT's 3.0.2 is the release the e-invoice gate's configuration pins. 4.0 is not backward compatible, and waits. */
810
+ export declare const XRECHNUNG_VERSIONS: readonly ["3.0"];
811
+ type XRechnungVersion = (typeof XRECHNUNG_VERSIONS)[number];
812
+ /** What names each XRechnung version: its specification identifier (BT-24), the release of KoSIT's it is read from, and the syntax it is written in. */
813
+ interface XRechnungTerms {
814
+ /** BT-24: `XR-CIUS-ID` of KoSIT's XRechnung schematron, which its scenario `EN16931 XRechnung (CII)` matches the XML by. */
815
+ readonly guideline: string;
816
+ /** The release of KoSIT's XRechnung the gate's configuration pins (`docs/release/e-invoice-tools.json`), which the e-invoice gate holds it to on every run. */
817
+ readonly release: string;
818
+ /** CII, the one syntax the runtime writes: UBL, which KoSIT takes too, would be a second writer of one invoice (0027, 0038). */
819
+ readonly syntax: 'cii';
820
+ }
821
+ /**
822
+ * Each version's names. A table over every version, so a version added to
823
+ * `XRECHNUNG_VERSIONS` without them does not compile. BT-24 is
824
+ * `XR-CIUS-ID` as `resources/xrechnung/3.0.2/xsl/XRechnung-CII-validation.xsl`
825
+ * of KoSIT's configuration of 2026-08-31 builds it, read on 21 October
826
+ * 2026; the e-invoice gate holds it to that file on every run, and KoSIT
827
+ * matches the XRechnung sample to its scenario by it.
828
+ */
829
+ export declare const XRECHNUNG: { readonly [V in XRechnungVersion]: XRechnungTerms; };
830
+ /** The Factur-X profiles this version writes: EN 16931 alone, which Germany counts as an e-invoice and FeRD recommends. */
831
+ export declare const E_INVOICE_PROFILES: readonly ["en16931"];
832
+ type EInvoiceProfile = (typeof E_INVOICE_PROFILES)[number];
833
+ /** The invoice type codes (BT-3, UNTDID 1001) this version writes: 380, a commercial invoice. No credit note yet. */
834
+ export declare const INVOICE_TYPE_CODES: readonly ["380"];
835
+ type InvoiceTypeCode = (typeof INVOICE_TYPE_CODES)[number];
836
+ /** The currencies (BT-5, ISO 4217) this version writes: EUR. A second would bring BT-6 and BT-111 with it. */
837
+ export declare const E_INVOICE_CURRENCIES: readonly ["EUR"];
838
+ type EInvoiceCurrency = (typeof E_INVOICE_CURRENCIES)[number];
839
+ /**
840
+ * The VAT categories (BT-118, BT-151; UNCL 5305) this version writes:
841
+ * standard rated, exempt from VAT, and reverse charge. CEN's BR-CL-17 and
842
+ * BR-CL-18 take seven more, Z, K, G, O, L, M and B, which wait.
843
+ */
844
+ export declare const VAT_CATEGORY_CODES: readonly ["S", "E", "AE"];
845
+ type VatCategoryCode = (typeof VAT_CATEGORY_CODES)[number];
846
+ /** The payment means (BT-81, UNTDID 4461) this version writes: 58, a SEPA credit transfer, and 30, a credit transfer. */
847
+ export declare const PAYMENT_MEANS_CODES: readonly ["58", "30"];
848
+ type PaymentMeansCode = (typeof PAYMENT_MEANS_CODES)[number];
849
+ /**
850
+ * The units of measure (BT-130; UN/ECE Recommendation 20, revision 11e) a
851
+ * line's quantity may be in, and no other (BR-CL-23): the counted, time,
852
+ * mass, length, area, volume and energy units a German invoice is written
853
+ * in. CEN takes 2,162; the packaging codes of Recommendation 21 among them
854
+ * wait.
855
+ */
856
+ export declare const UNIT_CODES: readonly ["C62", "H87", "SET", "PR", "LS", "MIN", "HUR", "DAY", "WEE", "MON", "ANN", "GRM", "KGM", "TNE", "MTR", "KMT", "MTK", "MTQ", "MLT", "LTR", "KWH"];
857
+ type UnitCode = (typeof UNIT_CODES)[number];
858
+ /**
859
+ * The countries (BT-40, BT-55; ISO 3166-1 alpha-2) a seller or a buyer may
860
+ * be in, and no other (BR-CL-14): the 27 member states of the EU, the EEA's
861
+ * Iceland, Liechtenstein and Norway, Switzerland, and the United Kingdom.
862
+ * CEN takes 251. Greece is GR here, and EL only as a VAT prefix.
863
+ */
864
+ export declare const COUNTRY_CODES: readonly ["AT", "BE", "BG", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GR", "HR", "HU", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PL", "PT", "RO", "SE", "SI", "SK", "IS", "LI", "NO", "CH", "GB"];
865
+ type CountryCode = (typeof COUNTRY_CODES)[number];
866
+ /**
867
+ * The prefixes a VAT identifier (BT-31, BT-48) may begin with (BR-CO-09):
868
+ * a country of `COUNTRY_CODES`, or EL, which Greece writes its VAT
869
+ * identifiers with. BR-CO-09's message allows EL in both releases, but only
870
+ * 1.3.16's test, which the pinned validators run, holds it; 1.3.17's does
871
+ * not. EL is taken while the pinned oracle takes it, and the gate fails on
872
+ * the release that does not.
873
+ */
874
+ export declare const VAT_PREFIXES: readonly string[];
875
+ /**
876
+ * The schemes (BT-30-1, BT-47-1; ISO 6523 ICD) a legal registration
877
+ * identifier may be given in, and no other (BR-CL-11). An identifier may be
878
+ * given without one, as a German commercial register number is. France's
879
+ * SIREN and SIRET, since a French buyer's SIREN is the one detail of
880
+ * France's the XML holds; and the two that name a company anywhere. CEN
881
+ * takes 246. The Leitweg-ID, 0204, which routes an invoice to a German
882
+ * public buyer, is no legal registration: an XRechnung names it as the
883
+ * buyer's reference (BT-10) and as an electronic address
884
+ * (`ADDRESS_SCHEMES`, 0038).
885
+ */
886
+ export declare const SCHEME_IDS: readonly ["0002", "0009", "0060", "0088"];
887
+ type SchemeId = (typeof SCHEME_IDS)[number];
888
+ /**
889
+ * The schemes (BT-34-1, BT-49-1; the CEF's Electronic Address Scheme code
890
+ * list) an electronic address may be given in, and no other (BR-CL-25),
891
+ * each code found on 20 October 2026 in BR-CL-25's list of the CEN 1.3.16
892
+ * schematron KoSIT's configuration of 2026-08-31 runs and in list 17 of
893
+ * FeRD's code database in Mustang 2.26.0, which the e-invoice gate holds
894
+ * them to on every run (0037). CEN's list holds 104 codes and FeRD's 102,
895
+ * counted that day; these are the five a German or a French invoice is
896
+ * addressed by, their meanings as Peppol's EAS code list gives them:
897
+ */
898
+ export declare const ADDRESS_SCHEMES: readonly ["EM", "0204", "0225", "9930", "0088"];
899
+ type AddressScheme = (typeof ADDRESS_SCHEMES)[number];
900
+ /** What names each profile, in the XML and in the PDF that carries it. */
901
+ interface FacturXProfileTerms {
902
+ /** The specification identifier (BT-24), which the XML opens with. */
903
+ readonly guideline: string;
904
+ /** The XMP's `fx:ConformanceLevel` [S]. */
905
+ readonly conformanceLevel: string;
906
+ /** The embedded file's `/AFRelationship` [S]. */
907
+ readonly relationship: 'Alternative';
908
+ }
909
+ /**
910
+ * Each profile's names. A table over every profile, so a profile added to
911
+ * `E_INVOICE_PROFILES` without them does not compile.
912
+ * - BT-24 is the EN 16931 profile's identifier as the Factur-X 1.09.2
913
+ * schematron's code list 1 gives it (`FACTUR-X_EN16931_codedb.xml`, read
914
+ * in akretion's copy). Mustang refuses the old `urn:factur-x.eu:1p0:en16931`.
915
+ * - `Alternative` is Germany's relationship for EN 16931, and one of the
916
+ * three France allows [S].
917
+ */
918
+ export declare const FACTUR_X_PROFILES: { readonly [P in EInvoiceProfile]: FacturXProfileTerms; };
919
+ /**
920
+ * The file a Factur-X PDF embeds, and the XMP that describes it [S]: the
921
+ * name, the media type, the fx extension's namespace (its trailing `#`
922
+ * required) and prefix, and the document type and the version it states.
923
+ * The namespace is the transcription's section 6.3.1; its BR-HYBRID-04
924
+ * gives it without `:invoice`, an inconsistency the transcription resolves
925
+ * for section 6.3.1, as akretion's generator and PDFlib's sample do (0031).
926
+ * No validator checks the namespace: Mustang reads the four properties by
927
+ * local name, and veraPDF checks only that the extension schema describes
928
+ * them. The renderer embeds what these say (0031), and its test holds the
929
+ * PDF to the transcription's values, written there and not read from here;
930
+ * the official package's XMP example, which would hold them to more, waits
931
+ * for a registration with FeRD nobody here has made.
932
+ */
933
+ export declare const FACTUR_X: {
934
+ readonly fileName: "factur-x.xml";
935
+ readonly mediaType: "text/xml";
936
+ readonly xmpNamespace: "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#";
937
+ readonly xmpPrefix: "fx";
938
+ readonly documentType: "INVOICE";
939
+ readonly version: "1.0";
940
+ };
941
+ /**
942
+ * The names an expression reads in a report that is an e-invoice, beside
943
+ * `EXPRESSION_NAMES`'s, and in no other report (0027, an addition to
944
+ * 0007's names): `invoice` holds the document's totals (BG-22), and
945
+ * `vatBasis` and `vatAmount` each declared VAT category's taxable and tax
946
+ * amount (BG-23) by the category's id, null when no line is in it. The
947
+ * runtime computes each once, from the lines, for the page and the XML
948
+ * alike. They are read wherever `totals` is, except where they are
949
+ * computed from: an aggregate's expression, the e-invoice's own, and the
950
+ * columns that print a line's terms. The editing core refuses a read
951
+ * there, and in any other report.
952
+ */
953
+ export declare const E_INVOICE_NAMES: readonly ["invoice", "vatBasis", "vatAmount"];
954
+ type EInvoiceName = (typeof E_INVOICE_NAMES)[number];
955
+ /**
956
+ * The members of `invoice`, each one of the document's totals (BG-22), as a
957
+ * refusal names it: every one a decimal of two places in the invoice's
958
+ * currency. With no allowances and no charges, the total without VAT is
959
+ * the sum of the lines. `paid` is a member only of an invoice that
960
+ * declares a paid amount, and is what that gives; with none, the amount
961
+ * due is the total with VAT.
962
+ */
963
+ export declare const INVOICE_TOTALS: {
964
+ readonly lineTotal: "the sum of the invoice line net amounts (BT-106)";
965
+ readonly taxBasisTotal: "the invoice total amount without VAT (BT-109)";
966
+ readonly taxTotal: "the invoice total VAT amount (BT-110)";
967
+ readonly grandTotal: "the invoice total amount with VAT (BT-112)";
968
+ readonly paid: "the paid amount (BT-113)";
969
+ readonly duePayable: "the amount due for payment (BT-115)";
970
+ };
971
+ type InvoiceTotal = keyof typeof INVOICE_TOTALS;
972
+ /** What `vatBasis` and `vatAmount` hold of each declared category, as a refusal names it. */
973
+ export declare const VAT_BREAKDOWN: { readonly [N in Exclude<EInvoiceName, 'invoice'>]: string; };
974
+ /**
975
+ * A postal address (BG-5, BG-8): the first line, the post code, the city
976
+ * and the country are needed, the second line may be left out. Each is
977
+ * runs; the country is a code of `COUNTRY_CODES`.
978
+ */
979
+ interface EInvoiceAddress {
980
+ readonly line1: readonly Inline[];
981
+ readonly line2?: readonly Inline[];
982
+ readonly postalCode: readonly Inline[];
983
+ readonly city: readonly Inline[];
984
+ readonly country: readonly Inline[];
985
+ }
986
+ /** A legal registration identifier (BT-30, BT-47), and the scheme it is given in, if one. */
987
+ interface LegalIdentifier {
988
+ readonly id: readonly Inline[];
989
+ readonly scheme?: SchemeId;
990
+ }
991
+ /**
992
+ * An electronic address (BT-34, BT-49), where the party is sent the
993
+ * invoice, and the scheme it is given in (BT-34-1, BT-49-1), which EN
994
+ * 16931 needs with it (BR-62, BR-63): a code of `ADDRESS_SCHEMES`.
995
+ */
996
+ interface ElectronicAddress {
997
+ readonly id: readonly Inline[];
998
+ readonly scheme: AddressScheme;
999
+ }
1000
+ /**
1001
+ * The seller's contact (BG-6): its contact point (BT-41), a person or a
1002
+ * department, its telephone number (BT-42) and its email address (BT-43).
1003
+ * EN 16931 lets each be left out; a contact here gives all three, as
1004
+ * XRechnung asks (BR-DE-5, -6, -7), so that one contact serves either.
1005
+ */
1006
+ interface SellerContact {
1007
+ readonly name: readonly Inline[];
1008
+ readonly telephone: readonly Inline[];
1009
+ readonly email: readonly Inline[];
1010
+ }
1011
+ /** The seller (BG-4): its name (BT-27), its VAT identifier (BT-31), its tax number (BT-32), its legal registration (BT-30), its electronic address (BT-34), its contact (BG-6) and its address (BG-5). */
1012
+ interface EInvoiceSeller {
1013
+ readonly name: readonly Inline[];
1014
+ readonly vatId?: readonly Inline[];
1015
+ readonly taxNumber?: readonly Inline[];
1016
+ readonly legalId?: LegalIdentifier;
1017
+ readonly electronicAddress?: ElectronicAddress;
1018
+ readonly contact?: SellerContact;
1019
+ readonly address: EInvoiceAddress;
1020
+ }
1021
+ /** The buyer (BG-7): its name (BT-44), its VAT identifier (BT-48), its legal registration (BT-47), its electronic address (BT-49) and its address (BG-8). A buyer has no BT-32, and its contact (BG-9) is not written. */
1022
+ interface EInvoiceBuyer {
1023
+ readonly name: readonly Inline[];
1024
+ readonly vatId?: readonly Inline[];
1025
+ readonly legalId?: LegalIdentifier;
1026
+ readonly electronicAddress?: ElectronicAddress;
1027
+ readonly address: EInvoiceAddress;
1028
+ }
1029
+ /**
1030
+ * A VAT category the invoice's lines are in, one VAT breakdown (BG-23) each
1031
+ * when a line uses it.
1032
+ */
1033
+ interface VatCategory {
1034
+ /** A field key: what the page reads its basis and its amount as, `vatBasis.<id>` and `vatAmount.<id>`, and what a line names it by. */
769
1035
  readonly id: string;
770
- readonly header: string;
771
- readonly width: Width;
772
- readonly align: Alignment;
773
- /** Read once per detail row. */
774
- readonly value: Inline;
775
- /** Read once per report: a hidden column gives its width to the fill columns, and its footer cells hide with it. */
776
- readonly visibleWhen?: Expression;
777
- readonly style?: string;
778
- /** Read once per detail row. */
779
- readonly styleWhen?: readonly StyleRule[];
1036
+ readonly code: VatCategoryCode;
1037
+ /** The rate in per cent (BT-119, BT-152), an exact decimal: more than 0 when standard rated, 0 otherwise. */
1038
+ readonly rate: string;
1039
+ /** The exemption reason (BT-120): needed for E and AE, never for S. */
1040
+ readonly reason?: readonly Inline[];
1041
+ }
1042
+ /** The invoicing period (BG-14): its start (BT-73), its end (BT-74), or both. */
1043
+ interface InvoicingPeriod {
1044
+ readonly start?: Expression;
1045
+ readonly end?: Expression;
1046
+ }
1047
+ /**
1048
+ * The lines (BG-25), one per row of the table over the detail dataset. The
1049
+ * name, the quantity, the net price and the net amount are column ids of
1050
+ * that table: what each column prints, once per row, is what the line
1051
+ * holds. The identifier, the unit and the VAT category are read from each
1052
+ * row, as an aggregate reads it.
1053
+ */
1054
+ interface EInvoiceLines {
1055
+ /** The id of the table over the detail dataset. */
1056
+ readonly table: string;
1057
+ /** The column that prints the item name (BT-153). */
1058
+ readonly name: string;
1059
+ /** The column that prints the invoiced quantity (BT-129). */
1060
+ readonly quantity: string;
1061
+ /** The column that prints the item net price (BT-146). */
1062
+ readonly netPrice: string;
1063
+ /** The column that prints the line net amount (BT-131), a whole number of cents. */
1064
+ readonly netAmount: string;
1065
+ /** The line identifier (BT-126). */
1066
+ readonly id: RowValue;
1067
+ /** The unit of measure (BT-130), a code of `UNIT_CODES`. */
1068
+ readonly unit: RowValue;
1069
+ /** The id of the line's VAT category (BT-151, BT-152): one the invoice declares. */
1070
+ readonly vat: RowValue;
1071
+ }
1072
+ /** The payment instructions (BG-16): how the invoice is paid, and to which account. */
1073
+ interface PaymentInstructions {
1074
+ /** BT-81. */
1075
+ readonly means: PaymentMeansCode;
1076
+ /** The payment account (BT-84): an IBAN. Spaces are for reading, and are dropped. */
1077
+ readonly iban: readonly Inline[];
1078
+ /** The BIC of the account's bank (BT-86). */
1079
+ readonly bic?: readonly Inline[];
1080
+ /** The account's name (BT-85). */
1081
+ readonly accountName?: readonly Inline[];
1082
+ /** The remittance information (BT-83): what a payer writes on the transfer. */
1083
+ readonly remittance?: readonly Inline[];
1084
+ }
1085
+ /**
1086
+ * What an invoice of either kind holds: EN 16931's terms, as 0027 and 0037
1087
+ * give them. Each text is runs, one at least where it is present; an
1088
+ * optional one absent is a term the XML leaves out, never an empty list of
1089
+ * runs, so that one invoice has one spelling and one hash. Each expression
1090
+ * is compiled and typed by the editing core: the dates are dates, the paid
1091
+ * amount a decimal.
1092
+ */
1093
+ interface EInvoiceTerms {
1094
+ /** BT-3. */
1095
+ readonly type: InvoiceTypeCode;
1096
+ /** BT-5. */
1097
+ readonly currency: EInvoiceCurrency;
1098
+ /** The invoice number (BT-1). */
1099
+ readonly number: readonly Inline[];
1100
+ /** The issue date (BT-2). */
1101
+ readonly issued: Expression;
1102
+ /** The business process (BT-23): the context the buyer's system routes the invoice in, an identifier such as Peppol's `urn:fdc:peppol.eu:2017:poacc:billing:01:1.0`. */
1103
+ readonly businessProcess?: readonly Inline[];
1104
+ readonly seller: EInvoiceSeller;
1105
+ readonly buyer: EInvoiceBuyer;
1106
+ /** The buyer's reference (BT-10). */
1107
+ readonly buyerReference?: readonly Inline[];
1108
+ /** The actual delivery date (BT-72). A delivery date, a period or both: a German invoice says when it was supplied. */
1109
+ readonly delivered?: Expression;
1110
+ readonly period?: InvoicingPeriod;
1111
+ /** The VAT categories its lines may be in, one at least. */
1112
+ readonly vat: readonly VatCategory[];
1113
+ readonly lines: EInvoiceLines;
1114
+ readonly payment?: PaymentInstructions;
1115
+ /** The payment due date (BT-9). */
1116
+ readonly due?: Expression;
1117
+ /** The payment terms (BT-20), where a Skonto is written. */
1118
+ readonly terms?: readonly Inline[];
1119
+ /** The amount already paid (BT-113), a whole number of cents. */
1120
+ readonly paid?: Expression;
780
1121
  }
781
- interface TableFooterCell {
782
- /** A column id of the same table. */
783
- readonly column: string;
784
- readonly value: Inline;
1122
+ /** A Factur-X invoice in the EN 16931 profile: the hybrid whose XML a PDF/A-3b embeds (0031). */
1123
+ interface FacturXInvoice extends EInvoiceTerms {
1124
+ readonly kind: 'facturX';
1125
+ readonly profile: EInvoiceProfile;
785
1126
  }
786
- /** A row under a group or under the table: a subtotal, a tax line, a total. */
787
- interface TableFooterRow {
788
- readonly cells: readonly TableFooterCell[];
789
- readonly style?: string;
1127
+ /**
1128
+ * An XRechnung (0038): EN 16931's terms in KoSIT's CIUS, written as CII,
1129
+ * with what its schematron needs past EN 16931 -- the business process
1130
+ * (PEPPOL-EN16931-R001), the buyer's reference (BR-DE-15), the payment
1131
+ * instructions (BR-DE-1), the seller's contact (BR-DE-2) and both
1132
+ * electronic addresses (PEPPOL-EN16931-R020, -R010) -- each needed here.
1133
+ * Its XML is the invoice; a PDF of it is a copy, and says so on every page.
1134
+ */
1135
+ interface XRechnungInvoice extends EInvoiceTerms {
1136
+ readonly kind: 'xrechnung';
1137
+ readonly version: XRechnungVersion;
1138
+ readonly businessProcess: readonly Inline[];
1139
+ readonly seller: EInvoiceSeller & {
1140
+ readonly electronicAddress: ElectronicAddress;
1141
+ readonly contact: SellerContact;
1142
+ };
1143
+ readonly buyer: EInvoiceBuyer & {
1144
+ readonly electronicAddress: ElectronicAddress;
1145
+ };
1146
+ /** A public buyer's Leitweg-ID, or the reference a business buyer asks for. */
1147
+ readonly buyerReference: readonly Inline[];
1148
+ readonly payment: PaymentInstructions;
790
1149
  }
1150
+ type EInvoice = FacturXInvoice | XRechnungInvoice;
791
1151
  /**
792
- * One grouping level, the only one version 0 has. Rows are ordered by the
793
- * group's key first, then by the table's sort keys; rows whose keys are all
794
- * equal keep the order the provider gave them.
1152
+ * The languages a QR-bill's headings may be printed in: German, French,
1153
+ * Italian, English, and Romansh since 1 January 2026 (IG 2.4, Annex C). A
1154
+ * report in any other language prints its slip in one of these.
795
1155
  */
796
- interface TableGroup {
797
- /** A detail field. */
798
- readonly by: FieldRef;
799
- readonly direction: SortDirection;
800
- /** One line across the table, read once per group. */
801
- readonly header: readonly Inline[];
802
- readonly headerStyle?: string;
803
- readonly footer: readonly TableFooterRow[];
1156
+ export declare const QR_BILL_LANGUAGES: readonly ["de", "fr", "it", "en", "rm"];
1157
+ type QrBillLanguage = (typeof QR_BILL_LANGUAGES)[number];
1158
+ /** The currencies a QR-bill pays in, and the only ones (IG Table 8, Ccy). */
1159
+ export declare const QR_BILL_CURRENCIES: readonly ["CHF", "EUR"];
1160
+ type QrBillCurrency = (typeof QR_BILL_CURRENCIES)[number];
1161
+ /**
1162
+ * A party's address, structured: the one address type SIX has taken since
1163
+ * version 2.3 removed the combined one. Each part is runs of text; what
1164
+ * each may hold is `QR_BILL_ADDRESS_RULES`.
1165
+ */
1166
+ interface QrBillAddress {
1167
+ /** A person's first and last name, or a company's: 70 characters. */
1168
+ readonly name: readonly Inline[];
1169
+ /** The street or post office box, without the building number: 70 characters. */
1170
+ readonly street?: readonly Inline[];
1171
+ readonly buildingNumber?: readonly Inline[];
1172
+ /** Without a country prefix. */
1173
+ readonly postalCode: readonly Inline[];
1174
+ readonly town: readonly Inline[];
1175
+ /** ISO 3166-1's two capital letters: CH. */
1176
+ readonly country: readonly Inline[];
804
1177
  }
805
- /** The table over the report's one detail dataset. Its header repeats on every page; version 0 has no other choice. */
806
- interface TableComponent extends ComponentBase {
807
- readonly kind: 'table';
808
- readonly dataset: 'detail';
809
- readonly columns: readonly TableColumn[];
810
- readonly headerStyle?: string;
811
- readonly sort?: readonly SortKey[];
812
- readonly group?: TableGroup;
813
- readonly totals?: readonly TableFooterRow[];
814
- readonly emptyText: string;
815
- readonly repeatHeader: true;
1178
+ /**
1179
+ * A Swiss QR-bill. Each text is runs, one at least where it is present; an
1180
+ * optional one absent is a field the bill leaves empty, never an empty
1181
+ * list of runs, so that one bill has one spelling and one hash.
1182
+ */
1183
+ interface SwissQrBill {
1184
+ readonly kind: 'swissQrBill';
1185
+ /** The language of the slip's headings, which may differ from the report's. */
1186
+ readonly language: QrBillLanguage;
1187
+ /** The creditor's IBAN or QR-IBAN, of Switzerland or Liechtenstein. Spaces are for reading, and are dropped. */
1188
+ readonly account: readonly Inline[];
1189
+ readonly creditor: QrBillAddress;
1190
+ readonly currency: QrBillCurrency;
1191
+ /** A decimal of at most two places. Absent, or null, leaves the amount for the payer to fill in. */
1192
+ readonly amount?: Expression;
1193
+ /** Who pays. Absent leaves a field for the payer's name and address. */
1194
+ readonly debtor?: QrBillAddress;
1195
+ /** A QR reference, with a QR-IBAN, or a creditor reference, with an IBAN. Absent, the bill has none. */
1196
+ readonly reference?: readonly Inline[];
1197
+ /** The unstructured message: what the payment is for. */
1198
+ readonly message?: readonly Inline[];
1199
+ /** Coded information for the payer's software, beginning with `//`. */
1200
+ readonly billingInformation?: readonly Inline[];
816
1201
  }
817
- interface PageBreakComponent extends ComponentBase {
818
- readonly kind: 'pageBreak';
1202
+ /** The kinds of payment part. A kind this version does not know is refused, never skipped. */
1203
+ export declare const PAYMENT_PART_KINDS: readonly ["swissQrBill"];
1204
+ type PaymentPartKind = (typeof PAYMENT_PART_KINDS)[number];
1205
+ type PaymentPart = SwissQrBill;
1206
+ /** A word of the report, exactly as it stands in the report's own language, and what prints for it in a translation's. */
1207
+ interface TranslatedWord {
1208
+ readonly word: string;
1209
+ readonly text: string;
819
1210
  }
820
- interface KeepTogetherComponent extends ComponentBase {
821
- readonly kind: 'keepTogether';
822
- readonly components: readonly Component[];
1211
+ /** An expression that prints words, by its source exactly, and the expression that prints in its place in a translation's language. */
1212
+ interface TranslatedExpression {
1213
+ readonly cel: string;
1214
+ readonly expression: Expression;
823
1215
  }
824
- export declare const COMPONENT_KINDS: readonly ["text", "image", "qrCode", "epcQrCode", "line", "rectangle", "spacer", "columns", "section", "table", "pageBreak", "keepTogether"];
825
- type ComponentKind = (typeof COMPONENT_KINDS)[number];
826
- type Component = TextComponent | ImageComponent | QrCodeComponent | EpcQrCodeComponent | LineComponent | RectangleComponent | SpacerComponent | ColumnsComponent | SectionComponent | TableComponent | PageBreakComponent | KeepTogetherComponent;
1216
+ /** The report's words in one language besides its own. */
1217
+ interface Translation {
1218
+ /** A BCP 47 tag, written as the report's `locale` is; never the report's own. */
1219
+ readonly locale: string;
1220
+ /** Each word once; a language just added holds none yet. */
1221
+ readonly words: readonly TranslatedWord[];
1222
+ readonly expressions: readonly TranslatedExpression[];
1223
+ }
1224
+ /** A literal string where a word stands, and where it is. */
1225
+ interface WordPlace {
1226
+ /** The JSON Pointer to the string: a run's `text`, a column's `header`, the report's `title`. */
1227
+ readonly path: string;
1228
+ readonly text: string;
1229
+ /** The innermost component it stands in; none for the title or the payment part's message. */
1230
+ readonly componentId?: string;
1231
+ /** For a table column's header and its value, the column's id. */
1232
+ readonly columnId?: string;
1233
+ }
1234
+ /** An expression run where a word stands: a word where it prints text and its source holds a quote, which only the core can tell (0063). */
1235
+ interface WordExpressionSite {
1236
+ /** The JSON Pointer to the expression's `cel`, as report-core names the site it compiles. */
1237
+ readonly path: string;
1238
+ readonly cel: string;
1239
+ readonly componentId?: string;
1240
+ readonly columnId?: string;
1241
+ }
1242
+ /** Whether `text` is a word: whether it holds a letter, of any script. A separator, a number or a sign prints as written in every language. */
1243
+ export declare function isWord(text: string): boolean;
1244
+ /** Every word of `report`, at each place it stands, in document order: a word in several places is yielded at each. */
1245
+ export declare function reportWords(report: ReportDefinition): readonly WordPlace[];
1246
+ /** Every expression run where a word stands, in document order: report-core says which of them print words. */
1247
+ export declare function wordExpressionSites(report: ReportDefinition): readonly WordExpressionSite[];
827
1248
  /**
828
1249
  * The report's regions, in the order a reader meets them. The body is flow
829
1250
  * only in version 0: ordered blocks, so a growing table pushes what follows
830
1251
  * down. Positioned elements in the page regions are deferred.
1252
+ *
1253
+ * The first page header stands beside the header it replaces: page 1
1254
+ * prints it in place of the page header, which then prints from page 2 on
1255
+ * ([0060](../../../docs/decisions/0060-a-reports-first-page-may-print-a-header-of-its-own-or-none-in-place-of-the-page-header.md)).
831
1256
  */
832
- export declare const REGION_NAMES: readonly ["reportHeader", "pageHeader", "body", "pageFooter", "summary"];
1257
+ export declare const REGION_NAMES: readonly ["reportHeader", "firstPageHeader", "pageHeader", "body", "pageFooter", "summary"];
833
1258
  type RegionName = (typeof REGION_NAMES)[number];
834
- type Regions = { readonly [R in RegionName]: readonly Component[]; };
1259
+ /**
1260
+ * The regions a report may leave out, and what leaving one out means: the
1261
+ * first page header absent, page 1 prints the page header as every page
1262
+ * does; present and empty, page 1 prints no header (0060). Every other
1263
+ * region every report holds.
1264
+ */
1265
+ export declare const OPTIONAL_REGIONS: readonly ["firstPageHeader"];
1266
+ type OptionalRegionName = (typeof OPTIONAL_REGIONS)[number];
1267
+ type Regions = { readonly [R in Exclude<RegionName, OptionalRegionName>]: readonly Component[]; } & { readonly [R in OptionalRegionName]?: readonly Component[]; };
835
1268
  export declare const PROVENANCE_KINDS: readonly ["blank", "form", "dataset"];
836
1269
  type ProvenanceKind = (typeof PROVENANCE_KINDS)[number];
837
1270
  /**
@@ -854,7 +1287,7 @@ interface ReportDefinition {
854
1287
  readonly reportSpecVersion: typeof REPORT_SPEC_VERSION;
855
1288
  readonly id: string;
856
1289
  readonly title: string;
857
- /** A BCP 47 tag: language, optional script, optional region. */
1290
+ /** A BCP 47 tag: language, optional script, optional region. The report's own language: the one its words are written in, and the one a render that names none prints in (0063). */
858
1291
  readonly locale: string;
859
1292
  readonly page: PageSettings;
860
1293
  readonly styles: readonly PrintStyle[];
@@ -862,49 +1295,27 @@ interface ReportDefinition {
862
1295
  readonly parameters: readonly ParameterDef[];
863
1296
  readonly assets: readonly AssetRef[];
864
1297
  readonly aggregates: readonly AggregateDef[];
1298
+ /** Which font assets each font token prints in, face by face; absent, and a token left out, the renderer prints that token in its own face (0043). */
1299
+ readonly fonts?: FontMap;
865
1300
  readonly regions: Regions;
866
1301
  /** A slip to pay the report by, printed at the foot of its last page: a Swiss QR-bill. Absent, the report has none. */
867
1302
  readonly paymentPart?: PaymentPart;
868
1303
  /** The EN 16931 invoice the report is, written as Factur-X from what its page prints. Absent, the report is none. */
869
1304
  readonly eInvoice?: EInvoice;
870
1305
  readonly provenance?: Provenance;
1306
+ /**
1307
+ * The report's words in each language besides its own, one translation
1308
+ * a language, each word looked up by its exact text in the report's own
1309
+ * (0063). Absent, the report is written in its own language alone; never
1310
+ * an empty list.
1311
+ */
1312
+ readonly translations?: readonly Translation[];
871
1313
  }
872
- //#endregion
873
- //#region src/page.d.ts
874
- interface PageDimensions {
875
- readonly width: number;
876
- readonly height: number;
877
- }
878
- /**
879
- * Portrait sizes in points. A4 is ISO 216's 210 x 297 mm, converted and
880
- * rounded like any other length (595.28 x 841.89, the values PDF engines
881
- * use); Letter is 8.5 x 11 inches, exactly 612 x 792.
882
- */
883
- export declare const PAGE_SIZES: { readonly [S in PageSizeName]: PageDimensions; };
884
- /** The page's width and height as oriented: landscape swaps the sides. */
885
- export declare function pageDimensions(page: {
886
- readonly size: PageSizeName;
887
- readonly orientation: Orientation;
888
- }): PageDimensions;
889
- /** What the margins leave of the oriented page, to the hundredth of a point that lengths are stored at. */
890
- export declare function printableArea(page: PageSettings): PageDimensions;
891
- /**
892
- * The largest square `area` holds: the length of its shorter side, and
893
- * which side that is, the width when the two are equal. The validator
894
- * measures a QR code's square against it and refuses one that overruns it
895
- * on that side; the builders size a new code by it and name it as the room
896
- * a refused size lacks.
897
- */
898
- export declare function squareRoom(area: PageDimensions): {
899
- readonly side: 'width' | 'height';
900
- readonly length: number;
901
- };
902
- //#endregion
903
- //#region src/payment-reference.d.ts
904
1314
  /**
905
1315
  * What every payment code a report prints shares: ISO 7064's check modulo
906
1316
  * 97, which ISO 13616 checks an IBAN with and ISO 11649 a creditor
907
- * reference; the creditor reference itself; and what a check says.
1317
+ * reference, and a Leitweg-ID's check digits are computed by; the
1318
+ * creditor reference itself; and what a check says.
908
1319
  *
909
1320
  * One check, read by the QR-bill's rules (`qr-bill.ts`) and the EPC QR
910
1321
  * code's (`epc-payload.ts`): two copies could disagree about which account
@@ -924,8 +1335,6 @@ type PaymentCheck<T> = {
924
1335
  readonly ok: false;
925
1336
  readonly rule: string;
926
1337
  };
927
- //#endregion
928
- //#region src/qr-bill.d.ts
929
1338
  /** What a check made of a text it accepts, or the rule the text breaks: every payment code's `PaymentCheck`. */
930
1339
  type QrBillCheck<T> = PaymentCheck<T>;
931
1340
  /**
@@ -971,6 +1380,45 @@ interface QrBillAccount {
971
1380
  }
972
1381
  /** The account: an IBAN or a QR-IBAN of Switzerland or Liechtenstein (IG Table 8, IBAN), its spaces dropped. */
973
1382
  export declare function checkQrBillAccount(text: string): QrBillCheck<QrBillAccount>;
1383
+ /**
1384
+ * The accounts of SIX's examples (IG 2.4, Annex A: examples 1, 2 and 3,
1385
+ * and 4, 5 and 6, which share one), as the code holds them: two QR-IBANs
1386
+ * and two IBANs. SIX publishes them to test with, and they are no
1387
+ * creditor's: a bill that pays one never reaches the creditor it names. A
1388
+ * new bill in a builder starts from example 3's, and report-core warns of
1389
+ * a bill whose account, written in the report, is one of these (0039).
1390
+ */
1391
+ export declare const QR_BILL_EXAMPLE_ACCOUNTS: readonly ["CH6431961000004421557", "CH4431999123000889012", "CH5204835012345671000", "CH5800791123000889012"];
1392
+ /**
1393
+ * What a builder starts a bill from, SIX's own example values (IG 2.4,
1394
+ * Annex A), as SIX prints them: example 3's account and creditor (Table
1395
+ * 19), the bill a builder adds, with no amount, debtor or reference;
1396
+ * example 1's debtor (Table 17), the debtor it adds; and example 1's QR
1397
+ * reference, which it gives a bill whose account is made a QR-IBAN, as a
1398
+ * QR-IBAN is paid to with nothing else. They are no one's, and
1399
+ * report-core warns of a bill that holds one of them, written in the
1400
+ * report, as it warns of an example account (0039): one list, so that
1401
+ * what a builder puts in and what is warned of cannot drift apart.
1402
+ */
1403
+ export declare const QR_BILL_EXAMPLE: {
1404
+ readonly account: "CH52 0483 5012 3456 7100 0";
1405
+ readonly creditor: {
1406
+ readonly name: "Muster Stiftung (sample foundation)";
1407
+ readonly street: "P.O. box";
1408
+ readonly postalCode: "3001";
1409
+ readonly town: "Bern";
1410
+ readonly country: "CH";
1411
+ };
1412
+ readonly debtor: {
1413
+ readonly name: "Simon Muster";
1414
+ readonly street: "Musterstrasse";
1415
+ readonly buildingNumber: "1";
1416
+ readonly postalCode: "8000";
1417
+ readonly town: "Seldwyla";
1418
+ readonly country: "CH";
1419
+ };
1420
+ readonly reference: "00 00082 07791 22585 74212 86694";
1421
+ };
974
1422
  /** The kinds of reference a bill holds (IG Table 8, Tp): a QR reference, a creditor reference, or none. */
975
1423
  type QrBillReferenceType = 'QRR' | 'SCOR' | 'NON';
976
1424
  interface QrBillReference {
@@ -1046,8 +1494,6 @@ export declare function qrBillPairing(account: 'iban' | 'qrIban' | undefined, re
1046
1494
  * on its first render.
1047
1495
  */
1048
1496
  export declare function checkQrBillAmount(decimal: string): QrBillCheck<string>;
1049
- //#endregion
1050
- //#region src/epc-payload.d.ts
1051
1497
  /** The most bytes the whole payload may take (EPC 2.2): what a version 13 code holds at level M (EPC 2.1). */
1052
1498
  export declare const EPC_MAX_BYTES = 331;
1053
1499
  /**
@@ -1205,8 +1651,6 @@ export declare function epcPayload(fields: EpcPayloadFields): string;
1205
1651
  export declare function utf8Length(text: string): number;
1206
1652
  /** A whole payload, held to the 331 bytes the EPC allows (2.2), counted in UTF-8's bytes and not in characters. */
1207
1653
  export declare function checkEpcPayload(payload: string): PaymentCheck<string>;
1208
- //#endregion
1209
- //#region src/epc-print.d.ts
1210
1654
  /** The largest version a code may have: 69 modules a side, which holds 331 bytes at level M (EPC069-12 2.1). */
1211
1655
  export declare const EPC_MAX_VERSION = 13;
1212
1656
  /** The modules a side of a symbol of `version` has: "QR-Code Version*4+17" (PSA 2; ISO/IEC 18004). */
@@ -1287,15 +1731,156 @@ export declare function epcLeastVersion(size: number, caption: EpcCaption | unde
1287
1731
  * they are stored in, exactly.
1288
1732
  */
1289
1733
  export declare function epcCaptionBreak(size: number, version?: number): string | undefined;
1290
- //#endregion
1291
- //#region src/en16931.d.ts
1292
1734
  /**
1293
- * Every rule of EN 16931 a refusal here names, and no other. The gate reads
1294
- * this list; `en16931.test.ts` holds it to the ids the rules say.
1735
+ * What KoSIT's XRechnung 3.0.2 asks of an e-invoice past EN 16931, as
1736
+ * report-spec holds it: of either kind, the shapes of the seller's contact
1737
+ * telephone number (BT-42) and email address (BT-43), each a warning of
1738
+ * KoSIT's XRechnung scenario, BR-DE-27 and BR-DE-28, which a file of either
1739
+ * kind is held to so that none earns it (0037); of an XRechnung (0038), the
1740
+ * terms its schematron needs that EN 16931 lets an invoice leave out
1741
+ * (`XRECHNUNG_NEEDS`, `XRECHNUNG_TEXT_NEEDS`) and the payment terms that
1742
+ * hold no Skonto line (`skontoBreak`, BR-DE-18); and of an electronic
1743
+ * address under 0204 in either, the Leitweg-ID's shape and check digits
1744
+ * (`leitwegIdBreak`), which no rule of XRechnung's checks. The rules the
1745
+ * plan names that nothing the format can say breaks are listed apart, with
1746
+ * what holds each (`XRECHNUNG_HELD`).
1747
+ *
1748
+ * Each shape is the pinned schematron's own expression, written here as
1749
+ * its variable writes it -- `XR-TELEPHONE-REGEX` and `XR-EMAIL-REGEX` in
1750
+ * `resources/xrechnung/3.0.2/xsl/XRechnung-CII-validation.xsl` of KoSIT's
1751
+ * configuration of 2026-08-31, read on 20 October 2026 -- and read as
1752
+ * XPath 2.0 reads it (`xpathRegExp`), after `normalize-space`, as the
1753
+ * rule's test reads it. The e-invoice gate holds each string, and the test
1754
+ * that reads it, to that file, and each id of `XRECHNUNG_RULES` to a rule
1755
+ * of it, on every run. The telephone number's expression is not run as
1756
+ * written: its digits are counted, which is what it asks, in time in
1757
+ * proportion to the text's length (`telephoneBreak`).
1758
+ */
1759
+ /**
1760
+ * Every rule of XRechnung's a refusal of report-spec names, and no other:
1761
+ * Peppol's three that KoSIT's XRechnung schematron runs among them. The
1762
+ * gate reads this list and holds each id to a rule of the pinned XRechnung
1763
+ * schematron; `en16931.test.ts` and `xrechnung.test.ts` hold it to the ids
1764
+ * the rules say.
1765
+ */
1766
+ export declare const XRECHNUNG_RULES: readonly ["BR-DE-1", "BR-DE-2", "BR-DE-5", "BR-DE-6", "BR-DE-7", "BR-DE-15", "BR-DE-18", "BR-DE-27", "BR-DE-28", "PEPPOL-EN16931-R001", "PEPPOL-EN16931-R010", "PEPPOL-EN16931-R020"];
1767
+ type XRechnungRule = (typeof XRECHNUNG_RULES)[number];
1768
+ /** A rule of XRechnung's that needs a term, and what a refusal says of the term when it is not given. */
1769
+ interface XRechnungNeed {
1770
+ readonly rule: XRechnungRule;
1771
+ readonly said: string;
1772
+ }
1773
+ /**
1774
+ * What an XRechnung needs that EN 16931 lets an invoice leave out, by the
1775
+ * place it stands in under the e-invoice, each fatal in the pinned
1776
+ * XRechnung schematron: the validator refuses an XRechnung without it,
1777
+ * where it is missing. The gate holds each rule's test to the element the
1778
+ * runtime writes the term as.
1295
1779
  */
1296
- export declare const EN16931_RULES: readonly ["BR-02", "BR-03", "BR-06", "BR-07", "BR-09", "BR-11", "BR-16", "BR-21", "BR-22", "BR-23", "BR-24", "BR-25", "BR-26", "BR-27", "BR-29", "BR-61", "BR-CL-11", "BR-CL-14", "BR-CL-23", "BR-CO-04", "BR-CO-09", "BR-CO-17", "BR-CO-18", "BR-CO-19", "BR-CO-26", "BR-DEC-16", "BR-DEC-23", "BR-S-02", "BR-S-05", "BR-S-08", "BR-S-10", "BR-E-01", "BR-E-02", "BR-E-05", "BR-E-10", "BR-AE-01", "BR-AE-02", "BR-AE-05", "BR-AE-10"];
1780
+ export declare const XRECHNUNG_NEEDS: {
1781
+ readonly businessProcess: {
1782
+ readonly rule: "PEPPOL-EN16931-R001";
1783
+ readonly said: "the business process (BT-23) is not given, and an XRechnung needs it";
1784
+ };
1785
+ readonly buyerReference: {
1786
+ readonly rule: "BR-DE-15";
1787
+ readonly said: "the buyer's reference (BT-10), a public buyer's Leitweg-ID, is not given, and an XRechnung needs it";
1788
+ };
1789
+ readonly payment: {
1790
+ readonly rule: "BR-DE-1";
1791
+ readonly said: "the payment instructions (BG-16) are not given, and an XRechnung needs them";
1792
+ };
1793
+ readonly 'seller/contact': {
1794
+ readonly rule: "BR-DE-2";
1795
+ readonly said: "the seller's contact (BG-6) is not given, and an XRechnung needs it";
1796
+ };
1797
+ readonly 'seller/electronicAddress': {
1798
+ readonly rule: "PEPPOL-EN16931-R020";
1799
+ readonly said: "the seller's electronic address (BT-34) is not given, and an XRechnung needs it";
1800
+ };
1801
+ readonly 'buyer/electronicAddress': {
1802
+ readonly rule: "PEPPOL-EN16931-R010";
1803
+ readonly said: "the buyer's electronic address (BT-49) is not given, and an XRechnung needs it";
1804
+ };
1805
+ };
1806
+ /**
1807
+ * The texts an XRechnung needs to say something, by business term, and the
1808
+ * rule of XRechnung's that needs each: those of `XRECHNUNG_NEEDS`, and the
1809
+ * contact's three, which BR-DE-5 to -7 read through normalize-space. An
1810
+ * XRechnung's texts are EN 16931's with these needed
1811
+ * (`E_INVOICE_KIND_TEXTS`), so that a blank one is refused by its rule, a
1812
+ * literal where it is written and one from data at the render.
1813
+ */
1814
+ export declare const XRECHNUNG_TEXT_NEEDS: {
1815
+ readonly 'BT-10': "BR-DE-15";
1816
+ readonly 'BT-23': "PEPPOL-EN16931-R001";
1817
+ readonly 'BT-34': "PEPPOL-EN16931-R020";
1818
+ readonly 'BT-41': "BR-DE-5";
1819
+ readonly 'BT-42': "BR-DE-6";
1820
+ readonly 'BT-43': "BR-DE-7";
1821
+ readonly 'BT-49': "PEPPOL-EN16931-R010";
1822
+ };
1823
+ /**
1824
+ * The rules of XRechnung's the plan for 0.3.0 names, or that hold the terms
1825
+ * it does, that nothing the format can say breaks, so that no refusal of
1826
+ * report-spec names them: each is held by another rule or by what the
1827
+ * format and the writer leave out, as said. The gate holds each id to a
1828
+ * rule of the pinned XRechnung schematron, and the rule's context and test,
1829
+ * white space aside, to the ones the reason was read against
1830
+ * (`XRECHNUNG_HELD_RULES` in `scripts/e-invoice/oracle.mjs`), so that a
1831
+ * rule KoSIT renames, drops or rewrites is seen; that each holds of a file
1832
+ * is the XRechnung sample's, which KoSIT's XRechnung scenario judges.
1833
+ */
1834
+ export declare const XRECHNUNG_HELD: {
1835
+ readonly [id: string]: string;
1836
+ };
1837
+ /** What a rule of XRechnung's says, with its id: the one way a message names one, so that every id is a listed one. */
1838
+ export declare function xrechnungRule(id: XRechnungRule, said: string): string;
1839
+ /** Whether a rule id is one of XRechnung's, rather than CEN's or the UStG's. */
1840
+ export declare function isXRechnungRule(id: string): id is XRechnungRule;
1841
+ /** A shape XRechnung holds a term to: the rule that holds it, and its XPath regular expression as the pinned schematron writes it. */
1842
+ interface XRechnungPattern {
1843
+ readonly rule: XRechnungRule;
1844
+ readonly pattern: string;
1845
+ }
1846
+ /** The shapes, by what they shape. */
1847
+ export declare const XRECHNUNG_PATTERNS: {
1848
+ readonly telephone: XRechnungPattern;
1849
+ readonly email: XRechnungPattern;
1850
+ };
1851
+ /**
1852
+ * The rule an XRechnung's payment terms (BT-20) break, or undefined: no
1853
+ * line led by # (0038, Q4). BR-DE-18 reads every line of the terms --
1854
+ * `tokenize(. , '(\r?\n)')`, so a line ends at a line feed, a carriage
1855
+ * return before it going with it -- whose `normalize-space` begins with #,
1856
+ * as a Skonto line of XRechnung's own syntax, fatal where it is not one;
1857
+ * this release writes no Skonto, and refuses every such line, a
1858
+ * well-formed one too. The white space normalize-space drops before the #
1859
+ * is XPath's four characters. Found in one pass over the text.
1860
+ */
1861
+ export declare function skontoBreak(text: string): string | undefined;
1862
+ /**
1863
+ * The rule an electronic address under scheme 0204 breaks as a Leitweg-ID,
1864
+ * or undefined (0038, Q3): its shape, and check digits that are 98 less
1865
+ * the remainder modulo 97 of its coarse and fine addresses with 00 after
1866
+ * them, each letter, in either case, the two digits ISO/IEC 7064 gives it
1867
+ * (MOD 97-10, as an IBAN's). The format specification itself, KoSIT's
1868
+ * Leitweg-ID-Formatspezifikation 2.0.2, could not be read here; the shape
1869
+ * and the computation are as FeRD's data sheet describes them, and every
1870
+ * Leitweg-ID of KoSIT's XRechnung 3.0.2 test suite with right digits
1871
+ * passes it, and every one with wrong digits is refused
1872
+ * (`xrechnung.test.ts`). No rule of XRechnung's or CEN's checks one, so
1873
+ * this names none.
1874
+ */
1875
+ export declare function leitwegIdBreak(text: string): string | undefined;
1876
+ /**
1877
+ * Every rule of EN 16931 a refusal of these checks names, and no other.
1878
+ * The gate reads this list; `en16931.test.ts` holds it to the ids the
1879
+ * rules say.
1880
+ */
1881
+ export declare const EN16931_RULES: readonly ["BR-02", "BR-03", "BR-06", "BR-07", "BR-09", "BR-11", "BR-16", "BR-21", "BR-22", "BR-23", "BR-24", "BR-25", "BR-26", "BR-27", "BR-29", "BR-61", "BR-CL-11", "BR-CL-14", "BR-CL-23", "BR-CL-25", "BR-CO-04", "BR-CO-09", "BR-CO-17", "BR-CO-18", "BR-CO-19", "BR-CO-26", "BR-DEC-16", "BR-DEC-23", "BR-S-02", "BR-S-05", "BR-S-08", "BR-S-10", "BR-E-01", "BR-E-02", "BR-E-05", "BR-E-10", "BR-AE-01", "BR-AE-02", "BR-AE-05", "BR-AE-10"];
1297
1882
  type En16931Rule = (typeof EN16931_RULES)[number];
1298
- /** What a rule says, with the ids of the rules it is: the one way a message here names one, so that every id is a listed one. */
1883
+ /** What a rule says, with the ids of the rules it is: the one way a message of these checks names one, so that every id is a listed one. */
1299
1884
  export declare function en16931Rule(id: En16931Rule | readonly En16931Rule[], said: string): string;
1300
1885
  /**
1301
1886
  * The section of the UStG that asks a German invoice for "die vollständige
@@ -1307,9 +1892,9 @@ export declare function en16931Rule(id: En16931Rule | readonly En16931Rule[], sa
1307
1892
  * in `EN16931_RULES`.
1308
1893
  */
1309
1894
  export declare const FULL_ADDRESS = "§ 14 Abs. 4 Satz 1 Nr. 1 UStG";
1310
- /** What asks for a term an e-invoice cannot leave out: one of EN 16931's rules, or the UStG's full address. */
1311
- type EInvoiceNeed = En16931Rule | typeof FULL_ADDRESS;
1312
- /** What a refusal says of a term `need` asks for that is `said` -- empty, or without a value -- and what asks for it: a rule of CEN's by its id, the UStG by its section and what it asks. */
1895
+ /** What asks for a term an e-invoice cannot leave out: one of EN 16931's rules, the UStG's full address, or, in an XRechnung, one of XRechnung's rules (0038). */
1896
+ type EInvoiceNeed = En16931Rule | typeof FULL_ADDRESS | XRechnungRule;
1897
+ /** What a refusal says of a term `need` asks for that is `said` -- empty, or without a value -- and what asks for it: a rule of CEN's or XRechnung's by its id, the UStG by its section and what it asks. */
1313
1898
  export declare function neededBy(need: EInvoiceNeed, said: string): string;
1314
1899
  /** Whether a text says nothing: empty, or white space alone. */
1315
1900
  export declare function eInvoiceBlank(text: string): boolean;
@@ -1326,6 +1911,8 @@ export declare function checkCountryCode(text: string): PaymentCheck<CountryCode
1326
1911
  export declare function checkUnitCode(text: string): PaymentCheck<UnitCode>;
1327
1912
  /** A scheme (BT-30-1, BT-47-1) of `SCHEME_IDS`: a literal the template writes, taken as written. */
1328
1913
  export declare function checkSchemeId(code: string): PaymentCheck<SchemeId>;
1914
+ /** An electronic address's scheme (BT-34-1, BT-49-1) of `ADDRESS_SCHEMES`: a literal the template writes, taken as written. */
1915
+ export declare function checkAddressScheme(code: string): PaymentCheck<AddressScheme>;
1329
1916
  /**
1330
1917
  * A VAT identifier (BT-31, BT-48): a prefix of `VAT_PREFIXES`, which names
1331
1918
  * the country that issued it (BR-CO-09), and then the number it gives. The
@@ -1371,17 +1958,42 @@ interface EInvoiceTextRule {
1371
1958
  * - The exemption reason (BT-120) is needed by its category's code
1372
1959
  * (`vatReasonBreak`); a line's VAT category (BT-151) is one the invoice
1373
1960
  * declares (`checkLineCategory`).
1374
- */
1375
- type EInvoiceTextTerm = 'BT-1' | 'BT-10' | 'BT-20' | 'BT-27' | 'BT-30' | 'BT-31' | 'BT-32' | 'BT-35' | 'BT-36' | 'BT-37' | 'BT-38' | 'BT-40' | 'BT-44' | 'BT-47' | 'BT-48' | 'BT-50' | 'BT-51' | 'BT-52' | 'BT-53' | 'BT-55' | 'BT-83' | 'BT-84' | 'BT-85' | 'BT-86' | 'BT-120' | 'BT-126' | 'BT-130' | 'BT-151' | 'BT-153';
1961
+ * - The business process (BT-23), the electronic addresses (BT-34, BT-49)
1962
+ * and the seller's contact (BT-41 to BT-43) are needed by no rule a
1963
+ * German B2B invoice is held to (0037). The telephone number and the
1964
+ * email address are held to the shapes XRechnung's KoSIT warns of
1965
+ * (`xrechnung.ts`), so that no file earns the warning; the business
1966
+ * process and an address, identifiers of no shape CEN or XRechnung asks,
1967
+ * are tokens alone.
1968
+ */
1969
+ type EInvoiceTextTerm = 'BT-1' | 'BT-10' | 'BT-20' | 'BT-23' | 'BT-27' | 'BT-30' | 'BT-31' | 'BT-32' | 'BT-34' | 'BT-35' | 'BT-36' | 'BT-37' | 'BT-38' | 'BT-40' | 'BT-41' | 'BT-42' | 'BT-43' | 'BT-44' | 'BT-47' | 'BT-48' | 'BT-49' | 'BT-50' | 'BT-51' | 'BT-52' | 'BT-53' | 'BT-55' | 'BT-83' | 'BT-84' | 'BT-85' | 'BT-86' | 'BT-120' | 'BT-126' | 'BT-130' | 'BT-151' | 'BT-153';
1376
1970
  export declare const E_INVOICE_TEXTS: { readonly [T in EInvoiceTextTerm]: EInvoiceTextRule; };
1971
+ /** How each text term is held, by its business term: a table over every term. */
1972
+ type EInvoiceTextRules = { readonly [T in EInvoiceTextTerm]: EInvoiceTextRule; };
1973
+ /**
1974
+ * Each kind's text rules, one table per kind over every term (0038): the
1975
+ * validator reads a literal by its kind's, the runtime what the data
1976
+ * resolved, so the two cannot hold one term of one kind to two rules. A
1977
+ * kind without a table does not compile.
1978
+ */
1979
+ export declare const E_INVOICE_KIND_TEXTS: { readonly [K in EInvoiceKind]: EInvoiceTextRules; };
1377
1980
  /** Each part of an address, by its business term. */
1378
1981
  type AddressTerms = { readonly [A in keyof EInvoiceAddress]-?: EInvoiceTextTerm; };
1379
- /** Which term each text of an e-invoice is, by where it stands in it: the type of `E_INVOICE_TEXT_TERMS`, over every text the format has. */
1982
+ /** Each part of the seller's contact, by its business term. */
1983
+ type ContactTerms = { readonly [C in keyof SellerContact]-?: EInvoiceTextTerm; };
1984
+ /**
1985
+ * Which term each text of an e-invoice is, by where it stands in it: the
1986
+ * type of `E_INVOICE_TEXT_TERMS`, over every text the format has. A legal
1987
+ * registration and an electronic address are named by their identifier's
1988
+ * term; their schemes are codes, not texts.
1989
+ */
1380
1990
  interface EInvoiceTextTerms {
1381
1991
  readonly number: EInvoiceTextTerm;
1992
+ readonly businessProcess: EInvoiceTextTerm;
1382
1993
  readonly buyerReference: EInvoiceTextTerm;
1383
1994
  readonly terms: EInvoiceTextTerm;
1384
- readonly seller: { readonly [K in Exclude<keyof EInvoiceSeller, 'address'>]-?: EInvoiceTextTerm; } & {
1995
+ readonly seller: { readonly [K in Exclude<keyof EInvoiceSeller, 'address' | 'contact'>]-?: EInvoiceTextTerm; } & {
1996
+ readonly contact: ContactTerms;
1385
1997
  readonly address: AddressTerms;
1386
1998
  };
1387
1999
  readonly buyer: { readonly [K in Exclude<keyof EInvoiceBuyer, 'address'>]-?: EInvoiceTextTerm; } & {
@@ -1407,9 +2019,17 @@ export declare const E_INVOICE_TEXT_TERMS: EInvoiceTextTerms;
1407
2019
  * its white space; then its own rule. That is what the validator says of a
1408
2020
  * literal; an optional term the data resolves to blank is left out of the
1409
2021
  * XML instead, which the runtime decides by `eInvoiceBlank` before it asks
1410
- * here.
2022
+ * here. `kind` is the e-invoice's, whose rules the term is held to.
1411
2023
  */
1412
- export declare function checkEInvoiceText(term: EInvoiceTextTerm, text: string): PaymentCheck<string>;
2024
+ export declare function checkEInvoiceText(term: EInvoiceTextTerm, text: string, kind?: EInvoiceKind): PaymentCheck<string>;
2025
+ /**
2026
+ * The identifier of an electronic address (BT-34, BT-49), `term`, given in
2027
+ * `scheme`: held to its term's rule, and, under 0204, which says it is a
2028
+ * Leitweg-ID, to a Leitweg-ID's shape and check digits (`leitwegIdBreak`,
2029
+ * 0038), in an e-invoice of either kind. What a value under another
2030
+ * scheme must be is not checked (0037).
2031
+ */
2032
+ export declare function checkElectronicAddress(term: EInvoiceTextTerm, scheme: AddressScheme, text: string, kind?: EInvoiceKind): PaymentCheck<string>;
1413
2033
  /** How a decimal term of the e-invoice is held: what a refusal calls it, the rule a null breaks, and what it may be. */
1414
2034
  interface EInvoiceDecimalRule {
1415
2035
  readonly what: string;
@@ -1453,6 +2073,23 @@ export declare const E_INVOICE_DATES: { readonly [T in EInvoiceDateTerm]: EInvoi
1453
2073
  * would be written as a date no validator reads as one.
1454
2074
  */
1455
2075
  export declare function checkEInvoiceDate(text: string): PaymentCheck<string>;
2076
+ /**
2077
+ * The rule an invoicing period breaks whose dates the data resolved, or
2078
+ * undefined: it ends no earlier than it starts (BR-29). Both are calendar
2079
+ * dates written YYYY-MM-DD, as the runtime's dates are, so they compare as
2080
+ * text.
2081
+ */
2082
+ export declare function checkInvoicingPeriod(start: string, end: string): string | undefined;
2083
+ /** The rule an invoicing period breaks by holding neither date (BR-CO-19), or undefined: `start` and `end` say which it holds. */
2084
+ export declare function periodBreak(start: boolean, end: boolean): string | undefined;
2085
+ /**
2086
+ * The rule an invoice breaks that says nothing of when it was supplied, or
2087
+ * undefined: § 14 (4) 1 no. 6 UStG asks a German invoice for the time of
2088
+ * supply, which the XML gives as a delivery date or an invoicing period.
2089
+ * Not one of CEN's rules: FeRD's BR-FX-DE-04, as the specification is
2090
+ * transcribed [S], only warns of an invoice without one.
2091
+ */
2092
+ export declare function supplyBreak(delivered: boolean, period: boolean): string | undefined;
1456
2093
  /** What a line's term is read from: its business term, whose rule holds it, what a refusal calls it, and the types of field that can give it. */
1457
2094
  interface EInvoiceLineTerm {
1458
2095
  readonly term: EInvoiceTextTerm | EInvoiceDecimalTerm;
@@ -1471,23 +2108,6 @@ type EInvoiceLineCode = 'id' | 'unit' | 'vat';
1471
2108
  export declare const E_INVOICE_LINE_COLUMNS: { readonly [K in EInvoiceLineColumn]: EInvoiceLineTerm; };
1472
2109
  /** Each code read from a line's row, a detail field of one of these types or an expression held to them in the same way. */
1473
2110
  export declare const E_INVOICE_LINE_CODES: { readonly [K in EInvoiceLineCode]: EInvoiceLineTerm; };
1474
- /**
1475
- * The rule an invoicing period breaks whose dates the data resolved, or
1476
- * undefined: it ends no earlier than it starts (BR-29). Both are calendar
1477
- * dates written YYYY-MM-DD, as the runtime's dates are, so they compare as
1478
- * text.
1479
- */
1480
- export declare function checkInvoicingPeriod(start: string, end: string): string | undefined;
1481
- /** The rule an invoicing period breaks by holding neither date (BR-CO-19), or undefined: `start` and `end` say which it holds. */
1482
- export declare function periodBreak(start: boolean, end: boolean): string | undefined;
1483
- /**
1484
- * The rule an invoice breaks that says nothing of when it was supplied, or
1485
- * undefined: § 14 (4) 1 no. 6 UStG asks a German invoice for the time of
1486
- * supply, which the XML gives as a delivery date or an invoicing period.
1487
- * Not one of CEN's rules: FeRD's BR-FX-DE-04, as the specification is
1488
- * transcribed [S], only warns of an invoice without one.
1489
- */
1490
- export declare function supplyBreak(delivered: boolean, period: boolean): string | undefined;
1491
2111
  /**
1492
2112
  * The rules the seller's identifiers break, `has` saying which it holds,
1493
2113
  * for an invoice whose lines are in categories of `codes`:
@@ -1554,8 +2174,6 @@ export declare function vatCategoryBreaks(categories: readonly {
1554
2174
  }[]): readonly VatCategoryBreak[];
1555
2175
  /** The category a line names by `id`, a category the invoice declares (BR-CO-04). */
1556
2176
  export declare function checkLineCategory(id: string, categories: readonly VatCategory[]): PaymentCheck<VatCategory>;
1557
- //#endregion
1558
- //#region src/errors.d.ts
1559
2177
  /**
1560
2178
  * What validation can say is wrong with a report, as stable codes.
1561
2179
  *
@@ -1564,7 +2182,7 @@ export declare function checkLineCategory(id: string, categories: readonly VatCa
1564
2182
  * reworded once released; a new rule gets a new code. Each has a refusal
1565
2183
  * test in `validate.test.ts`, which does not compile while one is missing.
1566
2184
  */
1567
- export declare const REPORT_ERROR_CODES: readonly ["not-a-report", "unsupported-version", "not-json", "too-many-errors", "wrong-type", "missing-property", "unknown-property", "unknown-kind", "not-one-of", "out-of-range", "not-an-integer", "too-precise", "too-long", "too-many", "too-few", "empty-expression", "invalid-id", "invalid-locale", "invalid-color", "invalid-currency", "invalid-digest", "invalid-default", "invalid-decimal", "invalid-qr-bill", "invalid-epc-qr-code", "invalid-e-invoice", "printable-area-too-small", "scale-on-non-decimal", "duplicate-id", "reserved-id", "unknown-style", "unknown-dataset", "unknown-field", "unknown-parameter", "unknown-asset", "unknown-aggregate", "unknown-column", "misplaced-flow-component", "nested-flow-component", "misplaced-page-counter", "misplaced-detail-field", "misplaced-group-aggregate", "second-detail-table", "nesting-too-deep", "duplicate-component-id", "duplicate-column-id", "duplicate-footer-cell", "duplicate-sort-key", "exceeds-printable-area", "payment-part-page", "aggregate-type-mismatch", "format-type-mismatch", "binding-type-mismatch"];
2185
+ export declare const REPORT_ERROR_CODES: readonly ["not-a-report", "unsupported-version", "not-json", "too-many-errors", "wrong-type", "missing-property", "unknown-property", "unknown-kind", "not-one-of", "out-of-range", "not-an-integer", "too-precise", "too-long", "too-many", "too-few", "empty-expression", "invalid-id", "invalid-locale", "invalid-color", "invalid-currency", "invalid-digest", "invalid-default", "invalid-form-path", "invalid-decimal", "invalid-qr-bill", "invalid-epc-qr-code", "invalid-e-invoice", "invalid-chart", "printable-area-too-small", "scale-on-non-decimal", "duplicate-id", "reserved-id", "incomplete-form-binding", "misplaced-form-binding", "invalid-form-override", "unknown-style", "unknown-dataset", "unknown-field", "unknown-parameter", "unknown-asset", "unknown-aggregate", "unknown-column", "asset-not-a-font", "asset-not-an-image", "missing-face", "misplaced-flow-component", "nested-flow-component", "misplaced-page-counter", "misplaced-detail-field", "misplaced-group-aggregate", "misplaced-table-aggregate", "misplaced-baseline", "second-detail-table", "nesting-too-deep", "duplicate-component-id", "duplicate-column-id", "duplicate-footer-cell", "duplicate-sort-key", "exceeds-printable-area", "payment-part-page", "aggregate-type-mismatch", "format-type-mismatch", "binding-type-mismatch", "duplicate-language", "not-a-word", "duplicate-word", "blank-translation"];
1568
2186
  type ReportErrorCode = (typeof REPORT_ERROR_CODES)[number];
1569
2187
  interface ReportError {
1570
2188
  /** A JSON Pointer (RFC 6901) to what is wrong; '' is the whole document. */
@@ -1574,8 +2192,6 @@ interface ReportError {
1574
2192
  /** The innermost component the error is inside, when it is inside one whose id could be read. */
1575
2193
  readonly componentId?: string;
1576
2194
  }
1577
- //#endregion
1578
- //#region src/validate.d.ts
1579
2195
  type ReportValidation = {
1580
2196
  readonly valid: true;
1581
2197
  readonly report: ReportDefinition;
@@ -1600,27 +2216,6 @@ type ReportValidation = {
1600
2216
  * message and no path grows with what the document holds.
1601
2217
  */
1602
2218
  export declare function validateReport(document: unknown): ReportValidation;
1603
- //#endregion
1604
- //#region src/limits.d.ts
1605
- /**
1606
- * The bounds a report definition is held to, and why each exists.
1607
- *
1608
- * A template is untrusted input, even when an administrator wrote it. Every
1609
- * array, string and number in it is bounded, so that validating, hashing,
1610
- * editing and later laying one out costs work that does not grow with
1611
- * whatever a broken or hostile document holds. An array is measured before
1612
- * any element of it is read.
1613
- *
1614
- * The numbers are chosen, not measured: each sits well above what the three
1615
- * starter reports need (plan 7) and low enough to keep that work small. Two
1616
- * are not chosen, and say where they come from. Raising a bound is safe;
1617
- * lowering one refuses reports that were valid, which once the format is
1618
- * frozen means a new reportSpecVersion.
1619
- *
1620
- * The bounds of an SVG asset, at the end, are the exception: each but
1621
- * `MAX_SVG_REMOVED_NAMES` was measured, and says how, on what and when
1622
- * (0030).
1623
- */
1624
2219
  /**
1625
2220
  * Errors listed per validation. Past it, one `too-many-errors` entry says
1626
2221
  * the list was cut short, so a caller never mistakes a partial list for a
@@ -1647,10 +2242,38 @@ export declare const MIN_COLUMNS = 2;
1647
2242
  export declare const MAX_COLUMNS = 4;
1648
2243
  /** Columns in a table: wider than a landscape page can show legibly, and a bound on per-row work. */
1649
2244
  export declare const MAX_TABLE_COLUMNS = 32;
2245
+ /**
2246
+ * Tables in a report, counting those inside containers (0062). Chosen, not
2247
+ * measured: each table orders the rows its condition selects, work no step
2248
+ * budget counts, and reads its condition once per detail row, which the
2249
+ * render's budget does; a report of more lists than eight is several
2250
+ * reports. Ordering the runtime's `MAX_DETAIL_ROWS` once, by two keys,
2251
+ * took a median of 0.5 seconds (Node 24.21, an Intel i9-10900K, 15 October
2252
+ * 2026, as measured beside that bound). What eight cost at that bound was
2253
+ * measured on the same machine and Node on 15 November 2026, the median of
2254
+ * five runs of the built runtime's `resolveReport` after one that warmed
2255
+ * it, each table of two columns grouped by one field, sorted by another
2256
+ * and totalling one sum over its rows: one table without a condition
2257
+ * resolved in 1.4 seconds, eight each selecting an eighth of the rows by a
2258
+ * condition of one read in 4.0, and eight each selecting every row,
2259
+ * 800,000 rows lowered, in 12.2. A condition of one read is charged two
2260
+ * steps, so eight read over every row spend 1,600,000 of the runtime's
2261
+ * `RENDER_STEP_BUDGET`.
2262
+ */
2263
+ export declare const MAX_TABLES = 8;
1650
2264
  /** Sort keys on a table. Each one costs a comparison per row pair; a longer sort is usually a missing key. */
1651
2265
  export declare const MAX_SORT_KEYS = 8;
1652
2266
  /** Rows under a group or under the table: a subtotal, a discount, two tax lines and a total fit with room to spare. */
1653
2267
  export declare const MAX_FOOTER_ROWS = 8;
2268
+ /**
2269
+ * The most of its group's first rows a group header may be kept on its
2270
+ * page with (0059). Chosen, not measured: well above the two or three rows
2271
+ * that keep a group from starting at the foot of a page. A count past what
2272
+ * a page holds keeps what fits, so the bound protects no page: it refuses
2273
+ * a count nobody means, and bounds what the renderer adds up for each
2274
+ * group header.
2275
+ */
2276
+ export declare const MAX_KEEP_WITH_ROWS = 32;
1654
2277
  /** Fields in one dataset contract: a report prints a fraction of any source table's columns. */
1655
2278
  export declare const MAX_DATASET_FIELDS = 64;
1656
2279
  /** Print styles in one report. A report's look is a handful of tokens; this is many handfuls. */
@@ -1670,6 +2293,30 @@ export declare const MAX_ASSETS = 64;
1670
2293
  * `MAX_SVG_BYTES` besides.
1671
2294
  */
1672
2295
  export declare const MAX_ASSET_BYTES: number;
2296
+ /**
2297
+ * The most bytes a report may have as a draft: the UTF-8 length of its
2298
+ * JSON, which is what a client sends and a server can count before it
2299
+ * parses anything, so a route can bound its body by this one constant.
2300
+ * 256 KiB, the least power of two that is at least sixteen times the
2301
+ * largest report definition the corpus exports, starters, samples and the
2302
+ * site visit's report among them. That is the XRechnung sample, 16,254
2303
+ * bytes, an e-invoice being the report with the most terms to state; the
2304
+ * next is 16,027 and the smallest 3,956 (measured on 2026-10-28 on an
2305
+ * Apple M2 under Node 22.23.3, as
2306
+ * `new TextEncoder().encode(JSON.stringify(report)).byteLength`). A
2307
+ * report sixteen times the richest one is a document that should be
2308
+ * several, and the limit is a quarter of the mebibyte Fastify reads by
2309
+ * default, which a draft's request should not need to exceed.
2310
+ *
2311
+ * The factor is chosen, and the bounds above allow far more: one region of
2312
+ * `MAX_REGION_COMPONENTS` text components that each hold `MAX_TEXT_LENGTH`
2313
+ * characters holds five million characters. A report of that kind
2314
+ * validates and is not kept as a draft. Raising the limit is safe;
2315
+ * lowering it refuses reports that were kept. The corpus's
2316
+ * `report-size.test.ts` holds every report there to the limit, and the
2317
+ * limit to this factor.
2318
+ */
2319
+ export declare const MAX_REPORT_BYTES = 262144;
1673
2320
  /**
1674
2321
  * Pixels a side of a PNG or a JPEG asset: the renderer trial's limit too,
1675
2322
  * and as chosen. What pictures of this size cost the renderer to embed is
@@ -1678,7 +2325,11 @@ export declare const MAX_ASSET_BYTES: number;
1678
2325
  * one and where it prints.
1679
2326
  */
1680
2327
  export declare const MAX_ASSET_SIDE = 4096;
1681
- /** Aggregates: each is a pass over the detail rows, per group and once overall. */
2328
+ /** Series in a chart: a colour each from the palette, so that the legend tells every one apart. Derived, not chosen. */
2329
+ export declare const MAX_CHART_SERIES: 8;
2330
+ /** The least a chart's side: under an inch (72 points) holds no plot beneath its title and its labels. Chosen, not measured. */
2331
+ export declare const MIN_CHART_SIDE = 72;
2332
+ /** Aggregates: each is a pass over the detail rows, per group, once per table that selects its rows (0062), and once overall. */
1682
2333
  export declare const MAX_AGGREGATES = 32;
1683
2334
  /**
1684
2335
  * VAT categories an e-invoice declares, each a VAT breakdown (BG-23) its
@@ -1700,6 +2351,55 @@ export declare const MAX_KEY_LENGTH = 64;
1700
2351
  export declare const MAX_TEXT_LENGTH = 10000;
1701
2352
  /** Characters in a title, label, column header, empty-state text or parameter default: one line, generously. */
1702
2353
  export declare const MAX_LABEL_LENGTH = 200;
2354
+ /**
2355
+ * Keys in a formancy data path a dataset field is read from (0042): a
2356
+ * field in a group in a group, sixteen deep. Chosen, not measured: formancy
2357
+ * bounds no nesting, and a person filling in a form does not follow one
2358
+ * deeper than a few groups. It bounds a path to 1,039 characters, so no
2359
+ * path a message names grows with what a document holds.
2360
+ */
2361
+ export declare const MAX_FORM_PATH_KEYS = 16;
2362
+ /**
2363
+ * Characters in a member a dataset field is read from: a matrix row's
2364
+ * value or a selectboxes option's (0042). Not chosen: formancy's schema
2365
+ * writes both from 1 to 200 characters, so a longer one names nothing a
2366
+ * form could hold.
2367
+ */
2368
+ export declare const MAX_FORM_MEMBER_LENGTH = 200;
2369
+ /**
2370
+ * Form versions one binding is read differently in (0048): the overrides
2371
+ * a review writes on a field, or on the detail's repeater, one for each
2372
+ * version that moved or removed it. Chosen, not measured: a field moved
2373
+ * by 64 versions of its form is read from a form that has become another
2374
+ * one, and a report better started again from it (0045). It bounds a
2375
+ * binding to 64 hashes, so no binding grows with what a document holds.
2376
+ */
2377
+ export declare const MAX_FORM_OVERRIDES = 64;
2378
+ /**
2379
+ * Languages a report is written in, its own among them (0063). Chosen, not
2380
+ * measured: the European Union's official languages are twenty-four, and a
2381
+ * report is validated once for each language it declares.
2382
+ */
2383
+ export declare const MAX_LANGUAGES = 24;
2384
+ /**
2385
+ * Words one translation holds, and expressions that print words: each list
2386
+ * bounded by it (0063). 1,024, the least power of two that is at least
2387
+ * sixteen times the most a report the corpus exports holds of both: the
2388
+ * XRechnung sample, 36 distinct words and 13 expression runs where words
2389
+ * stand, 49 (measured on 2026-11-15 on an Intel i9-10900K under Windows 11
2390
+ * and Node 24.21.0, as the distinct texts `reportWords` gives and the
2391
+ * distinct sources `wordExpressionSites` gives). That sample written in
2392
+ * `MAX_LANGUAGES` languages, each translation as long as its word, is
2393
+ * 91,113 bytes, inside `MAX_REPORT_BYTES`.
2394
+ *
2395
+ * The format admits far more words than this: every region may hold
2396
+ * `MAX_REGION_COMPONENTS` texts of `MAX_INLINES` runs. Such a report
2397
+ * validates and cannot be translated whole: each word past the bound stays
2398
+ * missing in that language, said as report-core's `word-missing`, and a
2399
+ * render in it is refused. The corpus's `report-size.test.ts` holds the
2400
+ * bound to this factor.
2401
+ */
2402
+ export declare const MAX_WORDS = 1024;
1703
2403
  /** Characters in a CEL expression. An expression is a formula, not a program; the runtime bounds its evaluation too. */
1704
2404
  export declare const MAX_EXPRESSION_LENGTH = 1024;
1705
2405
  /** Digits after the decimal point, for fields, formats and rounding. Covers every currency's minor unit and unit prices to many places. */
@@ -1870,26 +2570,149 @@ export declare const MAX_SVG_CASCADE = 1000000;
1870
2570
  * bound of 16 would have cut it short.
1871
2571
  */
1872
2572
  export declare const MAX_SVG_REMOVED_NAMES = 32;
1873
- //#endregion
1874
- //#region src/syntax.d.ts
1875
2573
  /**
1876
- * What a valid string looks like, for each string in a report that has a
1877
- * syntax. One pattern per thing, so the validator and an editor checking a
1878
- * value as it is typed cannot disagree.
1879
- *
1880
- * Each accepts one spelling of each value -- lower-case hex, canonical
1881
- * locale case, no negative zero -- so that one value has one canonical hash.
1882
- */
2574
+ * The bounds of a font asset (0040), each measured on 21 October 2026 on
2575
+ * an Intel i9-10900K under Windows 11 and Node 24.21.0, shared with another
2576
+ * workflow's builds (8 to 11 % load), medians of seven reads: on the
2577
+ * costliest font these three admit, made in code; on the 447 `.ttf` and
2578
+ * `.ttc` files of the machine's Windows fonts directory, never copied into
2579
+ * the repository; and on the faces the renderer ships. The reads, and the
2580
+ * tally of the machine's fonts, were measured again on 22 October 2026, on
2581
+ * the reader as review left it, at 1 to 12 % load.
2582
+ */
2583
+ /**
2584
+ * Bytes in a font: an image asset's 20 MB (`MAX_ASSET_BYTES`), which a
2585
+ * builder, the runtime and the renderer already hold an asset to. The
2586
+ * costliest font it admits -- 65,534 glyphs each walked flag by flag, a
2587
+ * format 12 map of 131,066 characters -- read in 60 ms (57-65); Malgun
2588
+ * Gothic, 13.5 MB and 28,215 glyphs, in 16 to 17 ms, Liberation Sans in
2589
+ * 0.8.
2590
+ * What subsetting a large font costs a render is bounded by the outlines'
2591
+ * points and work together (`MAX_FONT_POINTS`, `MAX_FONT_OUTLINE_WORK`),
2592
+ * not by its bytes; of the machine's fonts, two collections and
2593
+ * SimSun-ExtB, 21.9 MB, are past it.
2594
+ */
2595
+ export declare const MAX_FONT_BYTES: number;
2596
+ /**
2597
+ * Characters one font may map: 131,072, twice the BMP. A kilobyte of
2598
+ * format 12 can map every code point there is, a Set of 1,114,112 entries
2599
+ * that took 150 ms and 60 to 80 MiB of heap to build; at this bound the Set
2600
+ * takes 8 ms and 5 MiB. Of the 412 fonts on the machine the reader
2601
+ * accepts, the most a font maps is 28,530 (HP Simplified Hans); Roboto maps
2602
+ * 927, Liberation Sans 2,327. Chosen, at more than four times the most
2603
+ * measured.
2604
+ */
2605
+ export declare const MAX_FONT_CHARACTERS = 131072;
2606
+ /**
2607
+ * A simple glyph's points times its contours. fontkit, through which
2608
+ * PDFKit subsets a font, looks every point up among the glyph's contour
2609
+ * ends: one glyph of 32,767 contours and 65,534 points, 66 KB of a font
2610
+ * the reader otherwise accepts, took PDFKit 1.6 s to embed, and 16,000
2611
+ * contours of 32,000 points 0.4 s, four times as long for each doubling.
2612
+ * At this bound a glyph costs it under a millisecond: 200 such glyphs
2613
+ * embedded in 168 ms. The most of any glyph in the machine's fonts is
2614
+ * 160,000 (200 contours of 800 points, Lucida Sans Unicode); Liberation
2615
+ * Sans's is 28,224, Roboto's 3,549.
2616
+ */
2617
+ export declare const MAX_FONT_GLYPH_WORK = 1048576;
2618
+ /**
2619
+ * The points of every simple glyph of a font, together: 2,097,152 (2^21).
2620
+ * A subset holds every glyph a printed character reaches -- a composite's
2621
+ * components among them, which may be every glyph the font has -- and
2622
+ * fontkit decodes each point of each into an object of its own when PDFKit
2623
+ * subsets. A font this reader accepted under the bounds above, one 'A'
2624
+ * composed of 36,733 glyphs of 16 contours and 65,536 points, took PDFKit
2625
+ * 162 s to embed (0043). Of the 412 fonts on the machine the reader
2626
+ * accepts, the most points a font holds is 1,886,654 (Malgun Gothic Bold,
2627
+ * a Hangul font whose script no report prints), Noto Sans 65,560 and
2628
+ * Liberation Sans 35,285. Chosen just past the most measured, since the
2629
+ * cost is what a render waits for, and the fonts that come near it hold
2630
+ * Hangul, Han or a dozen scripts, which no report prints. At this bound
2631
+ * and the next, the costliest subset found -- 31 glyphs of 8 contours and
2632
+ * 65,536 points of one-byte coordinates and 65,500 glyphs of one point,
2633
+ * one composite made of them all -- took PDFKit 1.3 to 1.4 s to embed,
2634
+ * over three runs.
2635
+ * Measured on 22 October 2026 on an Intel i9-10900K under Windows 11 and
2636
+ * Node 24.21.0, shared with two other workflows' builds.
2637
+ */
2638
+ export declare const MAX_FONT_POINTS = 2097152;
2639
+ /**
2640
+ * Every simple glyph's points times its contours, together: 16,777,216
2641
+ * (2^24), sixteen glyphs at `MAX_FONT_GLYPH_WORK`. fontkit looks each point
2642
+ * up among its glyph's contour ends, so a font of fewer points than the
2643
+ * bound above can still cost a subset this much; sixteen glyphs at the
2644
+ * bound took PDFKit 44 ms to embed. The most of the machine's fonts is
2645
+ * 12,342,110 (Malgun Gothic), Liberation Sans's 123,704. Chosen past the
2646
+ * most measured, as above. Measured as above.
2647
+ */
2648
+ export declare const MAX_FONT_OUTLINE_WORK = 16777216;
2649
+ /**
2650
+ * The components of every composite glyph of a font, together: 262,144
2651
+ * (2^18). PDFKit's subset decodes a composite's components into a list,
2652
+ * however many of them name the same glyph: one composite of 3,490,000
2653
+ * components, what 20 MiB holds, took PDFKit 1.0 s and 431 MiB of heap to
2654
+ * embed for one 'A'. The most of the machine's fonts is 68,743 (HP
2655
+ * Simplified Hans Light), and the most in one glyph 15; Liberation Sans
2656
+ * holds 2,131, Roboto 1,321. Chosen at nearly four times the most measured.
2657
+ * Measured as above.
2658
+ */
2659
+ export declare const MAX_FONT_COMPONENTS = 262144;
2660
+ /**
2661
+ * A font's line, in ems: its horizontal header's ascender less its
2662
+ * descender, over its units to the em, which is how tall pdfmake lays out
2663
+ * each line of it (PDFKit's `lineHeight`, from fontkit's `hhea.ascent`,
2664
+ * `hhea.descent` and `head.unitsPerEm`; the line gap unread), its
2665
+ * baseline the ascender below the line's top. The renderer counts a line
2666
+ * of text as its size times this when it refuses a report too long for its
2667
+ * page limit before laying it out (`bound.ts`), so the floor bounds how
2668
+ * many lines a limit admits: at 0.5, 2.3 times what Roboto's 1.172 does.
2669
+ * Unbounded, a face of a line of nothing printed a report of 20,000 lines,
2670
+ * limited to one page, on one spot of that page, in 921 ms, and one of 4
2671
+ * units to the em 2,000 lines within 35 points, each over the last (0040).
2672
+ * The ceiling refuses metrics no font measured comes near; a line too tall
2673
+ * for the page is refused at print besides.
2674
+ * Measured on 22 October 2026 on the machine above, over the 425 fonts the
2675
+ * reader accepts of Roboto 3.014's four faces, Liberation Sans, Serif and
2676
+ * Mono 2.1.5's eight, Noto Sans Regular (0043's Sources) and the 447 files
2677
+ * of the machine's Windows fonts directory: the shortest line is Ink
2678
+ * Free's, 0.864, then Footlight MT Light's, 0.915 and Palace Script MT's,
2679
+ * 0.926; the tallest Sans Serif Collection's, 2.651, then Javanese Text's,
2680
+ * 2.271 and Myanmar Text Bold's, 1.904; Liberation's are 1.107 to 1.133,
2681
+ * Roboto's 1.172 and Noto Sans's 1.362. fontkit read every one's ascender,
2682
+ * descender and units as the reader does. Chosen with a margin: the floor
2683
+ * half the shortest line, rounded up to half an em, 42 % below it; the
2684
+ * ceiling one and a half times the tallest, rounded to a whole em, 51 %
2685
+ * above it.
2686
+ */
2687
+ export declare const MIN_FONT_LINE = 0.5;
2688
+ export declare const MAX_FONT_LINE = 4;
1883
2689
  /** Whether `value` is an identifier a report can use for a component, style, dataset, asset or table column. */
1884
2690
  export declare function isIdentifier(value: unknown): value is string;
1885
2691
  /** Whether `value` is a field key: the id of a dataset field, a parameter or an aggregate. */
1886
2692
  export declare function isFieldKey(value: unknown): value is string;
1887
- //#endregion
1888
- //#region src/digest.d.ts
2693
+ /**
2694
+ * Whether `value` is a formancy data path in one scope, as a dataset field
2695
+ * is read from a submission (0042): field keys joined by dots, as
2696
+ * `modelDataPaths` writes a group's child, `address.street`, and at most
2697
+ * `MAX_FORM_PATH_KEYS` of them. A repeater's `[]` is not in it, since a
2698
+ * path is read in the submission's scope or a row's, never across both.
2699
+ */
2700
+ export declare function isFormPath(value: unknown): value is string;
2701
+ /** Whether `value` is a formancy form's id: what a report's provenance names, and the runtime's data source (0041). */
2702
+ export declare function isFormId(value: unknown): value is string;
2703
+ /** Whether `value` is a locale as a report writes one: what the runtime holds the locale a form source's labels were read in to (0063), so that the two cannot read a locale differently. */
2704
+ export declare function isLocale(value: unknown): value is string;
2705
+ /**
2706
+ * Whether `value` is an asset's digest as a report declares one, `sha256:`
2707
+ * and 64 lower-case hex digits: the one rule for it, which the report
2708
+ * server judges a path's digest by, with `sha256:` before it, and its store
2709
+ * names a file by (0049).
2710
+ */
2711
+ export declare function isDigest(value: unknown): value is string;
2712
+ /** Whether `value` is a form version's hash as `schemaHash` writes one: what a report's provenance pins, and the runtime's data source (0041). */
2713
+ export declare function isSchemaHash(value: unknown): value is string;
1889
2714
  /** `sha256:` and the lower-case hex SHA-256 of exactly `bytes`; @noble/hashes' TypeError for anything that is not a Uint8Array. */
1890
2715
  export declare function assetDigest(bytes: Uint8Array): string;
1891
- //#endregion
1892
- //#region src/image-header.d.ts
1893
2716
  /** A PNG's header, as the renderer needs it to check the image data: its scanlines follow from the size, the bits a pixel and the interlace. */
1894
2717
  interface PngHeader {
1895
2718
  readonly ok: true;
@@ -1910,6 +2733,15 @@ interface JpegHeader {
1910
2733
  readonly height: number;
1911
2734
  /** Grey, RGB or CMYK, as PDFKit draws a JPEG of one, three or four components (pdfkit.js 3808-3812). */
1912
2735
  readonly components: 1 | 3 | 4;
2736
+ /**
2737
+ * How its first Exif block turns or mirrors it, 2 to 8, as PDFKit reads
2738
+ * the tag and draws it; absent where the picture is upright -- the block
2739
+ * says 1, says nothing, or is not there. `width` and `height` are
2740
+ * already the turned picture's. A writer that embeds the bytes as they
2741
+ * are and cannot say what its reader does with the tag refuses one that
2742
+ * has it (0068).
2743
+ */
2744
+ readonly orientation?: 2 | 3 | 4 | 5 | 6 | 7 | 8;
1913
2745
  }
1914
2746
  type RasterHeader = PngHeader | JpegHeader;
1915
2747
  /** Why a PNG's or a JPEG's bytes are refused, each the first thing found wrong with them. */
@@ -1939,8 +2771,6 @@ type ImageRefusal = {
1939
2771
  export declare function sniffImage(bytes: Uint8Array): AssetMediaType | undefined;
1940
2772
  /** A PNG's or a JPEG's header, read as the renderer reads it, or the first thing wrong with it. */
1941
2773
  export declare function imageHeader(bytes: Uint8Array): RasterHeader | ImageRefusal;
1942
- //#endregion
1943
- //#region src/svg-allow.d.ts
1944
2774
  /**
1945
2775
  * What an approved SVG may hold, as tables: the elements kept and the
1946
2776
  * geometry each is written with, the properties kept and the order they are
@@ -1963,8 +2793,6 @@ export declare function imageHeader(bytes: Uint8Array): RasterHeader | ImageRefu
1963
2793
  */
1964
2794
  /** The elements a cleaned drawing is written with. */
1965
2795
  declare const KEPT_ELEMENTS: readonly ["svg", "g", "defs", "path", "rect", "circle", "ellipse", "line", "polyline", "polygon", "linearGradient", "radialGradient", "stop", "clipPath"];
1966
- //#endregion
1967
- //#region src/svg-refusal.d.ts
1968
2796
  /** Why an SVG is refused, each the first thing found that is wrong with it. */
1969
2797
  export declare const SVG_REFUSAL_CODES: readonly ["not-svg", "not-well-formed", "encoding", "doctype", "text", "raster", "reference", "unsupported", "out-of-range", "too-large", "too-deep"];
1970
2798
  type SvgRefusalCode = (typeof SVG_REFUSAL_CODES)[number];
@@ -1982,16 +2810,12 @@ interface SvgRemoval {
1982
2810
  readonly count: number;
1983
2811
  }
1984
2812
  type SvgRemovalKind = 'element' | 'attribute' | 'property' | 'comment' | 'declaration' | 'doctype';
1985
- //#endregion
1986
- //#region src/svg-drawing.d.ts
1987
2813
  interface ViewBox {
1988
2814
  readonly x: number;
1989
2815
  readonly y: number;
1990
2816
  readonly width: number;
1991
2817
  readonly height: number;
1992
2818
  }
1993
- //#endregion
1994
- //#region src/svg-extent.d.ts
1995
2819
  interface SvgExtent {
1996
2820
  /** The page-sized groups': the largest row sum of the inverse of the linear part of a matrix one is drawn under, and the largest coordinate that inverse takes the viewBox's origin to. */
1997
2821
  readonly groups: {
@@ -2010,8 +2834,6 @@ interface SvgExtent {
2010
2834
  /** The deepest the converter nests the graphics state in one content stream: once as it starts, once for the svg, once for every group and every shape, a group's own stream starting again. A clip path's stream nests two, its own save and its shape's (`source.js:2207-2219`), below any shape in the svg's. */
2011
2835
  readonly nesting: number;
2012
2836
  }
2013
- //#endregion
2014
- //#region src/svg.d.ts
2015
2837
  interface CleanSvg {
2016
2838
  readonly ok: true;
2017
2839
  /** The canonical drawing: ASCII, what the approved asset holds. */
@@ -2041,8 +2863,128 @@ type CheckedSvg = Omit<CleanSvg, 'removed' | 'removedMore'>;
2041
2863
  export declare function cleanSvg(bytes: Uint8Array): CleanSvg | SvgRefusal;
2042
2864
  /** The renderer's check: the drawing, when `bytes` are already what `cleanSvg` writes; refused naming the first difference otherwise. */
2043
2865
  export declare function checkSvg(bytes: Uint8Array): CheckedSvg | SvgRefusal;
2044
- //#endregion
2045
- //#region src/hash.d.ts
2866
+ /**
2867
+ * How a font is refused: the codes, what a person can do about each, and
2868
+ * the refusal the reader throws where it finds a fault and catches once, at
2869
+ * its edge (0040).
2870
+ *
2871
+ * A refusal names what was found and where, by the name of a table this
2872
+ * reader knows, never a byte of the font: no name string, no tag a font
2873
+ * invented, no text of its licence. Numbers the reader decoded -- a
2874
+ * version, a format, the offset where a table runs out -- are said in the
2875
+ * reader's own digits, so a message holds nothing a font chose but a
2876
+ * number.
2877
+ */
2878
+ /** Why a font is refused, each the first thing found that is wrong with it. */
2879
+ export declare const FONT_REFUSAL_CODES: readonly ["not-a-font", "format", "cff", "variable", "colour", "no-outlines", "embedding", "character-map", "malformed", "too-large"];
2880
+ type FontRefusalCode = (typeof FONT_REFUSAL_CODES)[number];
2881
+ /** The font formats a `format` refusal names. */
2882
+ export declare const FONT_FORMATS: readonly ["collection", "woff", "woff2", "eot", "type-1"];
2883
+ type FontFormat = (typeof FONT_FORMATS)[number];
2884
+ /** Why an fsType refuses embedding, each the first found, in this order. */
2885
+ export declare const FONT_EMBEDDING_REFUSALS: readonly ["invalid", "restricted", "bitmap-only", "no-subsetting"];
2886
+ type FontEmbeddingRefusal = (typeof FONT_EMBEDDING_REFUSALS)[number];
2887
+ /** A refusal, said in English after the font's name -- the renderer says `the font ${message}` -- with, for a format or an embedding, which one, for a person's own language. */
2888
+ type FontRefusal = {
2889
+ readonly ok: false;
2890
+ readonly code: Exclude<FontRefusalCode, 'format' | 'embedding'>;
2891
+ readonly message: string;
2892
+ } | {
2893
+ readonly ok: false;
2894
+ readonly code: 'format';
2895
+ readonly message: string;
2896
+ readonly format: FontFormat;
2897
+ } | {
2898
+ readonly ok: false;
2899
+ readonly code: 'embedding';
2900
+ readonly message: string;
2901
+ readonly embedding: FontEmbeddingRefusal;
2902
+ };
2903
+ /** What a font says it is called, and what it says of its licence, as it says it. */
2904
+ interface FontNames {
2905
+ /** The typographic family (name ID 16), or the family (1). */
2906
+ readonly family: string;
2907
+ /**
2908
+ * The family of name ID 1, where the font states a typographic family
2909
+ * (16) before it and `family` is that one; absent where `family` is name
2910
+ * ID 1 itself. It is the name an application that lists four faces to a
2911
+ * family knows the face by -- Word among them, to which "Probe Sans
2912
+ * Light" is a family and "Probe Sans" another -- so a writer that names
2913
+ * a face for such a reader names `legacyFamily ?? family` (0068).
2914
+ */
2915
+ readonly legacyFamily?: string;
2916
+ /** The typographic subfamily (17), or the subfamily (2). */
2917
+ readonly subfamily: string;
2918
+ /** The PostScript name (6), which the PDF names the font by: PDFKit writes it after a subset tag, each space as an underscore. */
2919
+ readonly postScriptName: string;
2920
+ /**
2921
+ * Every PostScript name the font's records of name ID 6 hold, each once,
2922
+ * in table order, `postScriptName` among them: fontkit returns one of
2923
+ * them, the last English record's, so a renderer that tells one face from
2924
+ * another by the name PDFKit keeps it by reads them all (0043).
2925
+ */
2926
+ readonly postScriptNames: readonly string[];
2927
+ /** The full name (4). */
2928
+ readonly fullName?: string;
2929
+ /** The version string (5). */
2930
+ readonly version?: string;
2931
+ /** The copyright notice (0). */
2932
+ readonly copyright?: string;
2933
+ /** The licence description (13), as the font states it. */
2934
+ readonly licence?: string;
2935
+ /** The licence information address (14), as the font states it, never opened. */
2936
+ readonly licenceUrl?: string;
2937
+ }
2938
+ /** What a font's fsType allows, where it allows embedding a subset of its outlines. */
2939
+ type FontEmbedding = 'installable' | 'preview-print' | 'editable';
2940
+ /** The metrics PDFKit lays a line out by, in font units: `unitsPerEm`, and the horizontal header's ascender, descender and line gap. A line is `ascender - descender` units, as `style.ts` says of Roboto's: in a font this accepts, the ascender above 0, the descender at or below 0, and the line `MIN_FONT_LINE` to `MAX_FONT_LINE` ems. */
2941
+ interface FontMetrics {
2942
+ readonly unitsPerEm: number;
2943
+ readonly ascender: number;
2944
+ readonly descender: number;
2945
+ readonly lineGap: number;
2946
+ }
2947
+ /** What the OS/2 table says of the face, for a person to choose which face it is: a builder proposes, and the person decides, since Roboto Medium, which pdfmake prints as bold, says it is regular. */
2948
+ interface FontStyle {
2949
+ readonly weight: number;
2950
+ readonly italic: boolean;
2951
+ readonly bold: boolean;
2952
+ readonly regular: boolean;
2953
+ }
2954
+ /** A font this reader accepts. */
2955
+ interface Font {
2956
+ readonly ok: true;
2957
+ readonly names: FontNames;
2958
+ /** What its fsType allows: installable, preview and print, or editable embedding. */
2959
+ readonly embedding: FontEmbedding;
2960
+ /** The OS/2 fsType as the font states it, for a record of what was read. */
2961
+ readonly fsType: number;
2962
+ readonly metrics: FontMetrics;
2963
+ readonly style: FontStyle;
2964
+ /** The glyph count, glyph 0 among them. */
2965
+ readonly glyphs: number;
2966
+ /** The code points it maps to a glyph other than glyph 0, as fontkit maps them (`characterMap`). */
2967
+ readonly characters: ReadonlySet<number>;
2968
+ }
2969
+ /** A font's bytes, read whole, or the first thing that is wrong with them. */
2970
+ export declare function readFont(bytes: Uint8Array): Font | FontRefusal;
2971
+ /** The code points a font maps to a glyph, as `characterMap` reads them. */
2972
+ interface FontCharacters {
2973
+ readonly ok: true;
2974
+ readonly characters: ReadonlySet<number>;
2975
+ }
2976
+ /**
2977
+ * The code points a font maps to a glyph other than glyph 0, from the
2978
+ * character map alone: the table directory and the 'cmap' table, of any
2979
+ * sfnt, and nothing else of the font. `readFont` reads the same map and
2980
+ * holds the rest of the font besides; this is what the renderer reads of
2981
+ * the faces it ships, whose embedding nothing needs to judge again. It
2982
+ * holds no glyph index to the glyph count, which it does not read, and
2983
+ * reads the character map whatever length the directory records for it,
2984
+ * which fontkit does not: a font a host brings is held to `readFont`'s
2985
+ * characters, which hold both.
2986
+ */
2987
+ export declare function characterMap(bytes: Uint8Array): FontCharacters | FontRefusal;
2046
2988
  /**
2047
2989
  * A 64-character lower-case hex SHA-256 of the report's canonical JSON,
2048
2990
  * taken over an envelope that names the format and its version, so a
@@ -2061,8 +3003,6 @@ export declare function checkSvg(bytes: Uint8Array): CheckedSvg | SvgRefusal;
2061
3003
  * refuses such a key first.
2062
3004
  */
2063
3005
  export declare function reportHash(report: ReportDefinition): string;
2064
- //#endregion
2065
- //#region src/empty.d.ts
2066
3006
  /**
2067
3007
  * A valid, empty A4 portrait report with 20 mm margins, nothing declared and
2068
3008
  * nothing in any region, recorded as started blank.
@@ -2072,8 +3012,6 @@ export declare function reportHash(report: ReportDefinition): string;
2072
3012
  * would refuse.
2073
3013
  */
2074
3014
  export declare function emptyReport(id: string, title: string, locale: string): ReportDefinition;
2075
- //#endregion
2076
- //#region src/walk.d.ts
2077
3015
  interface ComponentLocation {
2078
3016
  readonly component: Component;
2079
3017
  readonly region: RegionName;
@@ -2084,10 +3022,50 @@ interface ComponentLocation {
2084
3022
  }
2085
3023
  /** Every component in the report: regions in the order a reader meets them, each depth-first, a container before what it holds. */
2086
3024
  export declare function walkComponents(report: ReportDefinition): readonly ComponentLocation[];
3025
+ /**
3026
+ * The regions `regions` holds, each with its components, in the order a
3027
+ * reader meets them: every region but an optional one the report leaves
3028
+ * out, which holds nothing to visit or put a component in (0060).
3029
+ */
3030
+ export declare function heldRegions(regions: Regions): readonly (readonly [RegionName, readonly Component[]])[];
2087
3031
  /** The component with `id`, where it is, or undefined when the report has none. Ids are unique in a valid report. */
2088
3032
  export declare function componentAt(report: ReportDefinition, id: string): ComponentLocation | undefined;
2089
- //#endregion
2090
- //#region src/units.d.ts
3033
+ /** The locales `report` is written in: its own first, then each translation's, in the order declared. */
3034
+ export declare function declaredLocales(report: ReportDefinition): readonly string[];
3035
+ type LocaleChoice = {
3036
+ readonly ok: true;
3037
+ readonly locale: string;
3038
+ } | {
3039
+ readonly ok: false;
3040
+ readonly message: string;
3041
+ };
3042
+ /**
3043
+ * The locale a render of `report` prints in: `requested` where the report
3044
+ * is written in it, the report's own where nothing is requested. A locale
3045
+ * the report does not declare is refused, never matched to a near one:
3046
+ * de-DE is not de-CH, and de is neither.
3047
+ */
3048
+ export declare function renderLocale(report: ReportDefinition, requested?: string): LocaleChoice;
3049
+ /**
3050
+ * `report` -- one the validator accepts -- written in `locale` as far as
3051
+ * its translations go: each word and each word expression the language
3052
+ * translates replaced, every other left in the report's own; what the
3053
+ * validator checks each language by, and what the core diagnoses it by.
3054
+ * In the report's own locale, the report without its translations.
3055
+ * `locale` is one `renderLocale` accepted; another is a caller's mistake,
3056
+ * and throws a RangeError.
3057
+ */
3058
+ export declare function writtenIn(report: ReportDefinition, locale: string): ReportDefinition;
3059
+ /**
3060
+ * `report` -- one the validator accepts -- written in `locale`, whole:
3061
+ * what a render in that locale prints. A word the language does not
3062
+ * translate is never printed in another, so one missing throws a
3063
+ * RangeError, as an undeclared locale does: a caller asks `renderLocale`
3064
+ * first, and report-core's `languageDiagnostics`, which says each word
3065
+ * missing, and each expression that prints words, before anything is
3066
+ * written. Neither throw is reached from a check that was made.
3067
+ */
3068
+ export declare function reportIn(report: ReportDefinition, locale: string): ReportDefinition;
2091
3069
  /**
2092
3070
  * Lengths: the one conversion between points and millimetres, and the one
2093
3071
  * rounding every stored length goes through (plan 9).
@@ -2115,6 +3093,5 @@ export declare function mmToPt(millimetres: number): number;
2115
3093
  * well inside the 0.005 mm that would change the displayed hundredth.
2116
3094
  */
2117
3095
  export declare function ptToMm(points: number): number;
2118
- //#endregion
2119
- export { type AggregateDef, type AggregateFunction, type AggregateInline, type AggregateScope, type Alignment, type AssetMediaType, type AssetRef, type Border, type CheckedSvg, type CleanSvg, type ColumnSlot, type ColumnsComponent, type Component, type ComponentBase, type ComponentKind, type ComponentLocation, type CountryCode, type CurrencyFormat, type CurrencySource, type CurrencySourceKind, type DatasetContract, type DatasetRole, type Datasets, type DateFormat, type DateStyle, type EInvoice, type EInvoiceAddress, type EInvoiceBuyer, type EInvoiceCurrency, type EInvoiceDateRule, type EInvoiceDateTerm, type EInvoiceDecimalRule, type EInvoiceDecimalTerm, type EInvoiceKind, type EInvoiceLineCode, type EInvoiceLineColumn, type EInvoiceLineTerm, type EInvoiceLines, type EInvoiceName, type EInvoiceNeed, type EInvoiceProfile, type EInvoiceSeller, type EInvoiceTextRule, type EInvoiceTextTerm, type EInvoiceTextTerms, type En16931Rule, type EpcCaption, type EpcPairingBreak, type EpcPayloadFields, type EpcQrCodeComponent, type EpcTextField, type EpcTextFieldRule, type EpcTextRule, type Expression, type ExpressionInline, type FacturXInvoice, type FacturXProfileTerms, type FieldContract, type FieldInline, type FieldRef, type FieldType, type FontFamily, type Format, type FormatKind, type ImageComponent, type ImageFit, type ImageRefusal, type ImageRefusalCode, type ImageSource, type ImageSourceKind, type Inline, type InlineKind, type InvoiceTotal, type InvoiceTypeCode, type InvoicingPeriod, type JpegHeader, type KeepTogetherComponent, type LegalIdentifier, type LineComponent, type Margins, type NumberFormat, type Orientation, type PageBreakComponent, type PageCountInline, type PageDimensions, type PageNumberInline, type PageSettings, type PageSizeName, type ParameterDef, type ParameterInline, type ParameterType, type PaymentCheck, type PaymentInstructions, type PaymentMeansCode, type PaymentPart, type PaymentPartKind, type PngHeader, type PrintStyle, type Provenance, type ProvenanceKind, type QrBillAccount, type QrBillAddress, type QrBillCheck, type QrBillCurrency, type QrBillLanguage, type QrBillPageBreak, type QrBillPairingBreak, type QrBillReference, type QrBillReferenceType, type QrBillTextRule, type QrCodeComponent, type QrErrorCorrection, type RasterHeader, type RectangleComponent, type RegionName, type Regions, type ReportDefinition, type ReportError, type ReportErrorCode, type ReportValidation, type Rounding, type RoundingMode, type RowValue, KEPT_ELEMENTS as SVG_ELEMENTS, type SchemeId, type SectionComponent, type SortDirection, type SortKey, type SpacerComponent, type SpecVersionCheck, type StyleRule, type SvgExtent, type SvgRefusal, type SvgRefusalCode, type SvgRemoval, type SvgRemovalKind, type ViewBox as SvgViewBox, type SwissQrBill, type TableColumn, type TableComponent, type TableFooterCell, type TableFooterRow, type TableGroup, type TextComponent, type TextFormat, type TextInline, type TextTransform, type UnitCode, type ValueScope, type VatCategory, type VatCategoryBreak, type VatCategoryCode, type Width };
3096
+ export { type AddressScheme, type AggregateDef, type AggregateFunction, type AggregateInline, type AggregateScope, type Alignment, type AnyAssetMediaType, type AssetMediaType, type AssetRef, type BaselineShift, type Border, type CharacterRefusal, type ChartCategory, type ChartComponent, type ChartKind, type ChartOrder, type ChartSeries, type CheckedSvg, type CleanSvg, type ColumnSlot, type ColumnsComponent, type Component, type ComponentBase, type ComponentKind, type ComponentLocation, type CountryCode, type CurrencyFormat, type CurrencySource, type CurrencySourceKind, type DatasetContract, type DatasetFormBinding, type DatasetFormKind, type DatasetRole, type Datasets, type DateFormat, type DateStyle, type EInvoice, type EInvoiceAddress, type EInvoiceBuyer, type EInvoiceCurrency, type EInvoiceDateRule, type EInvoiceDateTerm, type EInvoiceDecimalRule, type EInvoiceDecimalTerm, type EInvoiceKind, type EInvoiceLineCode, type EInvoiceLineColumn, type EInvoiceLineTerm, type EInvoiceLines, type EInvoiceName, type EInvoiceNeed, type EInvoiceProfile, type EInvoiceSeller, type EInvoiceTerms, type EInvoiceTextRule, type EInvoiceTextRules, type EInvoiceTextTerm, type EInvoiceTextTerms, type ElectronicAddress, type En16931Rule, type EpcCaption, type EpcPairingBreak, type EpcPayloadFields, type EpcQrCodeComponent, type EpcTextField, type EpcTextFieldRule, type EpcTextRule, type Expression, type ExpressionInline, type FacturXInvoice, type FacturXProfileTerms, type FieldContract, type FieldFormBinding, type FieldFormOverride, type FieldInline, type FieldRef, type FieldType, type Font, type FontCharacters, type FontEmbedding, type FontEmbeddingRefusal, type FontFaceKey, type FontFaces, type FontFamily, type FontFormat, type FontMap, type FontMediaType, type FontMetrics, type FontNames, type FontRefusal, type FontRefusalCode, type FontStyle, type FormRead, type Format, type FormatKind, type ImageComponent, type ImageFit, type ImageRefusal, type ImageRefusalCode, type ImageSource, type ImageSourceKind, type Inline, type InlineKind, type InvoiceTotal, type InvoiceTypeCode, type InvoicingPeriod, type JpegHeader, type KeepTogetherComponent, type LegalIdentifier, type LineComponent, type LocaleChoice, type Margins, type NumberFormat, type OptionalRegionName, type Orientation, type PageBreakComponent, type PageCountInline, type PageDimensions, type PageNumberInline, type PageSettings, type PageSizeName, type ParameterDef, type ParameterInline, type ParameterType, type PaymentCheck, type PaymentInstructions, type PaymentMeansCode, type PaymentPart, type PaymentPartKind, type PngHeader, type PrintStyle, type PrintedBlock, type Provenance, type ProvenanceKind, type QrBillAccount, type QrBillAddress, type QrBillCheck, type QrBillCurrency, type QrBillLanguage, type QrBillPageBreak, type QrBillPairingBreak, type QrBillReference, type QrBillReferenceType, type QrBillTextRule, type QrCodeComponent, type QrErrorCorrection, type RasterHeader, type RectangleComponent, type RegionName, type Regions, type ReportDefinition, type ReportError, type ReportErrorCode, type ReportValidation, type Rounding, type RoundingMode, type RowValue, KEPT_ELEMENTS as SVG_ELEMENTS, type SchemeId, type SectionComponent, type SellerContact, type SortDirection, type SortKey, type SpacerComponent, type SpecVersionCheck, type StyleRule, type SvgExtent, type SvgRefusal, type SvgRefusalCode, type SvgRemoval, type SvgRemovalKind, type ViewBox as SvgViewBox, type SwissQrBill, type TableColumn, type TableComponent, type TableFooterCell, type TableFooterRow, type TableGroup, type TextComponent, type TextFormat, type TextInline, type TextTransform, type TranslatedExpression, type TranslatedWord, type Translation, type UnitCode, type ValueScope, type VatCategory, type VatCategoryBreak, type VatCategoryCode, type Width, type WordExpressionSite, type WordPlace, type XRechnungInvoice, type XRechnungNeed, type XRechnungPattern, type XRechnungRule, type XRechnungTerms, type XRechnungVersion };
2120
3097
  //# sourceMappingURL=index.d.mts.map