@vivliostyle/core 2.24.3 → 2.25.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/lib/vivliostyle/adaptive-viewer.d.ts +167 -167
- package/lib/vivliostyle/asserts.d.ts +21 -21
- package/lib/vivliostyle/assets.d.ts +35 -35
- package/lib/vivliostyle/base.d.ts +189 -189
- package/lib/vivliostyle/break-position.d.ts +39 -39
- package/lib/vivliostyle/break.d.ts +112 -112
- package/lib/vivliostyle/cfi.d.ts +77 -77
- package/lib/vivliostyle/columns.d.ts +52 -52
- package/lib/vivliostyle/constants.d.ts +53 -53
- package/lib/vivliostyle/core-viewer.d.ts +240 -240
- package/lib/vivliostyle/counters.d.ts +127 -127
- package/lib/vivliostyle/css-cascade.d.ts +974 -954
- package/lib/vivliostyle/css-logical-util.d.ts +3 -3
- package/lib/vivliostyle/css-page.d.ts +451 -451
- package/lib/vivliostyle/css-parser.d.ts +320 -320
- package/lib/vivliostyle/css-prop.d.ts +74 -74
- package/lib/vivliostyle/css-styler.d.ts +210 -210
- package/lib/vivliostyle/css-tokenizer.d.ts +243 -243
- package/lib/vivliostyle/css-validator.d.ts +319 -319
- package/lib/vivliostyle/css.d.ts +205 -205
- package/lib/vivliostyle/diff.d.ts +26 -26
- package/lib/vivliostyle/display.d.ts +62 -57
- package/lib/vivliostyle/epub.d.ts +329 -329
- package/lib/vivliostyle/exprs.d.ts +395 -395
- package/lib/vivliostyle/font.d.ts +87 -87
- package/lib/vivliostyle/footnotes.d.ts +41 -41
- package/lib/vivliostyle/geometry-util.d.ts +110 -110
- package/lib/vivliostyle/layout-helper.d.ts +16 -15
- package/lib/vivliostyle/layout-processor.d.ts +73 -73
- package/lib/vivliostyle/layout-retryers.d.ts +21 -21
- package/lib/vivliostyle/layout-util.d.ts +55 -55
- package/lib/vivliostyle/layout.d.ts +456 -456
- package/lib/vivliostyle/logging.d.ts +56 -56
- package/lib/vivliostyle/matchers.d.ts +36 -36
- package/lib/vivliostyle/math-util.d.ts +22 -22
- package/lib/vivliostyle/net.d.ts +72 -72
- package/lib/vivliostyle/ops.d.ts +263 -263
- package/lib/vivliostyle/page-floats.d.ts +178 -178
- package/lib/vivliostyle/page-master.d.ts +247 -247
- package/lib/vivliostyle/plugin.d.ts +172 -172
- package/lib/vivliostyle/print.d.ts +7 -7
- package/lib/vivliostyle/profile.d.ts +59 -59
- package/lib/vivliostyle/pseudo-element.d.ts +32 -32
- package/lib/vivliostyle/repetitive-element.d.ts +162 -162
- package/lib/vivliostyle/scripts.d.ts +15 -15
- package/lib/vivliostyle/sha1.d.ts +33 -33
- package/lib/vivliostyle/shared.d.ts +24 -24
- package/lib/vivliostyle/sizing.d.ts +29 -29
- package/lib/vivliostyle/table.d.ts +263 -263
- package/lib/vivliostyle/task-util.d.ts +37 -37
- package/lib/vivliostyle/task.d.ts +357 -357
- package/lib/vivliostyle/text-polyfill.d.ts +3 -3
- package/lib/vivliostyle/toc.d.ts +64 -64
- package/lib/vivliostyle/types.d.ts +977 -977
- package/lib/vivliostyle/urls.d.ts +25 -25
- package/lib/vivliostyle/vgen.d.ts +213 -213
- package/lib/vivliostyle/viewer-app.d.ts +19 -19
- package/lib/vivliostyle/vtree.d.ts +392 -392
- package/lib/vivliostyle/xml-doc.d.ts +88 -88
- package/lib/vivliostyle.d.ts +6 -6
- package/lib/vivliostyle.js +1 -1
- package/lib/vivliostyle.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013 Google, Inc.
|
|
3
|
-
* Copyright 2015 Trim-marks Inc.
|
|
4
|
-
* Copyright 2019 Vivliostyle Foundation
|
|
5
|
-
*
|
|
6
|
-
* Vivliostyle.js is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* Vivliostyle.js is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU Affero General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
17
|
-
* along with Vivliostyle.js. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*
|
|
19
|
-
* @fileoverview CssProp - Support utilities to extract information
|
|
20
|
-
* from various (parsed) CSS values.
|
|
21
|
-
*/
|
|
22
|
-
import * as Base from "./base";
|
|
23
|
-
import * as Css from "./css";
|
|
24
|
-
import * as Exprs from "./exprs";
|
|
25
|
-
import * as GeometryUtil from "./geometry-util";
|
|
26
|
-
export declare class SetVisitor extends Css.Visitor {
|
|
27
|
-
propSet: {
|
|
28
|
-
[key: string]: boolean;
|
|
29
|
-
};
|
|
30
|
-
constructor();
|
|
31
|
-
visitIdent(ident: Css.Ident): Css.Val;
|
|
32
|
-
visitSpaceList(list: Css.SpaceList): Css.Val;
|
|
33
|
-
}
|
|
34
|
-
export declare function toSet(val: Css.Val): {
|
|
35
|
-
[key: string]: boolean;
|
|
36
|
-
};
|
|
37
|
-
export declare class IntVisitor extends Css.Visitor {
|
|
38
|
-
value: number;
|
|
39
|
-
constructor(value: number);
|
|
40
|
-
visitInt(num: Css.Int): Css.Val;
|
|
41
|
-
}
|
|
42
|
-
export declare function toInt(val: Css.Val, def: number): number;
|
|
43
|
-
export declare class ShapeVisitor extends Css.Visitor {
|
|
44
|
-
collect: boolean;
|
|
45
|
-
coords: Css.Numeric[];
|
|
46
|
-
name: string | null;
|
|
47
|
-
constructor();
|
|
48
|
-
visitNumeric(numeric: Css.Numeric): Css.Val;
|
|
49
|
-
visitNum(num: Css.Num): Css.Val;
|
|
50
|
-
visitSpaceList(list: Css.SpaceList): Css.Val;
|
|
51
|
-
visitFunc(func: Css.Func): Css.Val;
|
|
52
|
-
getShape(x: number, y: number, width: number, height: number, context: Exprs.Context): GeometryUtil.Shape;
|
|
53
|
-
}
|
|
54
|
-
export declare function toShape(val: Css.Val, x: number, y: number, width: number, height: number, context: Exprs.Context): GeometryUtil.Shape;
|
|
55
|
-
export declare class CountersVisitor extends Css.Visitor {
|
|
56
|
-
readonly reset: boolean;
|
|
57
|
-
counters: {
|
|
58
|
-
[key: string]: number;
|
|
59
|
-
};
|
|
60
|
-
name: string | null;
|
|
61
|
-
constructor(reset: boolean);
|
|
62
|
-
visitIdent(ident: Css.Ident): Css.Val;
|
|
63
|
-
visitInt(num: Css.Int): Css.Val;
|
|
64
|
-
visitSpaceList(list: Css.SpaceList): Css.Val;
|
|
65
|
-
}
|
|
66
|
-
export declare function toCounters(val: Css.Val, reset: boolean): {
|
|
67
|
-
[key: string]: number;
|
|
68
|
-
};
|
|
69
|
-
export declare class UrlTransformVisitor extends Css.FilterVisitor {
|
|
70
|
-
baseUrl: string;
|
|
71
|
-
transformer: Base.DocumentURLTransformer;
|
|
72
|
-
constructor(baseUrl: string, transformer: Base.DocumentURLTransformer);
|
|
73
|
-
visitURL(url: Css.URL): Css.Val;
|
|
74
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013 Google, Inc.
|
|
3
|
+
* Copyright 2015 Trim-marks Inc.
|
|
4
|
+
* Copyright 2019 Vivliostyle Foundation
|
|
5
|
+
*
|
|
6
|
+
* Vivliostyle.js is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* Vivliostyle.js is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU Affero General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
* along with Vivliostyle.js. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
* @fileoverview CssProp - Support utilities to extract information
|
|
20
|
+
* from various (parsed) CSS values.
|
|
21
|
+
*/
|
|
22
|
+
import * as Base from "./base";
|
|
23
|
+
import * as Css from "./css";
|
|
24
|
+
import * as Exprs from "./exprs";
|
|
25
|
+
import * as GeometryUtil from "./geometry-util";
|
|
26
|
+
export declare class SetVisitor extends Css.Visitor {
|
|
27
|
+
propSet: {
|
|
28
|
+
[key: string]: boolean;
|
|
29
|
+
};
|
|
30
|
+
constructor();
|
|
31
|
+
visitIdent(ident: Css.Ident): Css.Val;
|
|
32
|
+
visitSpaceList(list: Css.SpaceList): Css.Val;
|
|
33
|
+
}
|
|
34
|
+
export declare function toSet(val: Css.Val): {
|
|
35
|
+
[key: string]: boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare class IntVisitor extends Css.Visitor {
|
|
38
|
+
value: number;
|
|
39
|
+
constructor(value: number);
|
|
40
|
+
visitInt(num: Css.Int): Css.Val;
|
|
41
|
+
}
|
|
42
|
+
export declare function toInt(val: Css.Val, def: number): number;
|
|
43
|
+
export declare class ShapeVisitor extends Css.Visitor {
|
|
44
|
+
collect: boolean;
|
|
45
|
+
coords: Css.Numeric[];
|
|
46
|
+
name: string | null;
|
|
47
|
+
constructor();
|
|
48
|
+
visitNumeric(numeric: Css.Numeric): Css.Val;
|
|
49
|
+
visitNum(num: Css.Num): Css.Val;
|
|
50
|
+
visitSpaceList(list: Css.SpaceList): Css.Val;
|
|
51
|
+
visitFunc(func: Css.Func): Css.Val;
|
|
52
|
+
getShape(x: number, y: number, width: number, height: number, context: Exprs.Context): GeometryUtil.Shape;
|
|
53
|
+
}
|
|
54
|
+
export declare function toShape(val: Css.Val, x: number, y: number, width: number, height: number, context: Exprs.Context): GeometryUtil.Shape;
|
|
55
|
+
export declare class CountersVisitor extends Css.Visitor {
|
|
56
|
+
readonly reset: boolean;
|
|
57
|
+
counters: {
|
|
58
|
+
[key: string]: number;
|
|
59
|
+
};
|
|
60
|
+
name: string | null;
|
|
61
|
+
constructor(reset: boolean);
|
|
62
|
+
visitIdent(ident: Css.Ident): Css.Val;
|
|
63
|
+
visitInt(num: Css.Int): Css.Val;
|
|
64
|
+
visitSpaceList(list: Css.SpaceList): Css.Val;
|
|
65
|
+
}
|
|
66
|
+
export declare function toCounters(val: Css.Val, reset: boolean): {
|
|
67
|
+
[key: string]: number;
|
|
68
|
+
};
|
|
69
|
+
export declare class UrlTransformVisitor extends Css.FilterVisitor {
|
|
70
|
+
baseUrl: string;
|
|
71
|
+
transformer: Base.DocumentURLTransformer;
|
|
72
|
+
constructor(baseUrl: string, transformer: Base.DocumentURLTransformer);
|
|
73
|
+
visitURL(url: Css.URL): Css.Val;
|
|
74
|
+
}
|
|
@@ -1,210 +1,210 @@
|
|
|
1
|
-
import * as Css from "./css";
|
|
2
|
-
import * as CssCascade from "./css-cascade";
|
|
3
|
-
import * as CssValidator from "./css-validator";
|
|
4
|
-
import * as Exprs from "./exprs";
|
|
5
|
-
import * as Vtree from "./vtree";
|
|
6
|
-
import { CssStyler, XmlDoc } from "./types";
|
|
7
|
-
export declare class SlipRange {
|
|
8
|
-
endStuckFixed: number;
|
|
9
|
-
endFixed: number;
|
|
10
|
-
endSlipped: number;
|
|
11
|
-
constructor(endStuckFixed: any, endFixed: any, endSlipped: any);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Maps all ints in a range ("fixed") to ints with slippage ("slipped")
|
|
15
|
-
*/
|
|
16
|
-
export declare class SlipMap {
|
|
17
|
-
map: SlipRange[];
|
|
18
|
-
getMaxFixed(): number;
|
|
19
|
-
getMaxSlipped(): number;
|
|
20
|
-
addStuckRange(endFixed: number): void;
|
|
21
|
-
addSlippedRange(endFixed: number): void;
|
|
22
|
-
slippedByFixed(fixed: number): number;
|
|
23
|
-
/**
|
|
24
|
-
* Smallest fixed for a given slipped.
|
|
25
|
-
*/
|
|
26
|
-
fixedBySlipped(slipped: number): number;
|
|
27
|
-
}
|
|
28
|
-
export interface FlowListener {
|
|
29
|
-
encounteredFlowChunk(flowChunk: Vtree.FlowChunk, flow: Vtree.Flow): void;
|
|
30
|
-
}
|
|
31
|
-
export interface AbstractStyler extends CssStyler.AbstractStyler {
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Represent a box generated by a (pseudo)element. When constructed, a box
|
|
35
|
-
* corresponding to `::before` pseudoelement is also constructed and stored in
|
|
36
|
-
* `beforeBox` property, whereas one corresponding `::after` pseudoelement is
|
|
37
|
-
* not constructed and `afterBox` property is `null`. `afterBox` is constructed
|
|
38
|
-
* by `buildAfterPseudoElementBox` method.
|
|
39
|
-
* @param style Cascaded style values for the box.
|
|
40
|
-
* @param offset The start offset of the box. It coincides with the start offset
|
|
41
|
-
* of the element if the box is generated by the element or the `::before`
|
|
42
|
-
* pseudoelement. When the box corresponds to the `::after` pseudoelement,
|
|
43
|
-
* the offset is just after the content before the `::after` pseudoelement.
|
|
44
|
-
* @param isRoot True if the box is generated by the root element (not
|
|
45
|
-
* pseudoelement).
|
|
46
|
-
* @param flowChunk FlowChunk to which the box belongs to.
|
|
47
|
-
* @param atBlockStart True if the box is right after the block start edge.
|
|
48
|
-
* @param atFlowStart True if the box is right after the flow start.
|
|
49
|
-
* @param isParentBoxDisplayed True if the parent box has a displayed box.
|
|
50
|
-
*/
|
|
51
|
-
export declare class Box {
|
|
52
|
-
readonly context: Exprs.Context;
|
|
53
|
-
readonly style: CssCascade.ElementStyle;
|
|
54
|
-
readonly offset: number;
|
|
55
|
-
readonly isRoot: boolean;
|
|
56
|
-
readonly flowChunk: Vtree.FlowChunk;
|
|
57
|
-
readonly atBlockStart: boolean;
|
|
58
|
-
readonly atFlowStart: boolean;
|
|
59
|
-
readonly isParentBoxDisplayed: boolean;
|
|
60
|
-
flowName: string;
|
|
61
|
-
isBlockValue: boolean | null;
|
|
62
|
-
hasBoxValue: boolean | null;
|
|
63
|
-
styleValues: {
|
|
64
|
-
[key: string]: Css.Val;
|
|
65
|
-
};
|
|
66
|
-
beforeBox: Box;
|
|
67
|
-
afterBox: Box;
|
|
68
|
-
breakBefore: string | null;
|
|
69
|
-
constructor(context: Exprs.Context, style: CssCascade.ElementStyle, offset: number, isRoot: boolean, flowChunk: Vtree.FlowChunk, atBlockStart: boolean, atFlowStart: boolean, isParentBoxDisplayed: boolean);
|
|
70
|
-
/**
|
|
71
|
-
* Build a box corresponding to `::after` pseudoelement and stores it in
|
|
72
|
-
* `afterBox` property.
|
|
73
|
-
* @param offset The start offset of the `::after` pseudoelement box, which is
|
|
74
|
-
* just after the content before the `::after` pseudoelement.
|
|
75
|
-
* @param atBlockStart True if the box is right after the block start edge.
|
|
76
|
-
* @param atFlowStart True if the box is right after the flow start.
|
|
77
|
-
*/
|
|
78
|
-
buildAfterPseudoElementBox(offset: number, atBlockStart: boolean, atFlowStart: boolean): void;
|
|
79
|
-
styleValue(name: string, defaultValue?: Css.Val): Css.Val | null;
|
|
80
|
-
displayValue(): Css.Val;
|
|
81
|
-
isBlock(): boolean;
|
|
82
|
-
hasBox(): boolean;
|
|
83
|
-
getBreakValue(edge: string): string | null;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Manages boxes generated by elements as a stack.
|
|
87
|
-
*/
|
|
88
|
-
export declare class BoxStack {
|
|
89
|
-
readonly context: Exprs.Context;
|
|
90
|
-
stack: Box[];
|
|
91
|
-
atBlockStart: boolean;
|
|
92
|
-
atFlowStart: boolean;
|
|
93
|
-
atStartStack: {
|
|
94
|
-
atBlockStart: boolean;
|
|
95
|
-
atFlowStart: boolean;
|
|
96
|
-
}[];
|
|
97
|
-
constructor(context: Exprs.Context);
|
|
98
|
-
/**
|
|
99
|
-
* Returns if the stack is empty.
|
|
100
|
-
*/
|
|
101
|
-
empty(): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Returns the last box in the stack.
|
|
104
|
-
*/
|
|
105
|
-
lastBox(): Box | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* Returns the flow name of the last box in the stack.
|
|
108
|
-
*/
|
|
109
|
-
lastFlowName(): string | null;
|
|
110
|
-
/**
|
|
111
|
-
* Returns if the last box in the stack is displayed.
|
|
112
|
-
*/
|
|
113
|
-
isCurrentBoxDisplayed(): boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Create a new box and push it to the stack.
|
|
116
|
-
* @param style Cascaded style values for the box.
|
|
117
|
-
* @param offset The start offset of the box.
|
|
118
|
-
* @param isRoot True if the box is generated by the root element
|
|
119
|
-
* @param newFlowChunk Specify if the element is a flow element (i.e. the
|
|
120
|
-
* element is specified a new `flow-into` value)
|
|
121
|
-
*/
|
|
122
|
-
push(style: CssCascade.ElementStyle, offset: number, isRoot: boolean, newFlowChunk?: Vtree.FlowChunk): Box;
|
|
123
|
-
encounteredTextNode(node: Node): void;
|
|
124
|
-
/**
|
|
125
|
-
* Pop the last box.
|
|
126
|
-
*/
|
|
127
|
-
pop(offset: number): Box;
|
|
128
|
-
/**
|
|
129
|
-
* Find the start offset of the nearest block start edge to which the
|
|
130
|
-
* `break-before` value of the box should be propagated. This method can be
|
|
131
|
-
* called when after pushing the box into the stack or after popping the box
|
|
132
|
-
* out of the stack.
|
|
133
|
-
*/
|
|
134
|
-
nearestBlockStartOffset(box: Box): number;
|
|
135
|
-
}
|
|
136
|
-
export declare class Styler implements AbstractStyler {
|
|
137
|
-
readonly xmldoc: XmlDoc.XMLDocHolder;
|
|
138
|
-
readonly scope: Exprs.LexicalScope;
|
|
139
|
-
readonly context: Exprs.Context;
|
|
140
|
-
readonly primaryFlows: {
|
|
141
|
-
[key: string]: boolean;
|
|
142
|
-
};
|
|
143
|
-
readonly validatorSet: CssValidator.ValidatorSet;
|
|
144
|
-
readonly counterListener: CssCascade.CounterListener;
|
|
145
|
-
root: Element;
|
|
146
|
-
cascadeHolder: CssCascade.Cascade;
|
|
147
|
-
last: Node;
|
|
148
|
-
rootStyle: CssCascade.ElementStyle;
|
|
149
|
-
styleMap: {
|
|
150
|
-
[key: string]: CssCascade.ElementStyle;
|
|
151
|
-
};
|
|
152
|
-
flows: {
|
|
153
|
-
[key: string]: Vtree.Flow;
|
|
154
|
-
};
|
|
155
|
-
flowChunks: Vtree.FlowChunk[];
|
|
156
|
-
flowListener: FlowListener;
|
|
157
|
-
flowToReach: string | null;
|
|
158
|
-
idToReach: string | null;
|
|
159
|
-
cascade: CssCascade.CascadeInstance;
|
|
160
|
-
offsetMap: SlipMap;
|
|
161
|
-
primary: boolean;
|
|
162
|
-
primaryStack: boolean[];
|
|
163
|
-
rootBackgroundAssigned: boolean;
|
|
164
|
-
rootLayoutAssigned: boolean;
|
|
165
|
-
lastOffset: number;
|
|
166
|
-
breakBeforeValues: {
|
|
167
|
-
[key: number]: string;
|
|
168
|
-
};
|
|
169
|
-
boxStack: BoxStack;
|
|
170
|
-
bodyReached: boolean;
|
|
171
|
-
constructor(xmldoc: XmlDoc.XMLDocHolder, cascade: CssCascade.Cascade, scope: Exprs.LexicalScope, context: Exprs.Context, primaryFlows: {
|
|
172
|
-
[key: string]: boolean;
|
|
173
|
-
}, validatorSet: CssValidator.ValidatorSet, counterListener: CssCascade.CounterListener, counterResolver: CssCascade.CounterResolver);
|
|
174
|
-
hasProp(style: CssCascade.ElementStyle, map: CssValidator.ValueMap, name: string): boolean;
|
|
175
|
-
transferPropsToRoot(srcStyle: CssCascade.ElementStyle, map: CssValidator.ValueMap): void;
|
|
176
|
-
/**
|
|
177
|
-
* Transfer properties that should be applied on the container (partition)
|
|
178
|
-
* level to this.rootStyle.
|
|
179
|
-
* @param elemStyle (source) element style
|
|
180
|
-
*/
|
|
181
|
-
postprocessTopStyle(elemStyle: CssCascade.ElementStyle, isBody: boolean): void;
|
|
182
|
-
getTopContainerStyle(): CssCascade.ElementStyle;
|
|
183
|
-
getAttrStyle(elem: Element): CssCascade.ElementStyle;
|
|
184
|
-
/**
|
|
185
|
-
* @return currently reached offset
|
|
186
|
-
*/
|
|
187
|
-
getReachedOffset(): number;
|
|
188
|
-
/**
|
|
189
|
-
* Replay flow elements that were encountered since the given offset
|
|
190
|
-
*/
|
|
191
|
-
replayFlowElementsFromOffset(offset: number): void;
|
|
192
|
-
resetFlowChunkStream(flowListener: FlowListener): void;
|
|
193
|
-
styleUntilFlowIsReached(flowName: string): void;
|
|
194
|
-
styleUntilIdIsReached(id: string): void;
|
|
195
|
-
private encounteredFlowElement;
|
|
196
|
-
registerForcedBreakOffset(breakValue: string | null, offset: number, flowName: string): void;
|
|
197
|
-
/**
|
|
198
|
-
* @param startOffset current position in the document
|
|
199
|
-
* @param lookup lookup window size for the next page
|
|
200
|
-
* @return lookup offset in the document for the next page
|
|
201
|
-
*/
|
|
202
|
-
styleUntil(startOffset: number, lookup: number): number;
|
|
203
|
-
/** @override */
|
|
204
|
-
getStyle(element: Element, deep: boolean): CssCascade.ElementStyle;
|
|
205
|
-
/** @override */
|
|
206
|
-
processContent(element: Element, styles: {
|
|
207
|
-
[key: string]: Css.Val;
|
|
208
|
-
}, viewNode: Node): void;
|
|
209
|
-
}
|
|
210
|
-
export declare const columnProps: string[];
|
|
1
|
+
import * as Css from "./css";
|
|
2
|
+
import * as CssCascade from "./css-cascade";
|
|
3
|
+
import * as CssValidator from "./css-validator";
|
|
4
|
+
import * as Exprs from "./exprs";
|
|
5
|
+
import * as Vtree from "./vtree";
|
|
6
|
+
import { CssStyler, XmlDoc } from "./types";
|
|
7
|
+
export declare class SlipRange {
|
|
8
|
+
endStuckFixed: number;
|
|
9
|
+
endFixed: number;
|
|
10
|
+
endSlipped: number;
|
|
11
|
+
constructor(endStuckFixed: any, endFixed: any, endSlipped: any);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Maps all ints in a range ("fixed") to ints with slippage ("slipped")
|
|
15
|
+
*/
|
|
16
|
+
export declare class SlipMap {
|
|
17
|
+
map: SlipRange[];
|
|
18
|
+
getMaxFixed(): number;
|
|
19
|
+
getMaxSlipped(): number;
|
|
20
|
+
addStuckRange(endFixed: number): void;
|
|
21
|
+
addSlippedRange(endFixed: number): void;
|
|
22
|
+
slippedByFixed(fixed: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* Smallest fixed for a given slipped.
|
|
25
|
+
*/
|
|
26
|
+
fixedBySlipped(slipped: number): number;
|
|
27
|
+
}
|
|
28
|
+
export interface FlowListener {
|
|
29
|
+
encounteredFlowChunk(flowChunk: Vtree.FlowChunk, flow: Vtree.Flow): void;
|
|
30
|
+
}
|
|
31
|
+
export interface AbstractStyler extends CssStyler.AbstractStyler {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Represent a box generated by a (pseudo)element. When constructed, a box
|
|
35
|
+
* corresponding to `::before` pseudoelement is also constructed and stored in
|
|
36
|
+
* `beforeBox` property, whereas one corresponding `::after` pseudoelement is
|
|
37
|
+
* not constructed and `afterBox` property is `null`. `afterBox` is constructed
|
|
38
|
+
* by `buildAfterPseudoElementBox` method.
|
|
39
|
+
* @param style Cascaded style values for the box.
|
|
40
|
+
* @param offset The start offset of the box. It coincides with the start offset
|
|
41
|
+
* of the element if the box is generated by the element or the `::before`
|
|
42
|
+
* pseudoelement. When the box corresponds to the `::after` pseudoelement,
|
|
43
|
+
* the offset is just after the content before the `::after` pseudoelement.
|
|
44
|
+
* @param isRoot True if the box is generated by the root element (not
|
|
45
|
+
* pseudoelement).
|
|
46
|
+
* @param flowChunk FlowChunk to which the box belongs to.
|
|
47
|
+
* @param atBlockStart True if the box is right after the block start edge.
|
|
48
|
+
* @param atFlowStart True if the box is right after the flow start.
|
|
49
|
+
* @param isParentBoxDisplayed True if the parent box has a displayed box.
|
|
50
|
+
*/
|
|
51
|
+
export declare class Box {
|
|
52
|
+
readonly context: Exprs.Context;
|
|
53
|
+
readonly style: CssCascade.ElementStyle;
|
|
54
|
+
readonly offset: number;
|
|
55
|
+
readonly isRoot: boolean;
|
|
56
|
+
readonly flowChunk: Vtree.FlowChunk;
|
|
57
|
+
readonly atBlockStart: boolean;
|
|
58
|
+
readonly atFlowStart: boolean;
|
|
59
|
+
readonly isParentBoxDisplayed: boolean;
|
|
60
|
+
flowName: string;
|
|
61
|
+
isBlockValue: boolean | null;
|
|
62
|
+
hasBoxValue: boolean | null;
|
|
63
|
+
styleValues: {
|
|
64
|
+
[key: string]: Css.Val;
|
|
65
|
+
};
|
|
66
|
+
beforeBox: Box;
|
|
67
|
+
afterBox: Box;
|
|
68
|
+
breakBefore: string | null;
|
|
69
|
+
constructor(context: Exprs.Context, style: CssCascade.ElementStyle, offset: number, isRoot: boolean, flowChunk: Vtree.FlowChunk, atBlockStart: boolean, atFlowStart: boolean, isParentBoxDisplayed: boolean);
|
|
70
|
+
/**
|
|
71
|
+
* Build a box corresponding to `::after` pseudoelement and stores it in
|
|
72
|
+
* `afterBox` property.
|
|
73
|
+
* @param offset The start offset of the `::after` pseudoelement box, which is
|
|
74
|
+
* just after the content before the `::after` pseudoelement.
|
|
75
|
+
* @param atBlockStart True if the box is right after the block start edge.
|
|
76
|
+
* @param atFlowStart True if the box is right after the flow start.
|
|
77
|
+
*/
|
|
78
|
+
buildAfterPseudoElementBox(offset: number, atBlockStart: boolean, atFlowStart: boolean): void;
|
|
79
|
+
styleValue(name: string, defaultValue?: Css.Val): Css.Val | null;
|
|
80
|
+
displayValue(): Css.Val;
|
|
81
|
+
isBlock(): boolean;
|
|
82
|
+
hasBox(): boolean;
|
|
83
|
+
getBreakValue(edge: string): string | null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Manages boxes generated by elements as a stack.
|
|
87
|
+
*/
|
|
88
|
+
export declare class BoxStack {
|
|
89
|
+
readonly context: Exprs.Context;
|
|
90
|
+
stack: Box[];
|
|
91
|
+
atBlockStart: boolean;
|
|
92
|
+
atFlowStart: boolean;
|
|
93
|
+
atStartStack: {
|
|
94
|
+
atBlockStart: boolean;
|
|
95
|
+
atFlowStart: boolean;
|
|
96
|
+
}[];
|
|
97
|
+
constructor(context: Exprs.Context);
|
|
98
|
+
/**
|
|
99
|
+
* Returns if the stack is empty.
|
|
100
|
+
*/
|
|
101
|
+
empty(): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Returns the last box in the stack.
|
|
104
|
+
*/
|
|
105
|
+
lastBox(): Box | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the flow name of the last box in the stack.
|
|
108
|
+
*/
|
|
109
|
+
lastFlowName(): string | null;
|
|
110
|
+
/**
|
|
111
|
+
* Returns if the last box in the stack is displayed.
|
|
112
|
+
*/
|
|
113
|
+
isCurrentBoxDisplayed(): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Create a new box and push it to the stack.
|
|
116
|
+
* @param style Cascaded style values for the box.
|
|
117
|
+
* @param offset The start offset of the box.
|
|
118
|
+
* @param isRoot True if the box is generated by the root element
|
|
119
|
+
* @param newFlowChunk Specify if the element is a flow element (i.e. the
|
|
120
|
+
* element is specified a new `flow-into` value)
|
|
121
|
+
*/
|
|
122
|
+
push(style: CssCascade.ElementStyle, offset: number, isRoot: boolean, newFlowChunk?: Vtree.FlowChunk): Box;
|
|
123
|
+
encounteredTextNode(node: Node): void;
|
|
124
|
+
/**
|
|
125
|
+
* Pop the last box.
|
|
126
|
+
*/
|
|
127
|
+
pop(offset: number): Box;
|
|
128
|
+
/**
|
|
129
|
+
* Find the start offset of the nearest block start edge to which the
|
|
130
|
+
* `break-before` value of the box should be propagated. This method can be
|
|
131
|
+
* called when after pushing the box into the stack or after popping the box
|
|
132
|
+
* out of the stack.
|
|
133
|
+
*/
|
|
134
|
+
nearestBlockStartOffset(box: Box): number;
|
|
135
|
+
}
|
|
136
|
+
export declare class Styler implements AbstractStyler {
|
|
137
|
+
readonly xmldoc: XmlDoc.XMLDocHolder;
|
|
138
|
+
readonly scope: Exprs.LexicalScope;
|
|
139
|
+
readonly context: Exprs.Context;
|
|
140
|
+
readonly primaryFlows: {
|
|
141
|
+
[key: string]: boolean;
|
|
142
|
+
};
|
|
143
|
+
readonly validatorSet: CssValidator.ValidatorSet;
|
|
144
|
+
readonly counterListener: CssCascade.CounterListener;
|
|
145
|
+
root: Element;
|
|
146
|
+
cascadeHolder: CssCascade.Cascade;
|
|
147
|
+
last: Node;
|
|
148
|
+
rootStyle: CssCascade.ElementStyle;
|
|
149
|
+
styleMap: {
|
|
150
|
+
[key: string]: CssCascade.ElementStyle;
|
|
151
|
+
};
|
|
152
|
+
flows: {
|
|
153
|
+
[key: string]: Vtree.Flow;
|
|
154
|
+
};
|
|
155
|
+
flowChunks: Vtree.FlowChunk[];
|
|
156
|
+
flowListener: FlowListener;
|
|
157
|
+
flowToReach: string | null;
|
|
158
|
+
idToReach: string | null;
|
|
159
|
+
cascade: CssCascade.CascadeInstance;
|
|
160
|
+
offsetMap: SlipMap;
|
|
161
|
+
primary: boolean;
|
|
162
|
+
primaryStack: boolean[];
|
|
163
|
+
rootBackgroundAssigned: boolean;
|
|
164
|
+
rootLayoutAssigned: boolean;
|
|
165
|
+
lastOffset: number;
|
|
166
|
+
breakBeforeValues: {
|
|
167
|
+
[key: number]: string;
|
|
168
|
+
};
|
|
169
|
+
boxStack: BoxStack;
|
|
170
|
+
bodyReached: boolean;
|
|
171
|
+
constructor(xmldoc: XmlDoc.XMLDocHolder, cascade: CssCascade.Cascade, scope: Exprs.LexicalScope, context: Exprs.Context, primaryFlows: {
|
|
172
|
+
[key: string]: boolean;
|
|
173
|
+
}, validatorSet: CssValidator.ValidatorSet, counterListener: CssCascade.CounterListener, counterResolver: CssCascade.CounterResolver);
|
|
174
|
+
hasProp(style: CssCascade.ElementStyle, map: CssValidator.ValueMap, name: string): boolean;
|
|
175
|
+
transferPropsToRoot(srcStyle: CssCascade.ElementStyle, map: CssValidator.ValueMap): void;
|
|
176
|
+
/**
|
|
177
|
+
* Transfer properties that should be applied on the container (partition)
|
|
178
|
+
* level to this.rootStyle.
|
|
179
|
+
* @param elemStyle (source) element style
|
|
180
|
+
*/
|
|
181
|
+
postprocessTopStyle(elemStyle: CssCascade.ElementStyle, isBody: boolean): void;
|
|
182
|
+
getTopContainerStyle(): CssCascade.ElementStyle;
|
|
183
|
+
getAttrStyle(elem: Element): CssCascade.ElementStyle;
|
|
184
|
+
/**
|
|
185
|
+
* @return currently reached offset
|
|
186
|
+
*/
|
|
187
|
+
getReachedOffset(): number;
|
|
188
|
+
/**
|
|
189
|
+
* Replay flow elements that were encountered since the given offset
|
|
190
|
+
*/
|
|
191
|
+
replayFlowElementsFromOffset(offset: number): void;
|
|
192
|
+
resetFlowChunkStream(flowListener: FlowListener): void;
|
|
193
|
+
styleUntilFlowIsReached(flowName: string): void;
|
|
194
|
+
styleUntilIdIsReached(id: string): void;
|
|
195
|
+
private encounteredFlowElement;
|
|
196
|
+
registerForcedBreakOffset(breakValue: string | null, offset: number, flowName: string): void;
|
|
197
|
+
/**
|
|
198
|
+
* @param startOffset current position in the document
|
|
199
|
+
* @param lookup lookup window size for the next page
|
|
200
|
+
* @return lookup offset in the document for the next page
|
|
201
|
+
*/
|
|
202
|
+
styleUntil(startOffset: number, lookup: number): number;
|
|
203
|
+
/** @override */
|
|
204
|
+
getStyle(element: Element, deep: boolean): CssCascade.ElementStyle;
|
|
205
|
+
/** @override */
|
|
206
|
+
processContent(element: Element, styles: {
|
|
207
|
+
[key: string]: Css.Val;
|
|
208
|
+
}, viewNode: Node): void;
|
|
209
|
+
}
|
|
210
|
+
export declare const columnProps: string[];
|