@reportwright/engine 0.0.0-stage → 0.12.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 +233 -0
- package/LICENSE +23 -0
- package/README.md +105 -2
- package/dist/index.js +22548 -0
- package/dist/pdfstreamworker.js +38 -0
- package/dist/types/packages/engine/entry.d.ts +125 -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/stream.d.ts +48 -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 +239 -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/paged.d.ts +19 -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/stream.d.ts +54 -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 +42 -0
- package/dist/types/src/exporters/pdfpaint.d.ts +107 -0
- package/dist/types/src/exporters/pdfstream.d.ts +198 -0
- package/dist/types/src/exporters/pdfstreamtags.d.ts +38 -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/examples/stream-1m.mjs +87 -0
- package/index.d.ts +3 -0
- package/package.json +79 -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,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;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The markup of a rich text value. Only the literal markup the author typed is HTML. Everything that comes
|
|
3
|
+
* from evaluation (a {Fields.x} part of a template, or the result of a value that is one =expression) is
|
|
4
|
+
* escaped and shows as text, unless the item sets `htmlFromData: true` (HTML stored in trusted data); then
|
|
5
|
+
* it is parsed too, through the same allow-list.
|
|
6
|
+
* @param {any} v @param {any} ctx @param {boolean} [htmlFromData]
|
|
7
|
+
*/
|
|
8
|
+
export function richValue(v: any, ctx: any, htmlFromData?: boolean): string;
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {{ id: string, key: string, size: number, lineSize: number, rise: number, color: string,
|
|
11
|
+
* under: boolean, strike: boolean, bg?: string, href?: string }} Look
|
|
12
|
+
* @typedef {{ text: string, look: Look, x: number, w: number }} Frag
|
|
13
|
+
* @typedef {{ frags: Frag[], w: number, h: number, base: number, left: number, align: string, p: number, br: boolean, gap: number }} RichLine
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('../text/rich.js').RichBlock[]} blocks
|
|
17
|
+
* @param {any} st the item's resolved style
|
|
18
|
+
* @param {number} width
|
|
19
|
+
* @param {import('../text/measure.js').TextMeasurer} m
|
|
20
|
+
* @param {{ listIndent?: number, paragraphSpacing?: number, maxLineHeight?: number, warn?: (msg: string) => void }} [opt]
|
|
21
|
+
*/
|
|
22
|
+
export function layoutRich(blocks: import("../text/rich.js").RichBlock[], st: any, width: number, m: import("../text/measure.js").TextMeasurer, opt?: {
|
|
23
|
+
listIndent?: number;
|
|
24
|
+
paragraphSpacing?: number;
|
|
25
|
+
maxLineHeight?: number;
|
|
26
|
+
warn?: (msg: string) => void;
|
|
27
|
+
}): {
|
|
28
|
+
lines: RichLine[];
|
|
29
|
+
needed: any;
|
|
30
|
+
pad: any;
|
|
31
|
+
inner: number;
|
|
32
|
+
fragments: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Page-model items for rich text lines in a box: background, span backgrounds, one text item per fragment,
|
|
36
|
+
* decorations, borders, then links. Lines that do not fit the box are left out.
|
|
37
|
+
* @param {{ x: number, y: number, w: number, h: number, st: any, rl: { lines: RichLine[], pad: number[], inner: number },
|
|
38
|
+
* m: import('../text/measure.js').TextMeasurer, id: string }} o
|
|
39
|
+
*/
|
|
40
|
+
export function paintRich({ x, y, w, h, st, rl, m, id }: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
w: number;
|
|
44
|
+
h: number;
|
|
45
|
+
st: any;
|
|
46
|
+
rl: {
|
|
47
|
+
lines: RichLine[];
|
|
48
|
+
pad: number[];
|
|
49
|
+
inner: number;
|
|
50
|
+
};
|
|
51
|
+
m: import("../text/measure.js").TextMeasurer;
|
|
52
|
+
id: string;
|
|
53
|
+
}): any[];
|
|
54
|
+
/**
|
|
55
|
+
* Vertical text (writing-mode tb-rl): columns from right to left, each read top to bottom. Upright characters
|
|
56
|
+
* (CJK) are stacked one em apart, one text item per column; runs of other text (Latin, digits) are text items
|
|
57
|
+
* turned 90° clockwise about their own centre, so every exporter draws them with Phase 1's rotation.
|
|
58
|
+
* The box keeps its designed size; text past the last column that fits is left out.
|
|
59
|
+
* @param {{ x: number, y: number, w: number, h: number, st: any, text: string, m: import('../text/measure.js').TextMeasurer }} o
|
|
60
|
+
*/
|
|
61
|
+
export function paintVertical({ x, y, w, h, st, text, m }: {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
w: number;
|
|
65
|
+
h: number;
|
|
66
|
+
st: any;
|
|
67
|
+
text: string;
|
|
68
|
+
m: import("../text/measure.js").TextMeasurer;
|
|
69
|
+
}): any[];
|
|
70
|
+
export namespace RICH_DEFAULTS {
|
|
71
|
+
let listIndent: number;
|
|
72
|
+
let paragraphSpacing: number;
|
|
73
|
+
let linkColor: string;
|
|
74
|
+
let maxFragments: number;
|
|
75
|
+
let maxLines: number;
|
|
76
|
+
}
|
|
77
|
+
export type Look = {
|
|
78
|
+
id: string;
|
|
79
|
+
key: string;
|
|
80
|
+
size: number;
|
|
81
|
+
lineSize: number;
|
|
82
|
+
rise: number;
|
|
83
|
+
color: string;
|
|
84
|
+
under: boolean;
|
|
85
|
+
strike: boolean;
|
|
86
|
+
bg?: string;
|
|
87
|
+
href?: string;
|
|
88
|
+
};
|
|
89
|
+
export type Frag = {
|
|
90
|
+
text: string;
|
|
91
|
+
look: Look;
|
|
92
|
+
x: number;
|
|
93
|
+
w: number;
|
|
94
|
+
};
|
|
95
|
+
export type RichLine = {
|
|
96
|
+
frags: Frag[];
|
|
97
|
+
w: number;
|
|
98
|
+
h: number;
|
|
99
|
+
base: number;
|
|
100
|
+
left: number;
|
|
101
|
+
align: string;
|
|
102
|
+
p: number;
|
|
103
|
+
br: boolean;
|
|
104
|
+
gap: number;
|
|
105
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @param {number} n @param {string} kind 'decimal' | 'roman' | 'alpha' */
|
|
2
|
+
export function formatNumber(n: number, kind: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* The number of each entry. A deeper level restarts when a higher one moves on; a skipped level counts as 1.
|
|
5
|
+
* @param {{ level?: number }[]} entries
|
|
6
|
+
* @param {string | string[]} numbering one format for every level, or one per level (the last repeats)
|
|
7
|
+
*/
|
|
8
|
+
export function tocNumbers(entries: {
|
|
9
|
+
level?: number;
|
|
10
|
+
}[], numbering: string | string[]): string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lay out a set of free-positioned items (a band body, a container, one list row).
|
|
3
|
+
* Applies the RDL push rule: when an item grows by Δ, every item below it that
|
|
4
|
+
* overlaps it horizontally moves down by Δ.
|
|
5
|
+
*
|
|
6
|
+
* @param {any[]} items
|
|
7
|
+
* @param {any} lc layout context
|
|
8
|
+
* @param {{ dx?: number }} [opt] x offset of the parent
|
|
9
|
+
* @returns {{ units: any[], tables: any[], height: number }}
|
|
10
|
+
* units and tables in coordinates relative to the top of this set
|
|
11
|
+
*/
|
|
12
|
+
export function layoutItems(items: any[], lc: any, { dx }?: {
|
|
13
|
+
dx?: number;
|
|
14
|
+
}): {
|
|
15
|
+
units: any[];
|
|
16
|
+
tables: any[];
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Which items a render leaves out because of their layer: `layers: [{ name, target, visible }]`. Targets follow
|
|
21
|
+
* ActiveReports' TargetDevice: all, screen, print (paper), export, design (none: the designer only).
|
|
22
|
+
* @returns {((it: any) => boolean) | null}
|
|
23
|
+
*/
|
|
24
|
+
export function layerFilter(layers: any, target: any): ((it: any) => boolean) | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {any} def0 @param {any} opts render() options, and maxRows/sorter/sqlRows as planStream takes them;
|
|
3
|
+
* window: rows per window (tests)
|
|
4
|
+
* @returns {Promise<{ why: string } | { why?: undefined, pages: () => AsyncGenerator<any>, info: { width: number, height: number, bookmarks: any[], headings: any[], warnings: string[], pages: number } }>}
|
|
5
|
+
*/
|
|
6
|
+
export function planPaged(def0: any, opts?: any): Promise<{
|
|
7
|
+
why: string;
|
|
8
|
+
} | {
|
|
9
|
+
why?: undefined;
|
|
10
|
+
pages: () => AsyncGenerator<any>;
|
|
11
|
+
info: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
bookmarks: any[];
|
|
15
|
+
headings: any[];
|
|
16
|
+
warnings: string[];
|
|
17
|
+
pages: number;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {any[]} units sorted by top
|
|
3
|
+
* @param {any[]} tables
|
|
4
|
+
* @param {number} pageH content height available for the body
|
|
5
|
+
* @param {(msg: string, clip?: boolean) => void} warn
|
|
6
|
+
* @param {{ work: number }} [stats] counts the comparisons the search makes (the complexity test reads it)
|
|
7
|
+
* @returns {{ top: number, bottom: number, offset: number, repeat: any[], units: any[] }[]}
|
|
8
|
+
*/
|
|
9
|
+
export function paginate(units: any[], tables: any[], pageH: number, warn: (msg: string, clip?: boolean) => void, stats?: {
|
|
10
|
+
work: number;
|
|
11
|
+
}): {
|
|
12
|
+
top: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
offset: number;
|
|
15
|
+
repeat: any[];
|
|
16
|
+
units: any[];
|
|
17
|
+
}[];
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A loader for one render (and its subreports): each id loaded once, at most REUSE_LIMITS.reports ids.
|
|
3
|
+
* @param {((id: string) => Promise<any>) | undefined} load
|
|
4
|
+
* @param {Map<string, Promise<any>>} [cache]
|
|
5
|
+
*/
|
|
6
|
+
export function makeLoader(load: ((id: string) => Promise<any>) | undefined, cache?: Map<string, Promise<any>>): (id: any) => Promise<any>;
|
|
7
|
+
/** Report ids a definition reuses by a fixed id (not expressions): master, stylesheet, theme and part libraries. */
|
|
8
|
+
export function reuseRefs(def: any): Set<any>;
|
|
9
|
+
/**
|
|
10
|
+
* The reports a definition opens by a fixed id: drill-through actions (an item's, a cell's, a chart point's, a matrix
|
|
11
|
+
* header's) and subreports, each with where it is ("Ledger cell", "Chart1"). Ids given by an expression are not listed.
|
|
12
|
+
* @param {any} def @returns {{ report: string, where: string }[]}
|
|
13
|
+
*/
|
|
14
|
+
export function drillRefs(def: any): {
|
|
15
|
+
report: string;
|
|
16
|
+
where: string;
|
|
17
|
+
}[];
|
|
18
|
+
export function findItemNamed(def: any, name: any): any;
|
|
19
|
+
/**
|
|
20
|
+
* The content report merged with its master (and the master's master, up to REUSE_LIMITS.depth).
|
|
21
|
+
* @param {any} def @param {(id: string) => Promise<any>} get @param {(m: string) => void} warn @param {string[]} [chain]
|
|
22
|
+
*/
|
|
23
|
+
export function applyMaster(def: any, get: (id: string) => Promise<any>, warn: (m: string) => void, chain?: string[]): any;
|
|
24
|
+
/** Named styles with `parent` resolved: each style is its parents' properties with its own on top. */
|
|
25
|
+
export function flattenNamed(named: any, warn?: (_m: any) => void): Record<string, any>;
|
|
26
|
+
/**
|
|
27
|
+
* Masters, stylesheet and part libraries, before validation. Themes come later (they may depend on parameters).
|
|
28
|
+
* @returns {Promise<{ def: any, parts: Map<string, any> | null }>}
|
|
29
|
+
*/
|
|
30
|
+
export function resolveReuse(def: any, get: any, warn: any, chain?: any[], budget?: {
|
|
31
|
+
items: number;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
def: any;
|
|
34
|
+
parts: Map<string, any> | null;
|
|
35
|
+
}>;
|
|
36
|
+
/** A theme definition as expressions read it: Theme.Colors.Accent1, Theme.Fonts.MajorFont.Family, Theme.Constants.Name. */
|
|
37
|
+
export function themeContext(td: any): {
|
|
38
|
+
Colors: any;
|
|
39
|
+
Fonts: {
|
|
40
|
+
MajorFont: {
|
|
41
|
+
Family: any;
|
|
42
|
+
Size: any;
|
|
43
|
+
Weight: any;
|
|
44
|
+
Style: any;
|
|
45
|
+
};
|
|
46
|
+
MinorFont: {
|
|
47
|
+
Family: any;
|
|
48
|
+
Size: any;
|
|
49
|
+
Weight: any;
|
|
50
|
+
Style: any;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
Constants: any;
|
|
54
|
+
};
|
|
55
|
+
/** The render's theme: `theme` (a report id, or an expression giving one), else the report's own `themeDef`, else the default. */
|
|
56
|
+
export function resolveTheme(def: any, ctx: any, get: any, warn: any): Promise<{
|
|
57
|
+
Colors: any;
|
|
58
|
+
Fonts: {
|
|
59
|
+
MajorFont: {
|
|
60
|
+
Family: any;
|
|
61
|
+
Size: any;
|
|
62
|
+
Weight: any;
|
|
63
|
+
Style: any;
|
|
64
|
+
};
|
|
65
|
+
MinorFont: {
|
|
66
|
+
Family: any;
|
|
67
|
+
Size: any;
|
|
68
|
+
Weight: any;
|
|
69
|
+
Style: any;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
Constants: any;
|
|
73
|
+
}>;
|
|
74
|
+
export namespace REUSE_LIMITS {
|
|
75
|
+
let depth: number;
|
|
76
|
+
let reports: number;
|
|
77
|
+
let items: number;
|
|
78
|
+
let reportItems: number;
|
|
79
|
+
let parts: number;
|
|
80
|
+
let layers: number;
|
|
81
|
+
let styleDepth: number;
|
|
82
|
+
let repeats: number;
|
|
83
|
+
}
|
|
84
|
+
export function isReportId(v: any): boolean;
|
|
85
|
+
export function isSubreportId(v: any): boolean;
|
|
86
|
+
export namespace DEFAULT_THEME {
|
|
87
|
+
namespace colors {
|
|
88
|
+
let Dark1: string;
|
|
89
|
+
let Light1: string;
|
|
90
|
+
let Dark2: string;
|
|
91
|
+
let Light2: string;
|
|
92
|
+
let Accent1: string;
|
|
93
|
+
let Accent2: string;
|
|
94
|
+
let Accent3: string;
|
|
95
|
+
let Accent4: string;
|
|
96
|
+
let Accent5: string;
|
|
97
|
+
let Accent6: string;
|
|
98
|
+
let Hyperlink: string;
|
|
99
|
+
}
|
|
100
|
+
namespace fonts {
|
|
101
|
+
namespace major {
|
|
102
|
+
let family: string;
|
|
103
|
+
let size: number;
|
|
104
|
+
let weight: string;
|
|
105
|
+
let style: string;
|
|
106
|
+
}
|
|
107
|
+
namespace minor {
|
|
108
|
+
let family_1: string;
|
|
109
|
+
export { family_1 as family };
|
|
110
|
+
let size_1: number;
|
|
111
|
+
export { size_1 as size };
|
|
112
|
+
let weight_1: string;
|
|
113
|
+
export { weight_1 as weight };
|
|
114
|
+
let style_1: string;
|
|
115
|
+
export { style_1 as style };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
let constants: {};
|
|
119
|
+
}
|
|
120
|
+
export const THEME_COLORS: string[];
|