@reportwright/engine 0.0.0-stage → 0.11.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/CHANGELOG.md +206 -0
- package/LICENSE +23 -0
- package/README.md +67 -2
- package/dist/index.js +20267 -0
- package/dist/index.js.map +6 -0
- package/dist/types/packages/engine/entry.d.ts +75 -0
- package/dist/types/src/designer/tableGen.d.ts +119 -0
- package/dist/types/src/engine/data/guard.d.ts +50 -0
- package/dist/types/src/engine/data/index.d.ts +120 -0
- package/dist/types/src/engine/data/odata.d.ts +35 -0
- package/dist/types/src/engine/data/xml.d.ts +108 -0
- package/dist/types/src/engine/expr/evaluate.d.ts +183 -0
- package/dist/types/src/engine/expr/format.d.ts +122 -0
- package/dist/types/src/engine/expr/javafmt.d.ts +26 -0
- package/dist/types/src/engine/expr/parser.d.ts +29 -0
- package/dist/types/src/engine/image.d.ts +107 -0
- package/dist/types/src/engine/index.d.ts +224 -0
- package/dist/types/src/engine/items/barcode.d.ts +121 -0
- package/dist/types/src/engine/items/cells.d.ts +11 -0
- package/dist/types/src/engine/items/chart-kit.d.ts +75 -0
- package/dist/types/src/engine/items/chart-more.d.ts +52 -0
- package/dist/types/src/engine/items/chart-round.d.ts +28 -0
- package/dist/types/src/engine/items/chart.d.ts +42 -0
- package/dist/types/src/engine/items/hpage.d.ts +33 -0
- package/dist/types/src/engine/items/index.d.ts +117 -0
- package/dist/types/src/engine/items/map.d.ts +11 -0
- package/dist/types/src/engine/items/paint.d.ts +138 -0
- package/dist/types/src/engine/items/pivot.d.ts +45 -0
- package/dist/types/src/engine/items/rich.d.ts +105 -0
- package/dist/types/src/engine/items/toc.d.ts +10 -0
- package/dist/types/src/engine/items/visuals.d.ts +5 -0
- package/dist/types/src/engine/layout.d.ts +24 -0
- package/dist/types/src/engine/paginate/index.d.ts +17 -0
- package/dist/types/src/engine/reuse.d.ts +120 -0
- package/dist/types/src/engine/schema/report.schema.d.ts +2421 -0
- package/dist/types/src/engine/schema/template.d.ts +212 -0
- package/dist/types/src/engine/schema/validate.d.ts +21 -0
- package/dist/types/src/engine/style.d.ts +70 -0
- package/dist/types/src/engine/text/fonts.d.ts +96 -0
- package/dist/types/src/engine/text/measure.d.ts +145 -0
- package/dist/types/src/engine/text/rich.d.ts +48 -0
- package/dist/types/src/engine/text/shaper.d.ts +20 -0
- package/dist/types/src/engine/units.d.ts +53 -0
- package/dist/types/src/engine/url.d.ts +23 -0
- package/dist/types/src/exporters/color.d.ts +9 -0
- package/dist/types/src/exporters/csv.d.ts +44 -0
- package/dist/types/src/exporters/deadline.d.ts +6 -0
- package/dist/types/src/exporters/docx.d.ts +19 -0
- package/dist/types/src/exporters/encrypt.d.ts +39 -0
- package/dist/types/src/exporters/figures.d.ts +112 -0
- package/dist/types/src/exporters/html.d.ts +24 -0
- package/dist/types/src/exporters/htmldata.d.ts +32 -0
- package/dist/types/src/exporters/pdf.d.ts +45 -0
- package/dist/types/src/exporters/pdfa.d.ts +31 -0
- package/dist/types/src/exporters/pdfua.d.ts +17 -0
- package/dist/types/src/exporters/png.d.ts +10 -0
- package/dist/types/src/exporters/pptx.d.ts +14 -0
- package/dist/types/src/exporters/regions.d.ts +30 -0
- package/dist/types/src/exporters/subset.d.ts +5 -0
- package/dist/types/src/exporters/svg.d.ts +26 -0
- package/dist/types/src/exporters/svgimage.d.ts +33 -0
- package/dist/types/src/exporters/xlsx.d.ts +61 -0
- package/dist/types/src/exporters/xlsxchart.d.ts +26 -0
- package/dist/types/src/exporters/xlsxwriter.d.ts +83 -0
- package/dist/types/src/importers/xml.d.ts +34 -0
- package/index.d.ts +3 -0
- package/package.json +78 -4
- package/pool/index.d.ts +23 -0
- package/pool/index.js +85 -0
- package/pool/worker.js +27 -0
- package/report.d.ts +638 -0
- package/schema.json +2517 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export function loadBarcodes(): Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* bwip-js options from an item's flat keys, for its symbology only.
|
|
4
|
+
* @param {Record<string, any>} item
|
|
5
|
+
*/
|
|
6
|
+
export function bwipOptions(item: Record<string, any>): Record<string, any>;
|
|
7
|
+
/**
|
|
8
|
+
* Why a symbology cannot draw, with the id that was probably meant ("qr" → "qrcode"); null when it is known.
|
|
9
|
+
* @param {any} sym
|
|
10
|
+
*/
|
|
11
|
+
export function symbologyError(sym: any): string;
|
|
12
|
+
/** Scale and move every coordinate of an SVG path (absolute and relative commands). */
|
|
13
|
+
export function transformPath(d: any, sx: any, sy: any, tx: any, ty: any): string;
|
|
14
|
+
/**
|
|
15
|
+
* @param {{ type?: string, text: any, x: number, y: number, w: number, h: number, color?: string, showText?: boolean,
|
|
16
|
+
* textHeight?: number, captionAbove?: boolean, options?: Record<string, any> }} a
|
|
17
|
+
* @returns {{ items: any[], error?: string, twoD?: boolean }} paths in item-local coordinates
|
|
18
|
+
*/
|
|
19
|
+
export function paintBarcode({ type, text, x, y, w, h, color, showText, textHeight, captionAbove, options }: {
|
|
20
|
+
type?: string;
|
|
21
|
+
text: any;
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
w: number;
|
|
25
|
+
h: number;
|
|
26
|
+
color?: string;
|
|
27
|
+
showText?: boolean;
|
|
28
|
+
textHeight?: number;
|
|
29
|
+
captionAbove?: boolean;
|
|
30
|
+
options?: Record<string, any>;
|
|
31
|
+
}): {
|
|
32
|
+
items: any[];
|
|
33
|
+
error?: string;
|
|
34
|
+
twoD?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export const SYMBOLOGIES: {
|
|
37
|
+
id: any;
|
|
38
|
+
name: any;
|
|
39
|
+
sample: any;
|
|
40
|
+
max: number;
|
|
41
|
+
twoD: boolean;
|
|
42
|
+
}[];
|
|
43
|
+
/** Kept for older callers: the ids in the designer's list. */
|
|
44
|
+
export const BARCODE_TYPES: any[];
|
|
45
|
+
/**
|
|
46
|
+
* Per-symbology options, as flat item keys. Each is checked against a list or a range: nothing a report
|
|
47
|
+
* author types reaches bwip-js unchecked.
|
|
48
|
+
*/
|
|
49
|
+
export const BARCODE_OPTIONS: ({
|
|
50
|
+
key: string;
|
|
51
|
+
label: string;
|
|
52
|
+
for: string[];
|
|
53
|
+
opt: string;
|
|
54
|
+
enum: string[];
|
|
55
|
+
int?: undefined;
|
|
56
|
+
str?: undefined;
|
|
57
|
+
size?: undefined;
|
|
58
|
+
bool?: undefined;
|
|
59
|
+
num?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
key: string;
|
|
62
|
+
label: string;
|
|
63
|
+
for: string[];
|
|
64
|
+
opt: string;
|
|
65
|
+
int: number[];
|
|
66
|
+
str: boolean;
|
|
67
|
+
enum?: undefined;
|
|
68
|
+
size?: undefined;
|
|
69
|
+
bool?: undefined;
|
|
70
|
+
num?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
key: string;
|
|
73
|
+
label: string;
|
|
74
|
+
for: string[];
|
|
75
|
+
opt: string;
|
|
76
|
+
int: number[];
|
|
77
|
+
enum?: undefined;
|
|
78
|
+
str?: undefined;
|
|
79
|
+
size?: undefined;
|
|
80
|
+
bool?: undefined;
|
|
81
|
+
num?: undefined;
|
|
82
|
+
} | {
|
|
83
|
+
key: string;
|
|
84
|
+
label: string;
|
|
85
|
+
for: string[];
|
|
86
|
+
opt: string;
|
|
87
|
+
size: boolean;
|
|
88
|
+
enum?: undefined;
|
|
89
|
+
int?: undefined;
|
|
90
|
+
str?: undefined;
|
|
91
|
+
bool?: undefined;
|
|
92
|
+
num?: undefined;
|
|
93
|
+
} | {
|
|
94
|
+
key: string;
|
|
95
|
+
label: string;
|
|
96
|
+
for: string[];
|
|
97
|
+
opt: string;
|
|
98
|
+
bool: boolean;
|
|
99
|
+
enum?: undefined;
|
|
100
|
+
int?: undefined;
|
|
101
|
+
str?: undefined;
|
|
102
|
+
size?: undefined;
|
|
103
|
+
num?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
key: string;
|
|
106
|
+
label: string;
|
|
107
|
+
for: string[];
|
|
108
|
+
opt: string;
|
|
109
|
+
num: number[];
|
|
110
|
+
enum?: undefined;
|
|
111
|
+
int?: undefined;
|
|
112
|
+
str?: undefined;
|
|
113
|
+
size?: undefined;
|
|
114
|
+
bool?: undefined;
|
|
115
|
+
})[];
|
|
116
|
+
/**
|
|
117
|
+
* Every symbology bwip-js draws (its symbolList bcids, kept here so a check needs no 1 MB import; a test compares).
|
|
118
|
+
* A report may use any of them; the designer offers SYMBOLOGIES.
|
|
119
|
+
*/
|
|
120
|
+
export const BWIP_IDS: Set<string>;
|
|
121
|
+
export function isTwoD(id: string): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A table row's cells by column (null where nothing starts). Two forms, both accepted:
|
|
3
|
+
* - one entry per column, null under a colSpan (ReportWright's own form);
|
|
4
|
+
* - RDL / HTML style: the row has fewer cells than columns and spans, the spanned cells are omitted.
|
|
5
|
+
* covered: [k, j] pairs, cell k (0-based, own form) sits under the colSpan of cell j; it is not drawn.
|
|
6
|
+
* @param {any} cells @param {number} ncols @returns {{ at: any[], covered: [number, number][] }}
|
|
7
|
+
*/
|
|
8
|
+
export function rowCells(cells: any, ncols: number): {
|
|
9
|
+
at: any[];
|
|
10
|
+
covered: [number, number][];
|
|
11
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** A palette by name, or a custom list of #hex colours. */
|
|
2
|
+
export function paletteOf(p: any): any;
|
|
3
|
+
/** WCAG contrast ratio of two #hex colours (1 when either is not a colour). */
|
|
4
|
+
export function contrast(a: any, b: any): number;
|
|
5
|
+
/** White or near-black, whichever reads better on the fill. */
|
|
6
|
+
export function inkOn(fill: any): "#111827" | "#ffffff";
|
|
7
|
+
/** "Nice" axis bounds and step (Heckbert). */
|
|
8
|
+
export function niceScale(min: any, max: any, ticks?: number): {
|
|
9
|
+
lo: number;
|
|
10
|
+
hi: number;
|
|
11
|
+
step: number;
|
|
12
|
+
};
|
|
13
|
+
/** Ticks from lo to hi by step, rounded so 0.1 + 0.2 reads 0.3. At most 200 (a bad min/max cannot loop for ever). */
|
|
14
|
+
export function linearTicks(lo: any, hi: any, step: any): any[];
|
|
15
|
+
/** Powers of ten covering [min, max] (both > 0); at least two. */
|
|
16
|
+
export function logTicks(min: any, max: any): number[];
|
|
17
|
+
/**
|
|
18
|
+
* An SVG path through points (in drawing order along the category axis).
|
|
19
|
+
* `along: 'y'` when the categories run down the page (a bar chart): the curve is then monotone in y.
|
|
20
|
+
* @param {{x:number,y:number}[]} pts
|
|
21
|
+
* @param {'straight'|'smooth'|'step'} mode
|
|
22
|
+
* @param {{along?: 'x'|'y', move?: boolean}} [o] move: false continues an existing path (L to the first point)
|
|
23
|
+
*/
|
|
24
|
+
export function curvePath(pts: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}[], mode?: "straight" | "smooth" | "step", { along, move }?: {
|
|
28
|
+
along?: "x" | "y";
|
|
29
|
+
move?: boolean;
|
|
30
|
+
}): string;
|
|
31
|
+
/**
|
|
32
|
+
* Least-squares trend through [x, y] pairs.
|
|
33
|
+
* @param {[number, number][]} pts
|
|
34
|
+
* @param {'linear'|'exp'|'poly'} kind
|
|
35
|
+
* @returns {{at: (x:number) => number, order: number} | null}
|
|
36
|
+
*/
|
|
37
|
+
export function fitTrend(pts: [number, number][], kind?: "linear" | "exp" | "poly", order?: number): {
|
|
38
|
+
at: (x: number) => number;
|
|
39
|
+
order: number;
|
|
40
|
+
} | null;
|
|
41
|
+
/** Trailing moving average: null until `period` values are in; a missing value starts the count again. */
|
|
42
|
+
export function movingAverage(values: any, period: any): any[];
|
|
43
|
+
export namespace CAPS {
|
|
44
|
+
let categories: number;
|
|
45
|
+
let series: number;
|
|
46
|
+
let points: number;
|
|
47
|
+
let overlays: number;
|
|
48
|
+
let period: number;
|
|
49
|
+
}
|
|
50
|
+
export namespace PALETTES {
|
|
51
|
+
let _default: string[];
|
|
52
|
+
export { _default as default };
|
|
53
|
+
export let office: string[];
|
|
54
|
+
export let colorblind: string[];
|
|
55
|
+
export let vivid: string[];
|
|
56
|
+
export let pastel: string[];
|
|
57
|
+
export let ocean: string[];
|
|
58
|
+
export let sunset: string[];
|
|
59
|
+
export let forest: string[];
|
|
60
|
+
export let berry: string[];
|
|
61
|
+
export let earth: string[];
|
|
62
|
+
export let grayscale: string[];
|
|
63
|
+
export let highContrast: string[];
|
|
64
|
+
}
|
|
65
|
+
export const DARK_INK: "#111827";
|
|
66
|
+
/** Accepts label boxes that stay inside the plot and overlap no box placed before. Grid buckets keep it near linear. */
|
|
67
|
+
export class LabelPlacer {
|
|
68
|
+
constructor(bounds: any, cell?: number);
|
|
69
|
+
b: any;
|
|
70
|
+
cell: number;
|
|
71
|
+
grid: Map<any, any>;
|
|
72
|
+
fits(r: any): boolean;
|
|
73
|
+
place(r: any): boolean;
|
|
74
|
+
keys(r: any): Generator<string, void, unknown>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Legend entries for these types (the series legend does not fit them). */
|
|
2
|
+
export function moreLegend(type: any, item: any, data: any, pal: any): {
|
|
3
|
+
name: any;
|
|
4
|
+
color: any;
|
|
5
|
+
}[];
|
|
6
|
+
export function paintMore(type: any, g: any): any;
|
|
7
|
+
/**
|
|
8
|
+
* Squarified treemap (Bruls, Huizing, van Wijk): values sorted largest first, laid out in rows along the shorter side,
|
|
9
|
+
* a row closed when adding the next value would make its worst aspect ratio worse. Linear after the sort.
|
|
10
|
+
* @returns {{x:number,y:number,w:number,h:number,i:number}[]}
|
|
11
|
+
*/
|
|
12
|
+
export function squarify(items: any, x: any, y: any, w: any, h: any): {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
w: number;
|
|
16
|
+
h: number;
|
|
17
|
+
i: number;
|
|
18
|
+
}[];
|
|
19
|
+
/** Bins over [lo, hi]: a count (default: Sturges) or a width. At most MORE_CAPS.bins; linear in the values. */
|
|
20
|
+
export function binValues(vals: any, { binCount, binWidth }?: {}): {
|
|
21
|
+
lo: number;
|
|
22
|
+
hi: number;
|
|
23
|
+
width: number;
|
|
24
|
+
counts: any[];
|
|
25
|
+
capped: boolean;
|
|
26
|
+
};
|
|
27
|
+
/** Quartiles (linear interpolation, as Excel QUARTILE.INC), whiskers at the furthest values within 1.5 IQR, outliers beyond. */
|
|
28
|
+
export function boxStats(sorted: any): {
|
|
29
|
+
min: any;
|
|
30
|
+
max: any;
|
|
31
|
+
q1: any;
|
|
32
|
+
med: any;
|
|
33
|
+
q3: any;
|
|
34
|
+
lo: any;
|
|
35
|
+
hi: any;
|
|
36
|
+
outliers: any[];
|
|
37
|
+
mean: number;
|
|
38
|
+
n: any;
|
|
39
|
+
};
|
|
40
|
+
/** Date ticks: the first step of day, week, month, quarter, year that gives at most `max` ticks. */
|
|
41
|
+
export function dateTicks(lo: any, hi: any, max?: number): {
|
|
42
|
+
ticks: number[];
|
|
43
|
+
unit: string | number;
|
|
44
|
+
} | {
|
|
45
|
+
ticks: any[];
|
|
46
|
+
unit: string;
|
|
47
|
+
};
|
|
48
|
+
export const MORE_TYPES: Set<string>;
|
|
49
|
+
export namespace MORE_CAPS {
|
|
50
|
+
let bins: number;
|
|
51
|
+
let outliers: number;
|
|
52
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function arc(cx: any, cy: any, r: any, ri: any, a0: any, a1: any): string;
|
|
2
|
+
export function paintRound(type: any, g: any): void;
|
|
3
|
+
/**
|
|
4
|
+
* Outside pie labels: one column each side; on a side the labels keep their slice order and are pushed apart (down, then
|
|
5
|
+
* back up from the bottom) so none overlap. When a side has more labels than fit, the smallest slices lose theirs.
|
|
6
|
+
* Each label is joined to its slice: from the rim, out to an elbow, then across to the label.
|
|
7
|
+
*/
|
|
8
|
+
export function placeOutside(sides: any, { cx, cy, r, lw, lh, lo, hi, out, text, texts, fs, ink }: {
|
|
9
|
+
cx: any;
|
|
10
|
+
cy: any;
|
|
11
|
+
r: any;
|
|
12
|
+
lw: any;
|
|
13
|
+
lh: any;
|
|
14
|
+
lo: any;
|
|
15
|
+
hi: any;
|
|
16
|
+
out: any;
|
|
17
|
+
text: any;
|
|
18
|
+
texts: any;
|
|
19
|
+
fs: any;
|
|
20
|
+
ink: any;
|
|
21
|
+
}): void;
|
|
22
|
+
export const ROUND_TYPES: Set<string>;
|
|
23
|
+
export namespace GAUGE_SHAPES {
|
|
24
|
+
let half: number[];
|
|
25
|
+
let threeQuarter: number[];
|
|
26
|
+
let full: number[];
|
|
27
|
+
}
|
|
28
|
+
export const GAUGE_INDICATORS: string[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Categories × series values from the data. */
|
|
2
|
+
export function chartData(item: any, ctx: any, lc: any, pal?: any): {
|
|
3
|
+
categories: any[];
|
|
4
|
+
buckets: any[];
|
|
5
|
+
series: any[];
|
|
6
|
+
rows: any;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Paint the chart into item-local coordinates (x from item.x, y from 0).
|
|
10
|
+
* meta.alt receives the chart's generated alt text (its type, title, series and categories).
|
|
11
|
+
* @param {{ alt?: string }} [meta]
|
|
12
|
+
* @returns {any[]} page-model items
|
|
13
|
+
*/
|
|
14
|
+
export function paintChart(item: any, ctx: any, lc: any, base: any, meta?: {
|
|
15
|
+
alt?: string;
|
|
16
|
+
}): any[];
|
|
17
|
+
/** Overlays the legend lists (each unless legend: false), with the key each draws: a line (dashed for trends) or a band. */
|
|
18
|
+
export function legendOverlays(item: any, type: any, data: any): ({
|
|
19
|
+
name: string;
|
|
20
|
+
color: any;
|
|
21
|
+
mark: string;
|
|
22
|
+
dash: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
color: any;
|
|
26
|
+
mark: string;
|
|
27
|
+
dash?: undefined;
|
|
28
|
+
})[];
|
|
29
|
+
/**
|
|
30
|
+
* The robust window of a set of values: its 1st and 99th percentiles (nearest rank). extreme: the full spread is more
|
|
31
|
+
* than five times that window, so a few outliers would flatten the rest of the data.
|
|
32
|
+
* @param {number[]} vals
|
|
33
|
+
*/
|
|
34
|
+
export function robustWindow(vals: number[]): {
|
|
35
|
+
p1: number;
|
|
36
|
+
p99: number;
|
|
37
|
+
extreme: boolean;
|
|
38
|
+
};
|
|
39
|
+
export { niceScale };
|
|
40
|
+
export const PALETTE: string[];
|
|
41
|
+
export const CHART_TYPES: string[];
|
|
42
|
+
import { niceScale } from './chart-kit.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** The left edge of a page-model item. */
|
|
2
|
+
export function itemLeft(it: any): any;
|
|
3
|
+
/**
|
|
4
|
+
* @param {{ units: any[], height: number, headerCount: number, headerHeight: number, repeatHeader: boolean,
|
|
5
|
+
* colX: number[], widths: number[], x: number, repeat: number, room: number, order: 'down' | 'across', pageH: number,
|
|
6
|
+
* name: string, nextId: () => number, warn: (m: string, clip?: boolean) => void, shiftLocal: (items: any[], dy: number) => any[],
|
|
7
|
+
* block?: number }} o block: columns that move together (a pivot's value columns per measure), default 1
|
|
8
|
+
* @returns {{ height: number, units: any[], tables: any[], width: number } | null} null when the columns fit
|
|
9
|
+
*/
|
|
10
|
+
export function sliceColumns(o: {
|
|
11
|
+
units: any[];
|
|
12
|
+
height: number;
|
|
13
|
+
headerCount: number;
|
|
14
|
+
headerHeight: number;
|
|
15
|
+
repeatHeader: boolean;
|
|
16
|
+
colX: number[];
|
|
17
|
+
widths: number[];
|
|
18
|
+
x: number;
|
|
19
|
+
repeat: number;
|
|
20
|
+
room: number;
|
|
21
|
+
order: "down" | "across";
|
|
22
|
+
pageH: number;
|
|
23
|
+
name: string;
|
|
24
|
+
nextId: () => number;
|
|
25
|
+
warn: (m: string, clip?: boolean) => void;
|
|
26
|
+
shiftLocal: (items: any[], dy: number) => any[];
|
|
27
|
+
block?: number;
|
|
28
|
+
}): {
|
|
29
|
+
height: number;
|
|
30
|
+
units: any[];
|
|
31
|
+
tables: any[];
|
|
32
|
+
width: number;
|
|
33
|
+
} | null;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export function register(type: any, spec: any): void;
|
|
2
|
+
export function textOf(raw: any, st: any, ctx: any, lc: any): any;
|
|
3
|
+
/**
|
|
4
|
+
* A number for data export: the full value, as SSRS exports it (Excel's number format does the display rounding, so a
|
|
5
|
+
* column of 0.333, 0.333, 0.334 shown as N2 still sums to 1). Only binary noise past 15 significant digits goes
|
|
6
|
+
* (0.30000000000000004 is 0.3), which Excel would not show either. fmt is unused (kept for the call sites).
|
|
7
|
+
*/
|
|
8
|
+
export function roundFor(v: any, fmt: any): any;
|
|
9
|
+
/** A layout context whose expressions read PartProperties.<name> from `props` (a report part's values). */
|
|
10
|
+
export function withPartProps(lc: any, props: any): any;
|
|
11
|
+
/** Style props the inspector shows for an item type. */
|
|
12
|
+
export function stylePropsFor(type: any): any;
|
|
13
|
+
/**
|
|
14
|
+
* Item registry. Each item type has:
|
|
15
|
+
* label, defaults(), props (designer metadata, plain data),
|
|
16
|
+
* layout(item, lc) → { height, units[], table? }
|
|
17
|
+
* Unit coordinates: x in content space, y relative to the item top.
|
|
18
|
+
*/
|
|
19
|
+
/** @type {Record<string, any>} */
|
|
20
|
+
export const ITEMS: Record<string, any>;
|
|
21
|
+
export const GROW_TOLERANCE: 1;
|
|
22
|
+
export namespace SHRINK_DEFAULTS {
|
|
23
|
+
let minFontSize: number;
|
|
24
|
+
let step: number;
|
|
25
|
+
}
|
|
26
|
+
export const TEXT_STYLE_PROPS: ({
|
|
27
|
+
key: string;
|
|
28
|
+
label: string;
|
|
29
|
+
type: string;
|
|
30
|
+
category: string;
|
|
31
|
+
expr?: undefined;
|
|
32
|
+
options?: undefined;
|
|
33
|
+
labelKey?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
key: string;
|
|
36
|
+
label: string;
|
|
37
|
+
type: string;
|
|
38
|
+
category: string;
|
|
39
|
+
expr: boolean;
|
|
40
|
+
options?: undefined;
|
|
41
|
+
labelKey?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
key: string;
|
|
44
|
+
label: string;
|
|
45
|
+
type: string;
|
|
46
|
+
options: string[];
|
|
47
|
+
category: string;
|
|
48
|
+
expr: boolean;
|
|
49
|
+
labelKey?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
key: string;
|
|
52
|
+
label: string;
|
|
53
|
+
type: string;
|
|
54
|
+
options: string[];
|
|
55
|
+
category: string;
|
|
56
|
+
expr?: undefined;
|
|
57
|
+
labelKey?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
key: string;
|
|
60
|
+
label: string;
|
|
61
|
+
labelKey: string;
|
|
62
|
+
type: string;
|
|
63
|
+
category: string;
|
|
64
|
+
expr?: undefined;
|
|
65
|
+
options?: undefined;
|
|
66
|
+
})[];
|
|
67
|
+
export namespace SHAPE_STYLE_PROPS {
|
|
68
|
+
namespace fill {
|
|
69
|
+
let key: string;
|
|
70
|
+
let label: string;
|
|
71
|
+
let type: string;
|
|
72
|
+
let category: string;
|
|
73
|
+
}
|
|
74
|
+
namespace stroke {
|
|
75
|
+
let key_1: string;
|
|
76
|
+
export { key_1 as key };
|
|
77
|
+
let label_1: string;
|
|
78
|
+
export { label_1 as label };
|
|
79
|
+
let type_1: string;
|
|
80
|
+
export { type_1 as type };
|
|
81
|
+
let category_1: string;
|
|
82
|
+
export { category_1 as category };
|
|
83
|
+
}
|
|
84
|
+
namespace strokeWidth {
|
|
85
|
+
let key_2: string;
|
|
86
|
+
export { key_2 as key };
|
|
87
|
+
let label_2: string;
|
|
88
|
+
export { label_2 as label };
|
|
89
|
+
let type_2: string;
|
|
90
|
+
export { type_2 as type };
|
|
91
|
+
let category_2: string;
|
|
92
|
+
export { category_2 as category };
|
|
93
|
+
}
|
|
94
|
+
namespace strokeDash {
|
|
95
|
+
let key_3: string;
|
|
96
|
+
export { key_3 as key };
|
|
97
|
+
let label_3: string;
|
|
98
|
+
export { label_3 as label };
|
|
99
|
+
let type_3: string;
|
|
100
|
+
export { type_3 as type };
|
|
101
|
+
export let options: string[];
|
|
102
|
+
let category_3: string;
|
|
103
|
+
export { category_3 as category };
|
|
104
|
+
}
|
|
105
|
+
namespace radius {
|
|
106
|
+
let key_4: string;
|
|
107
|
+
export { key_4 as key };
|
|
108
|
+
let label_4: string;
|
|
109
|
+
export { label_4 as label };
|
|
110
|
+
let type_4: string;
|
|
111
|
+
export { type_4 as type };
|
|
112
|
+
let category_4: string;
|
|
113
|
+
export { category_4 as category };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export { isDynamic };
|
|
117
|
+
import { isDynamic } from '../expr/evaluate.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @returns {number[][][] | null} lines → [lon, lat] */
|
|
2
|
+
export function linesOf(g: any): number[][][] | null;
|
|
3
|
+
/** @returns {number[][][][] | null} polygons → rings → [lon, lat] */
|
|
4
|
+
export function polygonsOf(g: any): number[][][][] | null;
|
|
5
|
+
export function paintMap(item: any, ctx: any, lc: any, base: any): any[];
|
|
6
|
+
export namespace MAP_CAPS {
|
|
7
|
+
let shapes: number;
|
|
8
|
+
let coords: number;
|
|
9
|
+
let points: number;
|
|
10
|
+
let classes: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/** Text layout for a box: lines, font key, needed height. */
|
|
2
|
+
export function layoutTextLines(text: any, st: any, width: any, m: any, opt: any): any;
|
|
3
|
+
/**
|
|
4
|
+
* Paint a box: background, text lines, borders.
|
|
5
|
+
* @returns {any[]} page-model items (appended to `out` when given)
|
|
6
|
+
*/
|
|
7
|
+
export function paintBox({ x, y, w, h, st, tl, numeric, m, ellipsis, out, cell }: {
|
|
8
|
+
x: any;
|
|
9
|
+
y: any;
|
|
10
|
+
w: any;
|
|
11
|
+
h: any;
|
|
12
|
+
st: any;
|
|
13
|
+
tl: any;
|
|
14
|
+
numeric?: boolean;
|
|
15
|
+
m: any;
|
|
16
|
+
ellipsis?: boolean;
|
|
17
|
+
out?: any;
|
|
18
|
+
cell?: any;
|
|
19
|
+
}): any[];
|
|
20
|
+
/**
|
|
21
|
+
* paintBox with positional arguments (no argument object: table cells call it hundreds of thousands of times).
|
|
22
|
+
* cell: the text's table cell tag (export data), set when the text item is made: one added later would not fit the
|
|
23
|
+
* object and costs a separate property store per item.
|
|
24
|
+
*/
|
|
25
|
+
export function paintBoxAt(x: any, y: any, w: any, h: any, st: any, tl: any, numeric: any, m: any, ellipsis: any, items: any, cell?: any): any;
|
|
26
|
+
export namespace paintBoxAt {
|
|
27
|
+
let shapes: ({
|
|
28
|
+
x: any;
|
|
29
|
+
y: any;
|
|
30
|
+
w: any;
|
|
31
|
+
h: any;
|
|
32
|
+
text?: undefined;
|
|
33
|
+
t?: undefined;
|
|
34
|
+
font?: undefined;
|
|
35
|
+
size?: undefined;
|
|
36
|
+
color?: undefined;
|
|
37
|
+
lines?: undefined;
|
|
38
|
+
clip?: undefined;
|
|
39
|
+
fill?: undefined;
|
|
40
|
+
x1?: undefined;
|
|
41
|
+
y1?: undefined;
|
|
42
|
+
x2?: undefined;
|
|
43
|
+
y2?: undefined;
|
|
44
|
+
stroke?: undefined;
|
|
45
|
+
strokeWidth?: undefined;
|
|
46
|
+
dash?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
x: any;
|
|
49
|
+
y: any;
|
|
50
|
+
text: any;
|
|
51
|
+
w: any;
|
|
52
|
+
h?: undefined;
|
|
53
|
+
t?: undefined;
|
|
54
|
+
font?: undefined;
|
|
55
|
+
size?: undefined;
|
|
56
|
+
color?: undefined;
|
|
57
|
+
lines?: undefined;
|
|
58
|
+
clip?: undefined;
|
|
59
|
+
fill?: undefined;
|
|
60
|
+
x1?: undefined;
|
|
61
|
+
y1?: undefined;
|
|
62
|
+
x2?: undefined;
|
|
63
|
+
y2?: undefined;
|
|
64
|
+
stroke?: undefined;
|
|
65
|
+
strokeWidth?: undefined;
|
|
66
|
+
dash?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
t: any;
|
|
69
|
+
font: any;
|
|
70
|
+
size: any;
|
|
71
|
+
color: any;
|
|
72
|
+
lines: any;
|
|
73
|
+
clip: any;
|
|
74
|
+
x?: undefined;
|
|
75
|
+
y?: undefined;
|
|
76
|
+
w?: undefined;
|
|
77
|
+
h?: undefined;
|
|
78
|
+
text?: undefined;
|
|
79
|
+
fill?: undefined;
|
|
80
|
+
x1?: undefined;
|
|
81
|
+
y1?: undefined;
|
|
82
|
+
x2?: undefined;
|
|
83
|
+
y2?: undefined;
|
|
84
|
+
stroke?: undefined;
|
|
85
|
+
strokeWidth?: undefined;
|
|
86
|
+
dash?: undefined;
|
|
87
|
+
} | {
|
|
88
|
+
t: any;
|
|
89
|
+
x: any;
|
|
90
|
+
y: any;
|
|
91
|
+
w: any;
|
|
92
|
+
h: any;
|
|
93
|
+
fill: any;
|
|
94
|
+
text?: undefined;
|
|
95
|
+
font?: undefined;
|
|
96
|
+
size?: undefined;
|
|
97
|
+
color?: undefined;
|
|
98
|
+
lines?: undefined;
|
|
99
|
+
clip?: undefined;
|
|
100
|
+
x1?: undefined;
|
|
101
|
+
y1?: undefined;
|
|
102
|
+
x2?: undefined;
|
|
103
|
+
y2?: undefined;
|
|
104
|
+
stroke?: undefined;
|
|
105
|
+
strokeWidth?: undefined;
|
|
106
|
+
dash?: undefined;
|
|
107
|
+
} | {
|
|
108
|
+
t: any;
|
|
109
|
+
x1: any;
|
|
110
|
+
y1: any;
|
|
111
|
+
x2: any;
|
|
112
|
+
y2: any;
|
|
113
|
+
stroke: any;
|
|
114
|
+
strokeWidth: any;
|
|
115
|
+
dash: any;
|
|
116
|
+
x?: undefined;
|
|
117
|
+
y?: undefined;
|
|
118
|
+
w?: undefined;
|
|
119
|
+
h?: undefined;
|
|
120
|
+
text?: undefined;
|
|
121
|
+
font?: undefined;
|
|
122
|
+
size?: undefined;
|
|
123
|
+
color?: undefined;
|
|
124
|
+
lines?: undefined;
|
|
125
|
+
clip?: undefined;
|
|
126
|
+
fill?: undefined;
|
|
127
|
+
})[];
|
|
128
|
+
}
|
|
129
|
+
/** Put items on the page at (dx, dy), appending them to `out`. */
|
|
130
|
+
export function placeItems(items: any, dx: any, dy: any, out: any): void;
|
|
131
|
+
/** Move page-model items by (dx, dy). Returns new objects. A rotated item's centre moves with it. */
|
|
132
|
+
export function shiftItems(items: any, dx: any, dy: any): any;
|
|
133
|
+
/**
|
|
134
|
+
* Item arrays that layout made fresh for one unit and nothing else references (a table row's paint): page assembly
|
|
135
|
+
* moves their items into place instead of copying them, which halves the page model's peak memory. An array is
|
|
136
|
+
* moved at most once; any other array is copied (shiftItems), as before.
|
|
137
|
+
*/
|
|
138
|
+
export const OWNED: WeakSet<object>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rows → buckets by an expression's value, in first-seen order. Text keys that differ only in case share a bucket
|
|
3
|
+
* (SSRS on a case-insensitive collation); the bucket keeps the first row's key and text (toggle state keys).
|
|
4
|
+
*/
|
|
5
|
+
export function groupRows(rows: any, expr: any, ctx: any, lc: any, who: any, adjacent?: boolean): any[];
|
|
6
|
+
/**
|
|
7
|
+
* The array form of a matrix. The old single-group keys map onto one row group, one column group and one value.
|
|
8
|
+
* @returns {{ rowGroups: any[], columnGroups: any[], values: any[], legacy: boolean, overflow: string, pageOrder: string }}
|
|
9
|
+
*/
|
|
10
|
+
export function normalizeMatrix(item: any): {
|
|
11
|
+
rowGroups: any[];
|
|
12
|
+
columnGroups: any[];
|
|
13
|
+
values: any[];
|
|
14
|
+
legacy: boolean;
|
|
15
|
+
overflow: string;
|
|
16
|
+
pageOrder: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @param {any} item the matrix
|
|
20
|
+
* @param {any[]} rows its rows, already filtered
|
|
21
|
+
* @param {any} ctx evaluation context of the item
|
|
22
|
+
* @param {any} lc layout context (warn, state)
|
|
23
|
+
* @returns {{ R: number, C: number, V: number, spec: ReturnType<typeof normalizeMatrix>, cols: any[], header: any[][], body: any[] }}
|
|
24
|
+
* cols: one entry per value column (after the R row-header columns): { kind, level, node, v }
|
|
25
|
+
* header: header rows, each a list of cells { c, text, rowSpan, colSpan, role, toggle?, action?, bookmark?, ctx? }
|
|
26
|
+
* body: rows { kind, level, node, cells: [{ c, text?, raw?, rowSpan, colSpan, role, toggle?, ctx?, action?, bookmark? }] }
|
|
27
|
+
*/
|
|
28
|
+
export function buildPivot(item: any, rows: any[], ctx: any, lc: any): {
|
|
29
|
+
R: number;
|
|
30
|
+
C: number;
|
|
31
|
+
V: number;
|
|
32
|
+
spec: ReturnType<typeof normalizeMatrix>;
|
|
33
|
+
cols: any[];
|
|
34
|
+
header: any[][];
|
|
35
|
+
body: any[];
|
|
36
|
+
};
|
|
37
|
+
export namespace PIVOT_LIMITS {
|
|
38
|
+
let depth: number;
|
|
39
|
+
let values: number;
|
|
40
|
+
let columns: number;
|
|
41
|
+
let cells: number;
|
|
42
|
+
let tree: number;
|
|
43
|
+
}
|
|
44
|
+
export function cmpKey(a: any, b: any, ctx: any): number;
|
|
45
|
+
export function isTablix(item: any): boolean;
|