@vivliostyle/core 2.24.2 → 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 -450
- 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,263 +1,263 @@
|
|
|
1
|
-
import * as BreakPosition from "./break-position";
|
|
2
|
-
import * as LayoutProcessor from "./layout-processor";
|
|
3
|
-
import * as LayoutRetryers from "./layout-retryers";
|
|
4
|
-
import * as LayoutUtil from "./layout-util";
|
|
5
|
-
import * as RepetitiveElementImpl from "./repetitive-element";
|
|
6
|
-
import * as Task from "./task";
|
|
7
|
-
import * as Layout from "./layout";
|
|
8
|
-
import { FormattingContextType, FragmentLayoutConstraintType, Layout as LayoutType, RepetitiveElement, Table, Vtree } from "./types";
|
|
9
|
-
export declare class TableRow {
|
|
10
|
-
readonly rowIndex: number;
|
|
11
|
-
readonly sourceNode: Node;
|
|
12
|
-
cells: TableCell[];
|
|
13
|
-
constructor(rowIndex: number, sourceNode: Node);
|
|
14
|
-
addCell(cell: TableCell): void;
|
|
15
|
-
getMinimumHeight(): number;
|
|
16
|
-
}
|
|
17
|
-
export declare class TableCell {
|
|
18
|
-
readonly rowIndex: number;
|
|
19
|
-
readonly columnIndex: number;
|
|
20
|
-
viewElement: Element | null;
|
|
21
|
-
colSpan: number;
|
|
22
|
-
rowSpan: number;
|
|
23
|
-
height: number;
|
|
24
|
-
anchorSlot: TableSlot;
|
|
25
|
-
constructor(rowIndex: number, columnIndex: number, viewElement: Element);
|
|
26
|
-
setHeight(height: number): void;
|
|
27
|
-
setAnchorSlot(slot: TableSlot): void;
|
|
28
|
-
}
|
|
29
|
-
export declare class TableSlot {
|
|
30
|
-
readonly rowIndex: number;
|
|
31
|
-
readonly columnIndex: number;
|
|
32
|
-
readonly cell: TableCell;
|
|
33
|
-
constructor(rowIndex: number, columnIndex: number, cell: TableCell);
|
|
34
|
-
}
|
|
35
|
-
export declare class TableCellFragment {
|
|
36
|
-
readonly column: Layout.Column;
|
|
37
|
-
readonly cellNodeContext: Vtree.NodeContext;
|
|
38
|
-
pseudoColumn: Layout.PseudoColumn;
|
|
39
|
-
empty: boolean;
|
|
40
|
-
constructor(column: Layout.Column, pseudoColumnContainer: Element, cellNodeContext: Vtree.NodeContext);
|
|
41
|
-
findAcceptableBreakPosition(): Layout.BreakPositionAndNodeContext;
|
|
42
|
-
}
|
|
43
|
-
export declare class TableCaptionView {
|
|
44
|
-
readonly viewNode: Element;
|
|
45
|
-
readonly side: string;
|
|
46
|
-
constructor(viewNode: Element, side: string);
|
|
47
|
-
}
|
|
48
|
-
export declare class BetweenTableRowBreakPosition extends BreakPosition.EdgeBreakPosition {
|
|
49
|
-
private formattingContext;
|
|
50
|
-
acceptableCellBreakPositions: Layout.BreakPositionAndNodeContext[];
|
|
51
|
-
private rowIndex;
|
|
52
|
-
constructor(position: Vtree.NodeContext, breakOnEdge: string | null, overflows: boolean, columnBlockSize: number);
|
|
53
|
-
findAcceptableBreak(column: Layout.Column, penalty: number): Vtree.NodeContext;
|
|
54
|
-
getMinBreakPenalty(): number;
|
|
55
|
-
getAcceptableCellBreakPositions(): Layout.BreakPositionAndNodeContext[];
|
|
56
|
-
private getRowIndex;
|
|
57
|
-
private getCellFragments;
|
|
58
|
-
}
|
|
59
|
-
export declare class InsideTableRowBreakPosition extends BreakPosition.AbstractBreakPosition {
|
|
60
|
-
readonly rowIndex: number;
|
|
61
|
-
readonly beforeNodeContext: Vtree.NodeContext;
|
|
62
|
-
readonly formattingContext: TableFormattingContext;
|
|
63
|
-
acceptableCellBreakPositions: Layout.BreakPositionAndNodeContext[];
|
|
64
|
-
constructor(rowIndex: number, beforeNodeContext: Vtree.NodeContext, formattingContext: TableFormattingContext);
|
|
65
|
-
findAcceptableBreak(column: Layout.Column, penalty: number): Vtree.NodeContext;
|
|
66
|
-
getMinBreakPenalty(): number;
|
|
67
|
-
getAcceptableCellBreakPositions(): Layout.BreakPositionAndNodeContext[];
|
|
68
|
-
private getCellFragments;
|
|
69
|
-
}
|
|
70
|
-
export
|
|
71
|
-
cellNodePosition: Vtree.NodePosition;
|
|
72
|
-
breakChunkPosition: Vtree.ChunkPosition;
|
|
73
|
-
cell: TableCell;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* @param tableSourceNode Source node of the table
|
|
77
|
-
*/
|
|
78
|
-
export declare class TableFormattingContext extends RepetitiveElementImpl.RepetitiveElementsOwnerFormattingContext implements Table.TableFormattingContext {
|
|
79
|
-
readonly tableSourceNode: Element;
|
|
80
|
-
formattingContextType: FormattingContextType;
|
|
81
|
-
vertical: boolean;
|
|
82
|
-
columnCount: number;
|
|
83
|
-
tableWidth: number;
|
|
84
|
-
captions: TableCaptionView[];
|
|
85
|
-
colGroups: DocumentFragment | null;
|
|
86
|
-
colWidths: number[] | null;
|
|
87
|
-
inlineBorderSpacing: number;
|
|
88
|
-
rows: TableRow[];
|
|
89
|
-
slots: TableSlot[][];
|
|
90
|
-
cellFragments: TableCellFragment[][];
|
|
91
|
-
lastRowViewNode: Element | null;
|
|
92
|
-
cellBreakPositions: BrokenTableCellPosition[];
|
|
93
|
-
repetitiveElements: RepetitiveElement.RepetitiveElements | null;
|
|
94
|
-
constructor(parent: Vtree.FormattingContext, tableSourceNode: Element);
|
|
95
|
-
getName(): string;
|
|
96
|
-
isFirstTime(nodeContext: Vtree.NodeContext, firstTime: boolean): boolean;
|
|
97
|
-
getParent(): Vtree.FormattingContext;
|
|
98
|
-
finishFragment(): void;
|
|
99
|
-
addRow(rowIndex: number, row: TableRow): void;
|
|
100
|
-
getRowSlots(rowIndex: number): TableSlot[];
|
|
101
|
-
addCell(rowIndex: number, cell: TableCell): void;
|
|
102
|
-
getRowByIndex(index: number): TableRow;
|
|
103
|
-
findRowIndexBySourceNode(sourceNode: Node): number;
|
|
104
|
-
addCellFragment(rowIndex: number, columnIndex: number, cellFragment: TableCellFragment): void;
|
|
105
|
-
getCellsFallingOnRow(rowIndex: number): TableCell[];
|
|
106
|
-
getRowSpanningCellsOverflowingTheRow(rowIndex: number): TableCell[];
|
|
107
|
-
getCellFragmentOfCell(cell: TableCell): TableCellFragment;
|
|
108
|
-
isFreelyFragmentableRow(row: TableRow): boolean;
|
|
109
|
-
getColumnCount(): number;
|
|
110
|
-
updateCellSizes(clientLayout: Vtree.ClientLayout): void;
|
|
111
|
-
/**
|
|
112
|
-
* @return position
|
|
113
|
-
*/
|
|
114
|
-
findCellFromColumn(column: Layout.Column): {
|
|
115
|
-
rowIndex: number;
|
|
116
|
-
columnIndex: number;
|
|
117
|
-
} | null;
|
|
118
|
-
collectElementsOffsetOfUpperCells(position: {
|
|
119
|
-
rowIndex: number;
|
|
120
|
-
columnIndex: number;
|
|
121
|
-
} | null): RepetitiveElement.ElementsOffset[];
|
|
122
|
-
collectElementsOffsetOfHighestColumn(): RepetitiveElement.ElementsOffset[];
|
|
123
|
-
private collectElementsOffsetFromColumn;
|
|
124
|
-
saveState(): any;
|
|
125
|
-
restoreState(state: any): void;
|
|
126
|
-
}
|
|
127
|
-
export declare class ElementsOffsetOfTableCell implements RepetitiveElement.ElementsOffset {
|
|
128
|
-
readonly repeatitiveElementsInColumns: RepetitiveElement.ElementsOffset[][];
|
|
129
|
-
constructor(repeatitiveElementsInColumns: RepetitiveElement.ElementsOffset[][]);
|
|
130
|
-
/** @override */
|
|
131
|
-
calculateOffset(nodeContext: Vtree.NodeContext): number;
|
|
132
|
-
/** @override */
|
|
133
|
-
calculateMinimumOffset(nodeContext: Vtree.NodeContext): number;
|
|
134
|
-
private calculateMaxOffsetOfColumn;
|
|
135
|
-
}
|
|
136
|
-
export declare class EntireTableLayoutStrategy extends LayoutUtil.EdgeSkipper {
|
|
137
|
-
readonly formattingContext: TableFormattingContext;
|
|
138
|
-
readonly column: Layout.Column;
|
|
139
|
-
rowIndex: number;
|
|
140
|
-
columnIndex: number;
|
|
141
|
-
inRow: boolean;
|
|
142
|
-
checkPoints: Vtree.NodeContext[];
|
|
143
|
-
inHeaderOrFooter: boolean;
|
|
144
|
-
constructor(formattingContext: TableFormattingContext, column: Layout.Column);
|
|
145
|
-
startNonInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
146
|
-
afterNonInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
147
|
-
startNonElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
148
|
-
afterNonElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
149
|
-
startInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
150
|
-
afterInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
151
|
-
registerCheckPoint(state: LayoutUtil.LayoutIteratorState): void;
|
|
152
|
-
postLayoutBlockContents(state: LayoutUtil.LayoutIteratorState): void;
|
|
153
|
-
}
|
|
154
|
-
export declare class TableLayoutStrategy extends LayoutUtil.EdgeSkipper {
|
|
155
|
-
readonly formattingContext: TableFormattingContext;
|
|
156
|
-
readonly column: Layout.Column;
|
|
157
|
-
private static ignoreList;
|
|
158
|
-
inRow: boolean;
|
|
159
|
-
currentRowIndex: number;
|
|
160
|
-
currentColumnIndex: number;
|
|
161
|
-
originalStopAtOverflow: boolean;
|
|
162
|
-
inHeader: boolean;
|
|
163
|
-
inFooter: boolean;
|
|
164
|
-
constructor(formattingContext: TableFormattingContext, column: Layout.Column);
|
|
165
|
-
resetColumn(): void;
|
|
166
|
-
getColSpanningCellWidth(cell: TableCell): number;
|
|
167
|
-
layoutCell(cell: TableCell, cellNodeContext: Vtree.NodeContext, startChunkPosition: Vtree.ChunkPosition): Task.Result<boolean>;
|
|
168
|
-
hasBrokenCellAtSlot(slotIndex: any): boolean;
|
|
169
|
-
private extractRowSpanningCellBreakPositions;
|
|
170
|
-
layoutRowSpanningCellsFromPreviousFragment(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
171
|
-
startTableRow(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
172
|
-
private registerCellFragmentIndex;
|
|
173
|
-
startTableCell(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
174
|
-
startNonInlineBox(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
175
|
-
endNonInlineBox(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
176
|
-
afterNonInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
177
|
-
}
|
|
178
|
-
export declare class TableLayoutProcessor implements LayoutProcessor.LayoutProcessor {
|
|
179
|
-
private layoutEntireTable;
|
|
180
|
-
private getColumnWidths;
|
|
181
|
-
private getColGroupElements;
|
|
182
|
-
private normalizeAndGetColElements;
|
|
183
|
-
private addMissingColElements;
|
|
184
|
-
/**
|
|
185
|
-
* Measure width of columns and normalize colgroup and col elements so that
|
|
186
|
-
* each column has a corresponding col element with the width specified.
|
|
187
|
-
*/
|
|
188
|
-
normalizeColGroups(formattingContext: TableFormattingContext, tableElement: Element, column: Layout.Column): void;
|
|
189
|
-
doInitialLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
190
|
-
addCaptions(formattingContext: TableFormattingContext, rootViewNode: Element, firstChild: Node | null): void;
|
|
191
|
-
addColGroups(formattingContext: TableFormattingContext, rootViewNode: Element, firstChild: Node | null): void;
|
|
192
|
-
removeColGroups(formattingContext: TableFormattingContext, rootViewNode: Element): void;
|
|
193
|
-
doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
194
|
-
/** @override */
|
|
195
|
-
layout(nodeContext: Vtree.NodeContext, column: Layout.Column, leadingEdge: boolean): Task.Result<Vtree.NodeContext>;
|
|
196
|
-
/** @override */
|
|
197
|
-
createEdgeBreakPosition(position: Vtree.NodeContext, breakOnEdge: string | null, overflows: boolean, columnBlockSize: number): LayoutType.BreakPosition;
|
|
198
|
-
/** @override */
|
|
199
|
-
startNonInlineElementNode(nodeContext: Vtree.NodeContext): boolean;
|
|
200
|
-
/** @override */
|
|
201
|
-
afterNonInlineElementNode(nodeContext: Vtree.NodeContext, stopAtOverflow: boolean): boolean;
|
|
202
|
-
/** @override */
|
|
203
|
-
finishBreak(column: Layout.Column, nodeContext: Vtree.NodeContext, forceRemoveSelf: boolean, endOfColumn: boolean): Task.Result<boolean>;
|
|
204
|
-
/** @override */
|
|
205
|
-
clearOverflownViewNodes(column: Layout.Column, parentNodeContext: Vtree.NodeContext, nodeContext: Vtree.NodeContext, removeSelf: boolean): void;
|
|
206
|
-
}
|
|
207
|
-
export declare class LayoutRetryer extends LayoutRetryers.AbstractLayoutRetryer {
|
|
208
|
-
private tableFormattingContext;
|
|
209
|
-
private readonly processor;
|
|
210
|
-
constructor(tableFormattingContext: TableFormattingContext, processor: TableLayoutProcessor);
|
|
211
|
-
resolveLayoutMode(nodeContext: Vtree.NodeContext): LayoutType.LayoutMode;
|
|
212
|
-
clearNodes(initialPosition: Vtree.NodeContext): void;
|
|
213
|
-
restoreState(nodeContext: Vtree.NodeContext, column: Layout.Column): void;
|
|
214
|
-
}
|
|
215
|
-
export declare class LayoutEntireTable extends RepetitiveElementImpl.LayoutEntireBlock {
|
|
216
|
-
readonly processor: TableLayoutProcessor;
|
|
217
|
-
constructor(formattingContext: TableFormattingContext, processor: TableLayoutProcessor);
|
|
218
|
-
doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
219
|
-
}
|
|
220
|
-
export declare class EntireTableBreakPosition extends BreakPosition.EdgeBreakPosition {
|
|
221
|
-
constructor(tableNodeContext: Vtree.NodeContext);
|
|
222
|
-
getMinBreakPenalty(): number;
|
|
223
|
-
breakPositionChosen(column: Layout.Column): void;
|
|
224
|
-
}
|
|
225
|
-
export declare class EntireTableLayoutConstraint implements Layout.FragmentLayoutConstraint {
|
|
226
|
-
tableRootNode: Node;
|
|
227
|
-
flagmentLayoutConstraintType: FragmentLayoutConstraintType;
|
|
228
|
-
constructor(tableRootNode: Node);
|
|
229
|
-
/** @override */
|
|
230
|
-
allowLayout(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, column: Layout.Column): boolean;
|
|
231
|
-
/** @override */
|
|
232
|
-
nextCandidate(nodeContext: Vtree.NodeContext): boolean;
|
|
233
|
-
/** @override */
|
|
234
|
-
postLayout(allowed: boolean, positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Layout.Column): void;
|
|
235
|
-
/** @override */
|
|
236
|
-
finishBreak(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<boolean>;
|
|
237
|
-
/** @override */
|
|
238
|
-
equalsTo(constraint: Layout.FragmentLayoutConstraint): boolean;
|
|
239
|
-
/** @override */
|
|
240
|
-
getPriorityOfFinishBreak(): number;
|
|
241
|
-
}
|
|
242
|
-
export declare class LayoutFragmentedTable extends RepetitiveElementImpl.LayoutFragmentedBlock {
|
|
243
|
-
readonly processor: TableLayoutProcessor;
|
|
244
|
-
constructor(formattingContext: TableFormattingContext, processor: TableLayoutProcessor);
|
|
245
|
-
doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
246
|
-
}
|
|
247
|
-
export declare class TableRowLayoutConstraint extends RepetitiveElementImpl.RepetitiveElementsOwnerLayoutConstraint implements Table.TableRowLayoutConstraint {
|
|
248
|
-
flagmentLayoutConstraintType: FragmentLayoutConstraintType;
|
|
249
|
-
cellFragmentLayoutConstraints: {
|
|
250
|
-
constraints: Layout.FragmentLayoutConstraint[];
|
|
251
|
-
breakPosition: Vtree.NodeContext;
|
|
252
|
-
}[];
|
|
253
|
-
constructor(nodeContext: Vtree.NodeContext);
|
|
254
|
-
allowLayout(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, column: Layout.Column): boolean;
|
|
255
|
-
nextCandidate(nodeContext: Vtree.NodeContext): boolean;
|
|
256
|
-
postLayout(allowed: boolean, positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Layout.Column): void;
|
|
257
|
-
finishBreak(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<boolean>;
|
|
258
|
-
removeDummyRowNodes(nodeContext: Vtree.NodeContext): void;
|
|
259
|
-
private collectCellFragmentLayoutConstraints;
|
|
260
|
-
private getCellFragemnts;
|
|
261
|
-
getElementsOffsetsForTableCell(column: Layout.Column): RepetitiveElement.ElementsOffset[];
|
|
262
|
-
equalsTo(constraint: Layout.FragmentLayoutConstraint): boolean;
|
|
263
|
-
}
|
|
1
|
+
import * as BreakPosition from "./break-position";
|
|
2
|
+
import * as LayoutProcessor from "./layout-processor";
|
|
3
|
+
import * as LayoutRetryers from "./layout-retryers";
|
|
4
|
+
import * as LayoutUtil from "./layout-util";
|
|
5
|
+
import * as RepetitiveElementImpl from "./repetitive-element";
|
|
6
|
+
import * as Task from "./task";
|
|
7
|
+
import * as Layout from "./layout";
|
|
8
|
+
import { FormattingContextType, FragmentLayoutConstraintType, Layout as LayoutType, RepetitiveElement, Table, Vtree } from "./types";
|
|
9
|
+
export declare class TableRow {
|
|
10
|
+
readonly rowIndex: number;
|
|
11
|
+
readonly sourceNode: Node;
|
|
12
|
+
cells: TableCell[];
|
|
13
|
+
constructor(rowIndex: number, sourceNode: Node);
|
|
14
|
+
addCell(cell: TableCell): void;
|
|
15
|
+
getMinimumHeight(): number;
|
|
16
|
+
}
|
|
17
|
+
export declare class TableCell {
|
|
18
|
+
readonly rowIndex: number;
|
|
19
|
+
readonly columnIndex: number;
|
|
20
|
+
viewElement: Element | null;
|
|
21
|
+
colSpan: number;
|
|
22
|
+
rowSpan: number;
|
|
23
|
+
height: number;
|
|
24
|
+
anchorSlot: TableSlot;
|
|
25
|
+
constructor(rowIndex: number, columnIndex: number, viewElement: Element);
|
|
26
|
+
setHeight(height: number): void;
|
|
27
|
+
setAnchorSlot(slot: TableSlot): void;
|
|
28
|
+
}
|
|
29
|
+
export declare class TableSlot {
|
|
30
|
+
readonly rowIndex: number;
|
|
31
|
+
readonly columnIndex: number;
|
|
32
|
+
readonly cell: TableCell;
|
|
33
|
+
constructor(rowIndex: number, columnIndex: number, cell: TableCell);
|
|
34
|
+
}
|
|
35
|
+
export declare class TableCellFragment {
|
|
36
|
+
readonly column: Layout.Column;
|
|
37
|
+
readonly cellNodeContext: Vtree.NodeContext;
|
|
38
|
+
pseudoColumn: Layout.PseudoColumn;
|
|
39
|
+
empty: boolean;
|
|
40
|
+
constructor(column: Layout.Column, pseudoColumnContainer: Element, cellNodeContext: Vtree.NodeContext);
|
|
41
|
+
findAcceptableBreakPosition(): Layout.BreakPositionAndNodeContext;
|
|
42
|
+
}
|
|
43
|
+
export declare class TableCaptionView {
|
|
44
|
+
readonly viewNode: Element;
|
|
45
|
+
readonly side: string;
|
|
46
|
+
constructor(viewNode: Element, side: string);
|
|
47
|
+
}
|
|
48
|
+
export declare class BetweenTableRowBreakPosition extends BreakPosition.EdgeBreakPosition {
|
|
49
|
+
private formattingContext;
|
|
50
|
+
acceptableCellBreakPositions: Layout.BreakPositionAndNodeContext[];
|
|
51
|
+
private rowIndex;
|
|
52
|
+
constructor(position: Vtree.NodeContext, breakOnEdge: string | null, overflows: boolean, columnBlockSize: number);
|
|
53
|
+
findAcceptableBreak(column: Layout.Column, penalty: number): Vtree.NodeContext;
|
|
54
|
+
getMinBreakPenalty(): number;
|
|
55
|
+
getAcceptableCellBreakPositions(): Layout.BreakPositionAndNodeContext[];
|
|
56
|
+
private getRowIndex;
|
|
57
|
+
private getCellFragments;
|
|
58
|
+
}
|
|
59
|
+
export declare class InsideTableRowBreakPosition extends BreakPosition.AbstractBreakPosition {
|
|
60
|
+
readonly rowIndex: number;
|
|
61
|
+
readonly beforeNodeContext: Vtree.NodeContext;
|
|
62
|
+
readonly formattingContext: TableFormattingContext;
|
|
63
|
+
acceptableCellBreakPositions: Layout.BreakPositionAndNodeContext[];
|
|
64
|
+
constructor(rowIndex: number, beforeNodeContext: Vtree.NodeContext, formattingContext: TableFormattingContext);
|
|
65
|
+
findAcceptableBreak(column: Layout.Column, penalty: number): Vtree.NodeContext;
|
|
66
|
+
getMinBreakPenalty(): number;
|
|
67
|
+
getAcceptableCellBreakPositions(): Layout.BreakPositionAndNodeContext[];
|
|
68
|
+
private getCellFragments;
|
|
69
|
+
}
|
|
70
|
+
export type BrokenTableCellPosition = {
|
|
71
|
+
cellNodePosition: Vtree.NodePosition;
|
|
72
|
+
breakChunkPosition: Vtree.ChunkPosition;
|
|
73
|
+
cell: TableCell;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* @param tableSourceNode Source node of the table
|
|
77
|
+
*/
|
|
78
|
+
export declare class TableFormattingContext extends RepetitiveElementImpl.RepetitiveElementsOwnerFormattingContext implements Table.TableFormattingContext {
|
|
79
|
+
readonly tableSourceNode: Element;
|
|
80
|
+
formattingContextType: FormattingContextType;
|
|
81
|
+
vertical: boolean;
|
|
82
|
+
columnCount: number;
|
|
83
|
+
tableWidth: number;
|
|
84
|
+
captions: TableCaptionView[];
|
|
85
|
+
colGroups: DocumentFragment | null;
|
|
86
|
+
colWidths: number[] | null;
|
|
87
|
+
inlineBorderSpacing: number;
|
|
88
|
+
rows: TableRow[];
|
|
89
|
+
slots: TableSlot[][];
|
|
90
|
+
cellFragments: TableCellFragment[][];
|
|
91
|
+
lastRowViewNode: Element | null;
|
|
92
|
+
cellBreakPositions: BrokenTableCellPosition[];
|
|
93
|
+
repetitiveElements: RepetitiveElement.RepetitiveElements | null;
|
|
94
|
+
constructor(parent: Vtree.FormattingContext, tableSourceNode: Element);
|
|
95
|
+
getName(): string;
|
|
96
|
+
isFirstTime(nodeContext: Vtree.NodeContext, firstTime: boolean): boolean;
|
|
97
|
+
getParent(): Vtree.FormattingContext;
|
|
98
|
+
finishFragment(): void;
|
|
99
|
+
addRow(rowIndex: number, row: TableRow): void;
|
|
100
|
+
getRowSlots(rowIndex: number): TableSlot[];
|
|
101
|
+
addCell(rowIndex: number, cell: TableCell): void;
|
|
102
|
+
getRowByIndex(index: number): TableRow;
|
|
103
|
+
findRowIndexBySourceNode(sourceNode: Node): number;
|
|
104
|
+
addCellFragment(rowIndex: number, columnIndex: number, cellFragment: TableCellFragment): void;
|
|
105
|
+
getCellsFallingOnRow(rowIndex: number): TableCell[];
|
|
106
|
+
getRowSpanningCellsOverflowingTheRow(rowIndex: number): TableCell[];
|
|
107
|
+
getCellFragmentOfCell(cell: TableCell): TableCellFragment;
|
|
108
|
+
isFreelyFragmentableRow(row: TableRow): boolean;
|
|
109
|
+
getColumnCount(): number;
|
|
110
|
+
updateCellSizes(clientLayout: Vtree.ClientLayout): void;
|
|
111
|
+
/**
|
|
112
|
+
* @return position
|
|
113
|
+
*/
|
|
114
|
+
findCellFromColumn(column: Layout.Column): {
|
|
115
|
+
rowIndex: number;
|
|
116
|
+
columnIndex: number;
|
|
117
|
+
} | null;
|
|
118
|
+
collectElementsOffsetOfUpperCells(position: {
|
|
119
|
+
rowIndex: number;
|
|
120
|
+
columnIndex: number;
|
|
121
|
+
} | null): RepetitiveElement.ElementsOffset[];
|
|
122
|
+
collectElementsOffsetOfHighestColumn(): RepetitiveElement.ElementsOffset[];
|
|
123
|
+
private collectElementsOffsetFromColumn;
|
|
124
|
+
saveState(): any;
|
|
125
|
+
restoreState(state: any): void;
|
|
126
|
+
}
|
|
127
|
+
export declare class ElementsOffsetOfTableCell implements RepetitiveElement.ElementsOffset {
|
|
128
|
+
readonly repeatitiveElementsInColumns: RepetitiveElement.ElementsOffset[][];
|
|
129
|
+
constructor(repeatitiveElementsInColumns: RepetitiveElement.ElementsOffset[][]);
|
|
130
|
+
/** @override */
|
|
131
|
+
calculateOffset(nodeContext: Vtree.NodeContext): number;
|
|
132
|
+
/** @override */
|
|
133
|
+
calculateMinimumOffset(nodeContext: Vtree.NodeContext): number;
|
|
134
|
+
private calculateMaxOffsetOfColumn;
|
|
135
|
+
}
|
|
136
|
+
export declare class EntireTableLayoutStrategy extends LayoutUtil.EdgeSkipper {
|
|
137
|
+
readonly formattingContext: TableFormattingContext;
|
|
138
|
+
readonly column: Layout.Column;
|
|
139
|
+
rowIndex: number;
|
|
140
|
+
columnIndex: number;
|
|
141
|
+
inRow: boolean;
|
|
142
|
+
checkPoints: Vtree.NodeContext[];
|
|
143
|
+
inHeaderOrFooter: boolean;
|
|
144
|
+
constructor(formattingContext: TableFormattingContext, column: Layout.Column);
|
|
145
|
+
startNonInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
146
|
+
afterNonInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
147
|
+
startNonElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
148
|
+
afterNonElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
149
|
+
startInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
150
|
+
afterInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
151
|
+
registerCheckPoint(state: LayoutUtil.LayoutIteratorState): void;
|
|
152
|
+
postLayoutBlockContents(state: LayoutUtil.LayoutIteratorState): void;
|
|
153
|
+
}
|
|
154
|
+
export declare class TableLayoutStrategy extends LayoutUtil.EdgeSkipper {
|
|
155
|
+
readonly formattingContext: TableFormattingContext;
|
|
156
|
+
readonly column: Layout.Column;
|
|
157
|
+
private static ignoreList;
|
|
158
|
+
inRow: boolean;
|
|
159
|
+
currentRowIndex: number;
|
|
160
|
+
currentColumnIndex: number;
|
|
161
|
+
originalStopAtOverflow: boolean;
|
|
162
|
+
inHeader: boolean;
|
|
163
|
+
inFooter: boolean;
|
|
164
|
+
constructor(formattingContext: TableFormattingContext, column: Layout.Column);
|
|
165
|
+
resetColumn(): void;
|
|
166
|
+
getColSpanningCellWidth(cell: TableCell): number;
|
|
167
|
+
layoutCell(cell: TableCell, cellNodeContext: Vtree.NodeContext, startChunkPosition: Vtree.ChunkPosition): Task.Result<boolean>;
|
|
168
|
+
hasBrokenCellAtSlot(slotIndex: any): boolean;
|
|
169
|
+
private extractRowSpanningCellBreakPositions;
|
|
170
|
+
layoutRowSpanningCellsFromPreviousFragment(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
171
|
+
startTableRow(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
172
|
+
private registerCellFragmentIndex;
|
|
173
|
+
startTableCell(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
174
|
+
startNonInlineBox(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
175
|
+
endNonInlineBox(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
176
|
+
afterNonInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
177
|
+
}
|
|
178
|
+
export declare class TableLayoutProcessor implements LayoutProcessor.LayoutProcessor {
|
|
179
|
+
private layoutEntireTable;
|
|
180
|
+
private getColumnWidths;
|
|
181
|
+
private getColGroupElements;
|
|
182
|
+
private normalizeAndGetColElements;
|
|
183
|
+
private addMissingColElements;
|
|
184
|
+
/**
|
|
185
|
+
* Measure width of columns and normalize colgroup and col elements so that
|
|
186
|
+
* each column has a corresponding col element with the width specified.
|
|
187
|
+
*/
|
|
188
|
+
normalizeColGroups(formattingContext: TableFormattingContext, tableElement: Element, column: Layout.Column): void;
|
|
189
|
+
doInitialLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
190
|
+
addCaptions(formattingContext: TableFormattingContext, rootViewNode: Element, firstChild: Node | null): void;
|
|
191
|
+
addColGroups(formattingContext: TableFormattingContext, rootViewNode: Element, firstChild: Node | null): void;
|
|
192
|
+
removeColGroups(formattingContext: TableFormattingContext, rootViewNode: Element): void;
|
|
193
|
+
doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
194
|
+
/** @override */
|
|
195
|
+
layout(nodeContext: Vtree.NodeContext, column: Layout.Column, leadingEdge: boolean): Task.Result<Vtree.NodeContext>;
|
|
196
|
+
/** @override */
|
|
197
|
+
createEdgeBreakPosition(position: Vtree.NodeContext, breakOnEdge: string | null, overflows: boolean, columnBlockSize: number): LayoutType.BreakPosition;
|
|
198
|
+
/** @override */
|
|
199
|
+
startNonInlineElementNode(nodeContext: Vtree.NodeContext): boolean;
|
|
200
|
+
/** @override */
|
|
201
|
+
afterNonInlineElementNode(nodeContext: Vtree.NodeContext, stopAtOverflow: boolean): boolean;
|
|
202
|
+
/** @override */
|
|
203
|
+
finishBreak(column: Layout.Column, nodeContext: Vtree.NodeContext, forceRemoveSelf: boolean, endOfColumn: boolean): Task.Result<boolean>;
|
|
204
|
+
/** @override */
|
|
205
|
+
clearOverflownViewNodes(column: Layout.Column, parentNodeContext: Vtree.NodeContext, nodeContext: Vtree.NodeContext, removeSelf: boolean): void;
|
|
206
|
+
}
|
|
207
|
+
export declare class LayoutRetryer extends LayoutRetryers.AbstractLayoutRetryer {
|
|
208
|
+
private tableFormattingContext;
|
|
209
|
+
private readonly processor;
|
|
210
|
+
constructor(tableFormattingContext: TableFormattingContext, processor: TableLayoutProcessor);
|
|
211
|
+
resolveLayoutMode(nodeContext: Vtree.NodeContext): LayoutType.LayoutMode;
|
|
212
|
+
clearNodes(initialPosition: Vtree.NodeContext): void;
|
|
213
|
+
restoreState(nodeContext: Vtree.NodeContext, column: Layout.Column): void;
|
|
214
|
+
}
|
|
215
|
+
export declare class LayoutEntireTable extends RepetitiveElementImpl.LayoutEntireBlock {
|
|
216
|
+
readonly processor: TableLayoutProcessor;
|
|
217
|
+
constructor(formattingContext: TableFormattingContext, processor: TableLayoutProcessor);
|
|
218
|
+
doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
219
|
+
}
|
|
220
|
+
export declare class EntireTableBreakPosition extends BreakPosition.EdgeBreakPosition {
|
|
221
|
+
constructor(tableNodeContext: Vtree.NodeContext);
|
|
222
|
+
getMinBreakPenalty(): number;
|
|
223
|
+
breakPositionChosen(column: Layout.Column): void;
|
|
224
|
+
}
|
|
225
|
+
export declare class EntireTableLayoutConstraint implements Layout.FragmentLayoutConstraint {
|
|
226
|
+
tableRootNode: Node;
|
|
227
|
+
flagmentLayoutConstraintType: FragmentLayoutConstraintType;
|
|
228
|
+
constructor(tableRootNode: Node);
|
|
229
|
+
/** @override */
|
|
230
|
+
allowLayout(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, column: Layout.Column): boolean;
|
|
231
|
+
/** @override */
|
|
232
|
+
nextCandidate(nodeContext: Vtree.NodeContext): boolean;
|
|
233
|
+
/** @override */
|
|
234
|
+
postLayout(allowed: boolean, positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Layout.Column): void;
|
|
235
|
+
/** @override */
|
|
236
|
+
finishBreak(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<boolean>;
|
|
237
|
+
/** @override */
|
|
238
|
+
equalsTo(constraint: Layout.FragmentLayoutConstraint): boolean;
|
|
239
|
+
/** @override */
|
|
240
|
+
getPriorityOfFinishBreak(): number;
|
|
241
|
+
}
|
|
242
|
+
export declare class LayoutFragmentedTable extends RepetitiveElementImpl.LayoutFragmentedBlock {
|
|
243
|
+
readonly processor: TableLayoutProcessor;
|
|
244
|
+
constructor(formattingContext: TableFormattingContext, processor: TableLayoutProcessor);
|
|
245
|
+
doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
246
|
+
}
|
|
247
|
+
export declare class TableRowLayoutConstraint extends RepetitiveElementImpl.RepetitiveElementsOwnerLayoutConstraint implements Table.TableRowLayoutConstraint {
|
|
248
|
+
flagmentLayoutConstraintType: FragmentLayoutConstraintType;
|
|
249
|
+
cellFragmentLayoutConstraints: {
|
|
250
|
+
constraints: Layout.FragmentLayoutConstraint[];
|
|
251
|
+
breakPosition: Vtree.NodeContext;
|
|
252
|
+
}[];
|
|
253
|
+
constructor(nodeContext: Vtree.NodeContext);
|
|
254
|
+
allowLayout(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, column: Layout.Column): boolean;
|
|
255
|
+
nextCandidate(nodeContext: Vtree.NodeContext): boolean;
|
|
256
|
+
postLayout(allowed: boolean, positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Layout.Column): void;
|
|
257
|
+
finishBreak(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<boolean>;
|
|
258
|
+
removeDummyRowNodes(nodeContext: Vtree.NodeContext): void;
|
|
259
|
+
private collectCellFragmentLayoutConstraints;
|
|
260
|
+
private getCellFragemnts;
|
|
261
|
+
getElementsOffsetsForTableCell(column: Layout.Column): RepetitiveElement.ElementsOffset[];
|
|
262
|
+
equalsTo(constraint: Layout.FragmentLayoutConstraint): boolean;
|
|
263
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import * as Task from "./task";
|
|
2
|
-
/**
|
|
3
|
-
* A class that can fetch or compute a resource that may be needed by multiple
|
|
4
|
-
* tasks. The first time a resource is requested, it is fetched and then given
|
|
5
|
-
* to everyone requesting it.
|
|
6
|
-
* @template T
|
|
7
|
-
* @param fetch function that fetches/computes
|
|
8
|
-
* a resource; it will be run in a separate task.
|
|
9
|
-
*/
|
|
10
|
-
export declare class Fetcher<T> {
|
|
11
|
-
readonly fetch: () => Task.Result<T>;
|
|
12
|
-
name: string;
|
|
13
|
-
arrived: boolean;
|
|
14
|
-
resource: T;
|
|
15
|
-
task: Task.Task;
|
|
16
|
-
piggybacks: ((p1: any) => void)[] | null;
|
|
17
|
-
constructor(fetch: () => Task.Result<T>, opt_name?: string);
|
|
18
|
-
/**
|
|
19
|
-
* Start fetching/computing a resource, don't block current task.
|
|
20
|
-
*/
|
|
21
|
-
start(): void;
|
|
22
|
-
piggyback(fn: (p1: T) => void): void;
|
|
23
|
-
/**
|
|
24
|
-
* Fetches the resource, waits for it to arrive if it is already being
|
|
25
|
-
* fetched.
|
|
26
|
-
*/
|
|
27
|
-
get(): Task.Result<T>;
|
|
28
|
-
hasArrived(): boolean;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Wait for all Fetcher objects in the array to arrive
|
|
32
|
-
*/
|
|
33
|
-
export declare const waitForFetchers: <T>(fetchers: Fetcher<T>[]) => Task.Result<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* @return holding event type (load/error/abort)
|
|
36
|
-
*/
|
|
37
|
-
export declare function loadElement(elem: Element, src?: string): Fetcher<string>;
|
|
1
|
+
import * as Task from "./task";
|
|
2
|
+
/**
|
|
3
|
+
* A class that can fetch or compute a resource that may be needed by multiple
|
|
4
|
+
* tasks. The first time a resource is requested, it is fetched and then given
|
|
5
|
+
* to everyone requesting it.
|
|
6
|
+
* @template T
|
|
7
|
+
* @param fetch function that fetches/computes
|
|
8
|
+
* a resource; it will be run in a separate task.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Fetcher<T> {
|
|
11
|
+
readonly fetch: () => Task.Result<T>;
|
|
12
|
+
name: string;
|
|
13
|
+
arrived: boolean;
|
|
14
|
+
resource: T;
|
|
15
|
+
task: Task.Task;
|
|
16
|
+
piggybacks: ((p1: any) => void)[] | null;
|
|
17
|
+
constructor(fetch: () => Task.Result<T>, opt_name?: string);
|
|
18
|
+
/**
|
|
19
|
+
* Start fetching/computing a resource, don't block current task.
|
|
20
|
+
*/
|
|
21
|
+
start(): void;
|
|
22
|
+
piggyback(fn: (p1: T) => void): void;
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the resource, waits for it to arrive if it is already being
|
|
25
|
+
* fetched.
|
|
26
|
+
*/
|
|
27
|
+
get(): Task.Result<T>;
|
|
28
|
+
hasArrived(): boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Wait for all Fetcher objects in the array to arrive
|
|
32
|
+
*/
|
|
33
|
+
export declare const waitForFetchers: <T>(fetchers: Fetcher<T>[]) => Task.Result<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* @return holding event type (load/error/abort)
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadElement(elem: Element, src?: string): Fetcher<string>;
|