@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.
Files changed (63) hide show
  1. package/lib/vivliostyle/adaptive-viewer.d.ts +167 -167
  2. package/lib/vivliostyle/asserts.d.ts +21 -21
  3. package/lib/vivliostyle/assets.d.ts +35 -35
  4. package/lib/vivliostyle/base.d.ts +189 -189
  5. package/lib/vivliostyle/break-position.d.ts +39 -39
  6. package/lib/vivliostyle/break.d.ts +112 -112
  7. package/lib/vivliostyle/cfi.d.ts +77 -77
  8. package/lib/vivliostyle/columns.d.ts +52 -52
  9. package/lib/vivliostyle/constants.d.ts +53 -53
  10. package/lib/vivliostyle/core-viewer.d.ts +240 -240
  11. package/lib/vivliostyle/counters.d.ts +127 -127
  12. package/lib/vivliostyle/css-cascade.d.ts +974 -954
  13. package/lib/vivliostyle/css-logical-util.d.ts +3 -3
  14. package/lib/vivliostyle/css-page.d.ts +451 -451
  15. package/lib/vivliostyle/css-parser.d.ts +320 -320
  16. package/lib/vivliostyle/css-prop.d.ts +74 -74
  17. package/lib/vivliostyle/css-styler.d.ts +210 -210
  18. package/lib/vivliostyle/css-tokenizer.d.ts +243 -243
  19. package/lib/vivliostyle/css-validator.d.ts +319 -319
  20. package/lib/vivliostyle/css.d.ts +205 -205
  21. package/lib/vivliostyle/diff.d.ts +26 -26
  22. package/lib/vivliostyle/display.d.ts +62 -57
  23. package/lib/vivliostyle/epub.d.ts +329 -329
  24. package/lib/vivliostyle/exprs.d.ts +395 -395
  25. package/lib/vivliostyle/font.d.ts +87 -87
  26. package/lib/vivliostyle/footnotes.d.ts +41 -41
  27. package/lib/vivliostyle/geometry-util.d.ts +110 -110
  28. package/lib/vivliostyle/layout-helper.d.ts +16 -15
  29. package/lib/vivliostyle/layout-processor.d.ts +73 -73
  30. package/lib/vivliostyle/layout-retryers.d.ts +21 -21
  31. package/lib/vivliostyle/layout-util.d.ts +55 -55
  32. package/lib/vivliostyle/layout.d.ts +456 -456
  33. package/lib/vivliostyle/logging.d.ts +56 -56
  34. package/lib/vivliostyle/matchers.d.ts +36 -36
  35. package/lib/vivliostyle/math-util.d.ts +22 -22
  36. package/lib/vivliostyle/net.d.ts +72 -72
  37. package/lib/vivliostyle/ops.d.ts +263 -263
  38. package/lib/vivliostyle/page-floats.d.ts +178 -178
  39. package/lib/vivliostyle/page-master.d.ts +247 -247
  40. package/lib/vivliostyle/plugin.d.ts +172 -172
  41. package/lib/vivliostyle/print.d.ts +7 -7
  42. package/lib/vivliostyle/profile.d.ts +59 -59
  43. package/lib/vivliostyle/pseudo-element.d.ts +32 -32
  44. package/lib/vivliostyle/repetitive-element.d.ts +162 -162
  45. package/lib/vivliostyle/scripts.d.ts +15 -15
  46. package/lib/vivliostyle/sha1.d.ts +33 -33
  47. package/lib/vivliostyle/shared.d.ts +24 -24
  48. package/lib/vivliostyle/sizing.d.ts +29 -29
  49. package/lib/vivliostyle/table.d.ts +263 -263
  50. package/lib/vivliostyle/task-util.d.ts +37 -37
  51. package/lib/vivliostyle/task.d.ts +357 -357
  52. package/lib/vivliostyle/text-polyfill.d.ts +3 -3
  53. package/lib/vivliostyle/toc.d.ts +64 -64
  54. package/lib/vivliostyle/types.d.ts +977 -977
  55. package/lib/vivliostyle/urls.d.ts +25 -25
  56. package/lib/vivliostyle/vgen.d.ts +213 -213
  57. package/lib/vivliostyle/viewer-app.d.ts +19 -19
  58. package/lib/vivliostyle/vtree.d.ts +392 -392
  59. package/lib/vivliostyle/xml-doc.d.ts +88 -88
  60. package/lib/vivliostyle.d.ts +6 -6
  61. package/lib/vivliostyle.js +1 -1
  62. package/lib/vivliostyle.js.map +1 -1
  63. package/package.json +5 -5
@@ -1,977 +1,977 @@
1
- /**
2
- * Copyright 2019 Vivliostyle Foundation
3
- *
4
- * Vivliostyle.js is free software: you can redistribute it and/or modify
5
- * it under the terms of the GNU Affero General Public License as published by
6
- * the Free Software Foundation, either version 3 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * Vivliostyle.js is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU Affero General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU Affero General Public License
15
- * along with Vivliostyle.js. If not, see <http://www.gnu.org/licenses/>.
16
- *
17
- * @fileoverview Types - Type definiions.
18
- */
19
- import * as Base from "./base";
20
- import * as Css from "./css";
21
- import * as Diff from "./diff";
22
- import * as Exprs from "./exprs";
23
- import * as GeometryUtil from "./geometry-util";
24
- import * as Task from "./task";
25
- import * as TaskUtil from "./task-util";
26
- export type FormattingContextType = "Block" | "RepetitiveElementsOwner" | "Table";
27
- export type FragmentLayoutConstraintType = "AfterIfContinue" | "EntireTable" | "RepetitiveElementsOwner" | "TableRow";
28
- export declare namespace CssCascade {
29
- type ElementStyle = {
30
- [key: string]: any;
31
- };
32
- }
33
- export declare namespace CssStyler {
34
- interface AbstractStyler {
35
- getStyle(element: Element, deep: boolean): CssCascade.ElementStyle;
36
- processContent(element: Element, styles: {
37
- [key: string]: Css.Val;
38
- }, viewNode: Node): any;
39
- }
40
- }
41
- export declare namespace Layout {
42
- /**
43
- * Represents a constraint on layout
44
- */
45
- interface LayoutConstraint {
46
- /**
47
- * Returns if this constraint allows the node context to be laid out at the
48
- * current position.
49
- */
50
- allowLayout(nodeContext: Vtree.NodeContext): boolean;
51
- }
52
- /**
53
- * Represents constraints on laying out fragments
54
- */
55
- interface FragmentLayoutConstraint {
56
- flagmentLayoutConstraintType: FragmentLayoutConstraintType;
57
- allowLayout(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, column: Column): boolean;
58
- nextCandidate(nodeContext: Vtree.NodeContext): boolean;
59
- postLayout(allowed: boolean, positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Column): any;
60
- finishBreak(nodeContext: Vtree.NodeContext, column: Column): Task.Result<boolean>;
61
- equalsTo(constraint: FragmentLayoutConstraint): boolean;
62
- getPriorityOfFinishBreak(): number;
63
- }
64
- /**
65
- * Potential breaking position.
66
- */
67
- interface BreakPosition {
68
- /**
69
- * @return break position, if found
70
- */
71
- findAcceptableBreak(column: Column, penalty: number): Vtree.NodeContext;
72
- /**
73
- * @return penalty for this break position
74
- */
75
- getMinBreakPenalty(): number;
76
- calculateOffset(column: Column): {
77
- current: number;
78
- minimum: number;
79
- };
80
- breakPositionChosen(column: Column): void;
81
- }
82
- interface AbstractBreakPosition extends BreakPosition {
83
- getNodeContext(): Vtree.NodeContext;
84
- }
85
- type BreakPositionAndNodeContext = {
86
- breakPosition: BreakPosition;
87
- nodeContext: Vtree.NodeContext;
88
- };
89
- /**
90
- * Potential breaking position inside CSS box (between lines).
91
- * @param checkPoints array of breaking points for
92
- * breakable block
93
- */
94
- interface BoxBreakPosition extends AbstractBreakPosition {
95
- breakNodeContext: Vtree.NodeContext;
96
- readonly checkPoints: Vtree.NodeContext[];
97
- readonly penalty: number;
98
- }
99
- /**
100
- * Potential edge breaking position.
101
- */
102
- interface EdgeBreakPosition extends AbstractBreakPosition {
103
- overflowIfRepetitiveElementsDropped: boolean;
104
- readonly position: Vtree.NodeContext;
105
- readonly breakOnEdge: string | null;
106
- overflows: boolean;
107
- readonly computedBlockSize: number;
108
- }
109
- interface Column extends Vtree.Container {
110
- last: Node;
111
- viewDocument: Document;
112
- flowRootFormattingContext: Vtree.FormattingContext;
113
- isFloat: boolean;
114
- isFootnote: boolean;
115
- startEdge: number;
116
- endEdge: number;
117
- beforeEdge: number;
118
- afterEdge: number;
119
- footnoteEdge: number;
120
- box: GeometryUtil.Rect;
121
- chunkPositions: Vtree.ChunkPosition[];
122
- bands: GeometryUtil.Band[];
123
- overflown: boolean;
124
- breakPositions: BreakPosition[];
125
- pageBreakType: string | null;
126
- forceNonfitting: boolean;
127
- leftFloatEdge: number;
128
- /**
129
- * bottom of the bottommost left float
130
- */
131
- rightFloatEdge: number;
132
- /**
133
- * bottom of the bottommost right float
134
- */
135
- bottommostFloatTop: number;
136
- /**
137
- * Top of the bottommost float
138
- */
139
- stopAtOverflow: boolean;
140
- lastAfterPosition: Vtree.NodePosition | null;
141
- fragmentLayoutConstraints: FragmentLayoutConstraint[];
142
- pseudoParent: Column;
143
- nodeContextOverflowingDueToRepetitiveElements: Vtree.NodeContext | null;
144
- blockDistanceToBlockEndFloats: number;
145
- computedBlockSize: number;
146
- layoutContext: Vtree.LayoutContext;
147
- clientLayout: Vtree.ClientLayout;
148
- readonly layoutConstraint: LayoutConstraint;
149
- readonly pageFloatLayoutContext: PageFloats.PageFloatLayoutContext;
150
- getTopEdge(): number;
151
- getBottomEdge(): number;
152
- getLeftEdge(): number;
153
- getRightEdge(): number;
154
- isFloatNodeContext(nodeContext: Vtree.NodeContext): boolean;
155
- stopByOverflow(nodeContext: Vtree.NodeContext): boolean;
156
- isOverflown(edge: number): boolean;
157
- getExclusions(): GeometryUtil.Shape[];
158
- openAllViews(position: Vtree.NodePosition): Task.Result<Vtree.NodeContext>;
159
- calculateOffsetInNodeForNodeContext(position: Vtree.NodePosition): number;
160
- /**
161
- * @param count first-XXX nesting identifier
162
- */
163
- maybePeelOff(position: Vtree.NodeContext, count: number): Task.Result<Vtree.NodeContext>;
164
- /**
165
- * Builds the view until a CSS box edge is reached.
166
- * @param position start source position.
167
- * @param checkPoints array to append possible breaking points.
168
- * @return holding box edge position reached or null if the source is exhausted.
169
- */
170
- buildViewToNextBlockEdge(position: Vtree.NodeContext, checkPoints: Vtree.NodeContext[]): Task.Result<Vtree.NodeContext>;
171
- nextInTree(position: Vtree.NodeContext, atUnforcedBreak?: boolean): Task.Result<Vtree.NodeContext>;
172
- /**
173
- * Builds the view for a single unbreakable element.
174
- * @param position start source position.
175
- * @return holding box edge position reached or null if the source is exhausted.
176
- */
177
- buildDeepElementView(position: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
178
- /**
179
- * Create a single floating element (for exclusion areas).
180
- * @param ref container's child to insert float before (can be null).
181
- * @param side float side ("left" or "right").
182
- * @param width float inline dimension.
183
- * @param height float box progression dimension.
184
- * @return newly created float element.
185
- */
186
- createFloat(ref: Node, side: string, width: number, height: number): Element;
187
- /**
188
- * Remove all the exclusion floats.
189
- */
190
- killFloats(): void;
191
- /**
192
- * Create exclusion floats for a column.
193
- */
194
- createFloats(): void;
195
- /**
196
- * @param nodeContext position after the block
197
- * @param checkPoints array of possible breaking points.
198
- * @param index index of the breaking point
199
- * @param boxOffset box offset
200
- * @return edge position
201
- */
202
- calculateEdge(nodeContext: Vtree.NodeContext, checkPoints: Vtree.NodeContext[], index: number, boxOffset: number): number;
203
- /**
204
- * Parse CSS computed length (in pixels)
205
- * @param val CSS length in "px" units or a number.
206
- * @return value in pixels or 0 if not parsable
207
- */
208
- parseComputedLength(val: string | number): number;
209
- /**
210
- * Reads element's computed CSS margin.
211
- */
212
- getComputedMargin(element: Element): GeometryUtil.Insets;
213
- /**
214
- * Reads element's computed padding + borders.
215
- */
216
- getComputedPaddingBorder(element: Element): GeometryUtil.Insets;
217
- /**
218
- * Reads element's computed CSS insets(margins + border + padding or margins :
219
- * depends on box-sizing)
220
- */
221
- getComputedInsets(element: Element): GeometryUtil.Insets;
222
- /**
223
- * Set element's computed CSS insets to Column Container
224
- */
225
- setComputedInsets(element: Element, container: Column): void;
226
- /**
227
- * Set element's computed width and height to Column Container
228
- */
229
- setComputedWidthAndHeight(element: Element, container: Column): void;
230
- /**
231
- * Layout a single unbreakable element.
232
- */
233
- layoutUnbreakable(nodeContextIn: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
234
- /**
235
- * Layout a single float element.
236
- */
237
- layoutFloat(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
238
- setupFloatArea(area: PageFloatArea, floatReference: PageFloats.FloatReference, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): boolean;
239
- createPageFloatArea(float: PageFloats.PageFloat | null, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): PageFloatArea | null;
240
- layoutSinglePageFloatFragment(continuations: PageFloats.PageFloatContinuation[], floatSide: string, clearSide: string | null, allowFragmented: boolean, strategy: PageFloats.PageFloatLayoutStrategy, anchorEdge: number | null, pageFloatFragment?: PageFloats.PageFloatFragment | null): Task.Result<SinglePageFloatLayoutResult>;
241
- layoutPageFloatInner(continuation: PageFloats.PageFloatContinuation, strategy: PageFloats.PageFloatLayoutStrategy, anchorEdge: number | null, pageFloatFragment?: PageFloats.PageFloatFragment): Task.Result<boolean>;
242
- setFloatAnchorViewNode(nodeContext: Vtree.NodeContext): Vtree.NodeContext;
243
- resolveFloatReferenceFromColumnSpan(floatReference: PageFloats.FloatReference, columnSpan: Css.Val, nodeContext: Vtree.NodeContext): Task.Result<PageFloats.FloatReference>;
244
- layoutPageFloat(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
245
- processLineStyling(nodeContext: Vtree.NodeContext, resNodeContext: Vtree.NodeContext, checkPoints: Vtree.NodeContext[]): Task.Result<Vtree.NodeContext>;
246
- isLoneImage(checkPoints: Vtree.NodeContext[]): boolean;
247
- getTrailingMarginEdgeAdjustment(trailingEdgeContexts: Vtree.NodeContext[]): number;
248
- /**
249
- * Layout a single CSS box.
250
- */
251
- layoutBreakableBlock(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
252
- postLayoutBlock(nodeContext: Vtree.NodeContext, checkPoints: Vtree.NodeContext[]): void;
253
- findEndOfLine(linePosition: number, checkPoints: Vtree.NodeContext[], isUpdateMaxReachedAfterEdge: boolean): {
254
- nodeContext: Vtree.NodeContext;
255
- index: number;
256
- checkPointIndex: number;
257
- };
258
- findAcceptableBreakInside(checkPoints: Vtree.NodeContext[], edgePosition: number, force: boolean): Vtree.NodeContext;
259
- resolveTextNodeBreaker(nodeContext: Vtree.NodeContext): TextNodeBreaker;
260
- /**
261
- * Read ranges skipping special elments
262
- */
263
- getRangeBoxes(start: Node, end: Node): Vtree.ClientRect[];
264
- /**
265
- * Give block's initial and final nodes, find positions of the line bottoms.
266
- * This is, of course, somewhat hacky implementation.
267
- * @return position of line breaks
268
- */
269
- findLinePositions(checkPoints: Vtree.NodeContext[]): number[];
270
- calculateClonedPaddingBorder(nodeContext: Vtree.NodeContext): number;
271
- findBoxBreakPosition(bp: BoxBreakPosition, force: boolean): Vtree.NodeContext;
272
- getAfterEdgeOfBlockContainer(nodeContext: Vtree.NodeContext): number;
273
- findFirstOverflowingEdgeAndCheckPoint(checkPoints: Vtree.NodeContext[]): {
274
- edge: number;
275
- checkPoint: Vtree.NodeContext | null;
276
- };
277
- findEdgeBreakPosition(bp: EdgeBreakPosition): Vtree.NodeContext;
278
- /**
279
- * Finalize a line break.
280
- * @return holing true
281
- */
282
- finishBreak(nodeContext: Vtree.NodeContext, forceRemoveSelf: boolean, endOfColumn: boolean): Task.Result<boolean>;
283
- findAcceptableBreakPosition(): BreakPositionAndNodeContext;
284
- doFinishBreak(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, initialNodeContext: Vtree.NodeContext, initialComputedBlockSize: number): Task.Result<Vtree.NodeContext>;
285
- /**
286
- * Determines if a page break is acceptable at this position
287
- */
288
- isBreakable(flowPosition: Vtree.NodeContext): boolean;
289
- /**
290
- * Determines if an indent value is zero
291
- */
292
- zeroIndent(val: string | number): boolean;
293
- /**
294
- * @return true if overflows
295
- */
296
- checkOverflowAndSaveEdge(nodeContext: Vtree.NodeContext, trailingEdgeContexts: Vtree.NodeContext[]): boolean;
297
- /**
298
- * Save a possible page break position on a CSS block edge. Check if it
299
- * overflows.
300
- * @return true if overflows
301
- */
302
- checkOverflowAndSaveEdgeAndBreakPosition(nodeContext: Vtree.NodeContext, trailingEdgeContexts: Vtree.NodeContext[], saveEvenOverflown: boolean, breakAtTheEdge: string | null): boolean;
303
- applyClearance(nodeContext: Vtree.NodeContext): boolean;
304
- isBFC(formattingContext: Vtree.FormattingContext): boolean;
305
- /**
306
- * Skips positions until either the start of unbreakable block or inline
307
- * content. Also sets breakBefore on the result combining break-before and
308
- * break-after properties from all elements that meet at the edge.
309
- */
310
- skipEdges(nodeContext: Vtree.NodeContext, leadingEdge: boolean, forcedBreakValue: string | null): Task.Result<Vtree.NodeContext>;
311
- /**
312
- * Skips non-renderable positions until it hits the end of the flow or some
313
- * renderable content. Returns the nodeContext that was passed in if some
314
- * content remains and null if all content could be skipped.
315
- */
316
- skipTailEdges(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
317
- layoutFloatOrFootnote(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
318
- /**
319
- * Layout next portion of the source.
320
- */
321
- layoutNext(nodeContext: Vtree.NodeContext, leadingEdge: boolean, forcedBreakValue?: string | null): Task.Result<Vtree.NodeContext>;
322
- clearOverflownViewNodes(nodeContext: Vtree.NodeContext, removeSelf: boolean): void;
323
- initGeom(): void;
324
- init(): void;
325
- /**
326
- * Save the potential breaking position at the edge. Should, in general, save
327
- * "after" position but only after skipping all of the "before" ones and
328
- * getting to the non-empty content (to get breakAtEdge right).
329
- */
330
- saveEdgeBreakPosition(position: Vtree.NodeContext, breakAtEdge: string | null, overflows: boolean): void;
331
- /**
332
- * @param checkPoints array of breaking points for breakable block
333
- */
334
- saveBoxBreakPosition(checkPoints: Vtree.NodeContext[]): void;
335
- updateMaxReachedAfterEdge(afterEdge: number): void;
336
- /**
337
- * @param chunkPosition starting position.
338
- * @return holding end position.
339
- */
340
- layout(chunkPosition: Vtree.ChunkPosition, leadingEdge: boolean, breakAfter?: string | null): Task.Result<Vtree.ChunkPosition>;
341
- isFullWithPageFloats(): boolean;
342
- getMaxBlockSizeOfPageFloats(): number;
343
- doFinishBreakOfFragmentLayoutConstraints(nodeContext: any): void;
344
- /**
345
- * @param nodeContext starting position.
346
- * @return holding end position.
347
- */
348
- doLayout(nodeContext: Vtree.NodeContext, leadingEdge: boolean, breakAfter?: string | null): Task.Result<{
349
- nodeContext: Vtree.NodeContext;
350
- overflownNodeContext: Vtree.NodeContext;
351
- }>;
352
- /**
353
- * Re-layout already laid-out chunks. Return the position of the last flow if
354
- * there is an overflow.
355
- * TODO: deal with chunks that did not fit at all.
356
- * @return holding end position.
357
- */
358
- redoLayout(): Task.Result<Vtree.ChunkPosition>;
359
- saveDistanceToBlockEndFloats(): void;
360
- collectElementsOffset(): RepetitiveElement.ElementsOffset[];
361
- }
362
- type SinglePageFloatLayoutResult = {
363
- floatArea: PageFloatArea | null;
364
- pageFloatFragment: PageFloats.PageFloatFragment | null;
365
- newPosition: Vtree.ChunkPosition | null;
366
- };
367
- /**
368
- * breaking point resolver for Text Node.
369
- */
370
- interface TextNodeBreaker {
371
- breakTextNode(textNode: Text, nodeContext: Vtree.NodeContext, low: number, checkPoints: Vtree.NodeContext[], checkpointIndex: number, force: boolean): Vtree.NodeContext;
372
- breakAfterSoftHyphen(textNode: Text, text: string, viewIndex: number, nodeContext: Vtree.NodeContext): number;
373
- breakAfterOtherCharacter(textNode: Text, text: string, viewIndex: number, nodeContext: Vtree.NodeContext): number;
374
- updateNodeContext(nodeContext: Vtree.NodeContext, viewIndex: number, textNode: Text): Vtree.NodeContext;
375
- }
376
- interface LayoutMode {
377
- doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
378
- accept(nodeContext: Vtree.NodeContext, column: Layout.Column): boolean;
379
- postLayout(positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Layout.Column, accepted: boolean): boolean;
380
- }
381
- interface PageFloatArea extends Column {
382
- adjustContentRelativeSize: boolean;
383
- readonly floatSide: string;
384
- readonly parentContainer: Vtree.Container;
385
- convertPercentageSizesToPx(target: Element): void;
386
- fixFloatSizeAndPosition(nodeContext: Vtree.NodeContext): void;
387
- getContentInlineSize(): number;
388
- }
389
- }
390
- export declare namespace LayoutProcessor {
391
- interface BlockFormattingContext extends Vtree.FormattingContext {
392
- }
393
- function isInstanceOfBlockFormattingContext(object: Vtree.FormattingContext): object is BlockFormattingContext;
394
- }
395
- export declare namespace Net {
396
- type Response = {
397
- status: number;
398
- statusText: string | null;
399
- url: string;
400
- contentType: string | null;
401
- responseText: string | null;
402
- responseXML: Document;
403
- responseBlob: Blob;
404
- };
405
- interface ResourceStore<Resource> {
406
- resources: {
407
- [key: string]: Resource;
408
- };
409
- fetchers: {
410
- [key: string]: TaskUtil.Fetcher<Resource>;
411
- };
412
- readonly parser: (p1: Response, p2: ResourceStore<Resource>) => Task.Result<Resource>;
413
- readonly type: XMLHttpRequestResponseType;
414
- /**
415
- * @return resource for the given URL
416
- */
417
- load(url: string, opt_required?: boolean, opt_message?: string): Task.Result<Resource>;
418
- /**
419
- * @return fetcher for the resource for the given URL
420
- */
421
- fetch(url: string, opt_required?: boolean, opt_message?: string): TaskUtil.Fetcher<Resource>;
422
- get(url: string): XmlDoc.XMLDocHolder;
423
- delete(url: string): void;
424
- }
425
- }
426
- export declare namespace PageFloats {
427
- /**
428
- * @enum {string}
429
- */
430
- enum FloatReference {
431
- INLINE = "inline",
432
- COLUMN = "column",
433
- REGION = "region",
434
- PAGE = "page"
435
- }
436
- type PageFloatID = string;
437
- interface PageFloat {
438
- order: number | null;
439
- id: PageFloatID | null;
440
- readonly nodePosition: Vtree.NodePosition;
441
- readonly floatReference: FloatReference;
442
- readonly floatSide: string;
443
- readonly clearSide: string | null;
444
- readonly flowName: string;
445
- readonly floatMinWrapBlock: Css.Numeric | null;
446
- getOrder(): number;
447
- getId(): PageFloatID;
448
- isAllowedOnContext(pageFloatLayoutContext: PageFloatLayoutContext): boolean;
449
- isAllowedToPrecede(other: PageFloat): boolean;
450
- }
451
- interface PageFloatFragment {
452
- readonly floatReference: FloatReference;
453
- readonly floatSide: string;
454
- readonly continuations: PageFloatContinuation[];
455
- readonly area: Vtree.Container;
456
- readonly continues: boolean;
457
- hasFloat(float: PageFloat): boolean;
458
- findNotAllowedFloat(context: PageFloatLayoutContext): PageFloat | null;
459
- getOuterShape(): GeometryUtil.Shape;
460
- getOuterRect(): GeometryUtil.Rect;
461
- getOrder(): number;
462
- shouldBeStashedBefore(float: PageFloat): boolean;
463
- addContinuations(continuations: PageFloatContinuation[]): void;
464
- getFlowName(): string;
465
- }
466
- interface PageFloatContinuation {
467
- readonly float: PageFloat;
468
- readonly nodePosition: Vtree.NodePosition;
469
- equals(other: PageFloatContinuation | null): boolean;
470
- }
471
- type PageFloatPlacementCondition = {
472
- [key: string]: boolean;
473
- };
474
- interface PageFloatLayoutContext {
475
- writingMode: Css.Val;
476
- direction: Css.Val;
477
- floatFragments: PageFloatFragment[];
478
- readonly parent: PageFloatLayoutContext;
479
- readonly flowName: string | null;
480
- readonly generatingNodePosition: Vtree.NodePosition | null;
481
- getContainer(floatReference?: FloatReference): Vtree.Container;
482
- setContainer(container: Vtree.Container): any;
483
- addPageFloat(float: PageFloat): void;
484
- getPageFloatLayoutContext(floatReference: FloatReference): PageFloatLayoutContext;
485
- findPageFloatByNodePosition(nodePosition: Vtree.NodePosition): PageFloat | null;
486
- isForbidden(float: PageFloat): boolean;
487
- addPageFloatFragment(floatFragment: PageFloatFragment, dontInvalidate?: boolean): void;
488
- removePageFloatFragment(floatFragment: PageFloatFragment, dontInvalidate?: boolean): void;
489
- findPageFloatFragment(float: PageFloat): PageFloatFragment | null;
490
- hasFloatFragments(condition?: (p1: PageFloatFragment) => boolean): boolean;
491
- hasContinuingFloatFragmentsInFlow(flowName: string): boolean;
492
- registerPageFloatAnchor(float: PageFloat, anchorViewNode: Node): void;
493
- collectPageFloatAnchors(): any;
494
- isAnchorAlreadyAppeared(floatId: PageFloatID): boolean;
495
- deferPageFloat(continuation: PageFloatContinuation): void;
496
- hasPrecedingFloatsDeferredToNext(float: PageFloat, ignoreReference?: boolean): boolean;
497
- getLastFollowingFloatInFragments(float: PageFloat): PageFloat | null;
498
- getDeferredPageFloatContinuations(flowName?: string | null): PageFloatContinuation[];
499
- getPageFloatContinuationsDeferredToNext(flowName?: string | null): PageFloatContinuation[];
500
- getFloatsDeferredToNextInChildContexts(): PageFloat[];
501
- checkAndForbidNotAllowedFloat(): boolean;
502
- checkAndForbidFloatFollowingDeferredFloat(): boolean;
503
- finish(): void;
504
- hasSameContainerAs(other: PageFloatLayoutContext): boolean;
505
- invalidate(): void;
506
- detachChildren(): PageFloatLayoutContext[];
507
- attachChildren(children: PageFloatLayoutContext[]): void;
508
- isInvalidated(): boolean;
509
- validate(): void;
510
- removeEndFloatFragments(floatSide: string): void;
511
- stashEndFloatFragments(float: PageFloat): void;
512
- restoreStashedFragments(floatReference: FloatReference): void;
513
- discardStashedFragments(floatReference: FloatReference): void;
514
- getStashedFloatFragments(floatReference: FloatReference): PageFloatFragment[];
515
- /**
516
- * @param anchorEdge Null indicates that the anchor is not in the current
517
- * container.
518
- * @return Logical float side (snap-block is resolved when init=false). Null
519
- * indicates that the float area does not fit inside the container
520
- */
521
- setFloatAreaDimensions(area: Layout.PageFloatArea, floatReference: FloatReference, floatSide: string, anchorEdge: number | null, init: boolean, force: boolean, condition: PageFloatPlacementCondition): string | null;
522
- getFloatFragmentExclusions(): GeometryUtil.Shape[];
523
- getMaxReachedAfterEdge(): number;
524
- getBlockStartEdgeOfBlockEndFloats(): number;
525
- getPageFloatClearEdge(clear: string, column: Layout.Column): number;
526
- getPageFloatPlacementCondition(float: PageFloat, floatSide: string, clearSide: string | null): PageFloatPlacementCondition;
527
- getLayoutConstraints(): Layout.LayoutConstraint[];
528
- addLayoutConstraint(layoutConstraint: Layout.LayoutConstraint, floatReference: FloatReference): void;
529
- getMaxBlockSizeOfPageFloats(): number;
530
- lock(): void;
531
- unlock(): void;
532
- isLocked(): boolean;
533
- }
534
- interface PageFloatLayoutStrategy {
535
- appliesToNodeContext(nodeContext: Vtree.NodeContext): boolean;
536
- appliesToFloat(float: PageFloat): boolean;
537
- createPageFloat(nodeContext: Vtree.NodeContext, pageFloatLayoutContext: PageFloatLayoutContext, column: Layout.Column): Task.Result<PageFloat>;
538
- createPageFloatFragment(continuations: PageFloatContinuation[], floatSide: string, floatArea: Layout.PageFloatArea, continues: boolean): PageFloatFragment;
539
- findPageFloatFragment(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): PageFloatFragment | null;
540
- adjustPageFloatArea(floatArea: Layout.PageFloatArea, floatContainer: Vtree.Container, column: Layout.Column): any;
541
- forbid(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): any;
542
- }
543
- }
544
- export declare namespace Selectors {
545
- interface AfterIfContinues {
546
- readonly sourceNode: Element;
547
- readonly styler: PseudoElement.PseudoelementStyler;
548
- createElement(column: Layout.Column, parentNodeContext: Vtree.NodeContext): Task.Result<Element>;
549
- }
550
- interface AfterIfContinuesLayoutConstraint extends Layout.FragmentLayoutConstraint {
551
- nodeContext: Vtree.NodeContext;
552
- afterIfContinues: AfterIfContinues;
553
- pseudoElementHeight: number;
554
- getRepetitiveElements(): AfterIfContinuesElementsOffset;
555
- }
556
- function isInstanceOfAfterIfContinuesLayoutConstraint(object: Layout.FragmentLayoutConstraint): object is AfterIfContinuesLayoutConstraint;
557
- interface AfterIfContinuesElementsOffset extends RepetitiveElement.ElementsOffset {
558
- nodeContext: Vtree.NodeContext;
559
- pseudoElementHeight: number;
560
- affectTo(nodeContext: Vtree.NodeContext): boolean;
561
- }
562
- }
563
- export declare namespace PseudoElement {
564
- interface PseudoelementStyler extends CssStyler.AbstractStyler {
565
- contentProcessed: {
566
- [key: string]: boolean;
567
- };
568
- readonly element: Element;
569
- style: CssCascade.ElementStyle;
570
- styler: CssStyler.AbstractStyler;
571
- readonly context: Exprs.Context;
572
- readonly exprContentListener: Vtree.ExprContentListener;
573
- }
574
- }
575
- export declare namespace RepetitiveElement {
576
- interface RepetitiveElementsOwnerFormattingContext extends Vtree.FormattingContext {
577
- isRoot: boolean;
578
- repetitiveElements: RepetitiveElements;
579
- readonly parent: Vtree.FormattingContext;
580
- readonly rootSourceNode: Element;
581
- getRepetitiveElements(): RepetitiveElements;
582
- getRootViewNode(position: Vtree.NodeContext): Element | null;
583
- getRootNodeContext(nodeContext: Vtree.NodeContext): Vtree.NodeContext | null;
584
- initializeRepetitiveElements(vertical: boolean): void;
585
- }
586
- function isInstanceOfRepetitiveElementsOwnerFormattingContext(object: Vtree.FormattingContext): object is RepetitiveElementsOwnerFormattingContext;
587
- interface ElementsOffset {
588
- calculateOffset(nodeContext: Vtree.NodeContext): number;
589
- calculateMinimumOffset(nodeContext: Vtree.NodeContext): number;
590
- }
591
- interface RepetitiveElements extends ElementsOffset {
592
- isSkipHeader: boolean;
593
- isSkipFooter: boolean;
594
- enableSkippingFooter: boolean;
595
- enableSkippingHeader: boolean;
596
- doneInitialLayout: boolean;
597
- firstContentSourceNode: Element | null;
598
- lastContentSourceNode: Element | null;
599
- allowInsert: boolean;
600
- allowInsertRepeatitiveElements: boolean;
601
- ownerSourceNode: Element;
602
- setHeaderNodeContext(nodeContext: Vtree.NodeContext): void;
603
- setFooterNodeContext(nodeContext: Vtree.NodeContext): void;
604
- updateHeight(column: Layout.Column): void;
605
- prepareLayoutFragment(): void;
606
- appendHeaderToFragment(rootNodeContext: Vtree.NodeContext, firstChild: Node | null, column: Layout.Column): Task.Result<boolean>;
607
- appendFooterToFragment(rootNodeContext: Vtree.NodeContext, firstChild: Node | null, column: Layout.Column): Task.Result<boolean>;
608
- appendElementToFragment(nodePosition: Vtree.NodePosition, rootNodeContext: Vtree.NodeContext, firstChild: Node | null, column: Layout.Column): Task.Result<boolean>;
609
- moveChildren(from: Element, to: Element, firstChild: Node | null): void;
610
- isAfterLastContent(nodeContext: Vtree.NodeContext): boolean;
611
- isFirstContentNode(nodeContext: Vtree.NodeContext): boolean;
612
- isEnableToUpdateState(): boolean;
613
- updateState(): void;
614
- preventSkippingHeader(): void;
615
- preventSkippingFooter(): void;
616
- isHeaderRegistered(): boolean;
617
- isFooterRegistered(): boolean;
618
- isHeaderSourceNode(node: Node): boolean;
619
- isFooterSourceNode(node: Node): boolean;
620
- }
621
- interface RepetitiveElementsOwnerLayoutConstraint extends Layout.FragmentLayoutConstraint {
622
- getRepetitiveElements(): RepetitiveElements;
623
- }
624
- function isInstanceOfRepetitiveElementsOwnerLayoutConstraint(object: Layout.FragmentLayoutConstraint): object is RepetitiveElementsOwnerLayoutConstraint;
625
- }
626
- export declare namespace Table {
627
- interface TableFormattingContext extends RepetitiveElement.RepetitiveElementsOwnerFormattingContext {
628
- }
629
- function isInstanceOfTableFormattingContext(object: Vtree.FormattingContext): object is TableFormattingContext;
630
- interface TableRowLayoutConstraint extends RepetitiveElement.RepetitiveElementsOwnerLayoutConstraint {
631
- cellFragmentLayoutConstraints: {
632
- constraints: Layout.FragmentLayoutConstraint[];
633
- breakPosition: Vtree.NodeContext;
634
- }[];
635
- removeDummyRowNodes(nodeContext: Vtree.NodeContext): void;
636
- getElementsOffsetsForTableCell(column: Layout.Column): RepetitiveElement.ElementsOffset[];
637
- }
638
- function isInstanceOfTableRowLayoutConstraint(object: Layout.FragmentLayoutConstraint): object is TableRowLayoutConstraint;
639
- }
640
- export declare namespace Vtree {
641
- type ClientRect = {
642
- left: number;
643
- top: number;
644
- right: number;
645
- bottom: number;
646
- width: number;
647
- height: number;
648
- };
649
- /**
650
- * Interface to read the position assigned to the elements and ranges by the
651
- * browser.
652
- */
653
- interface ClientLayout {
654
- getRangeClientRects(range: Range): ClientRect[];
655
- getElementClientRect(element: Element): ClientRect;
656
- /**
657
- * @return element's computed style
658
- */
659
- getElementComputedStyle(element: Element): CSSStyleDeclaration;
660
- }
661
- /**
662
- * Styling, creating a single node's view, etc.
663
- */
664
- interface LayoutContext {
665
- /**
666
- * Creates a functionally equivalent, but uninitialized layout context,
667
- * suitable for building a separate column.
668
- */
669
- clone(): LayoutContext;
670
- /**
671
- * Set the current source node and create a view. Parameter firstTime
672
- * is true (and possibly offsetInNode > 0) if node was broken on
673
- * the previous page.
674
- * @return true if children should be processed as well
675
- */
676
- setCurrent(nodeContext: NodeContext, firstTime: boolean, atUnforcedBreak?: boolean): Task.Result<boolean>;
677
- /**
678
- * Set the container element that holds view elements produced from the
679
- * source.
680
- */
681
- setViewRoot(viewRoot: Element, isFootnote: boolean): any;
682
- /**
683
- * Moves to the next view node, creating it and appending it to the view tree
684
- * if needed.
685
- * @return that corresponds to the next view node
686
- */
687
- nextInTree(nodeContext: NodeContext, atUnforcedBreak?: boolean): Task.Result<NodeContext>;
688
- /**
689
- * Apply pseudo-element styles (if any).
690
- * @param target element to apply styles to
691
- */
692
- applyPseudoelementStyle(nodeContext: NodeContext, pseudoName: string, target: Element): void;
693
- /**
694
- * Apply styles to footnote container.
695
- * @param target element to apply styles to
696
- * @return vertical
697
- */
698
- applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): boolean;
699
- /**
700
- * Peel off innermost first-XXX pseudoelement, create and create view nodes
701
- * after the end of that pseudoelement.
702
- */
703
- peelOff(nodeContext: NodeContext, nodeOffset: number): Task.Result<NodeContext>;
704
- /**
705
- * Process a block-end edge of a fragmented block.
706
- */
707
- processFragmentedBlockEdge(nodeContext: NodeContext): any;
708
- convertLengthToPx(numeric: Css.Numeric, viewNode: Node, clientLayout: ClientLayout): number | Css.Numeric;
709
- /**
710
- * Returns if two NodePositions represents the same position in the document.
711
- */
712
- isSameNodePosition(nodePosition1: NodePosition, nodePosition2: NodePosition): boolean;
713
- addEventListener(type: string, listener: Base.EventListener, capture?: boolean): void;
714
- removeEventListener(type: string, listener: Base.EventListener, capture?: boolean): void;
715
- dispatchEvent(evt: Base.Event): void;
716
- }
717
- /**
718
- * Formatting context.
719
- */
720
- interface FormattingContext {
721
- formattingContextType: FormattingContextType;
722
- getName(): string;
723
- isFirstTime(nodeContext: NodeContext, firstTime: boolean): boolean;
724
- getParent(): FormattingContext;
725
- saveState(): any;
726
- restoreState(state: any): any;
727
- }
728
- type NodePositionStep = {
729
- node: Node;
730
- shadowType: ShadowType;
731
- shadowContext: ShadowContext | null;
732
- nodeShadow: ShadowContext | null;
733
- shadowSibling: NodePositionStep | null;
734
- formattingContext: FormattingContext | null;
735
- fragmentIndex: number;
736
- };
737
- type NodePosition = {
738
- steps: NodePositionStep[];
739
- offsetInNode: number;
740
- after: boolean;
741
- preprocessedTextContent: Diff.Change[] | null;
742
- };
743
- /**
744
- * Handling of purely whitespace sequences between blocks
745
- * @enum {number}
746
- */
747
- enum Whitespace {
748
- /**
749
- * Whitespace sequence between blocks is ignored
750
- */
751
- IGNORE = 0,
752
- /**
753
- * Whitespace sequence between blocks is ignored unless it containes newline
754
- */
755
- NEWLINE = 1,
756
- /**
757
- * Whitespace sequence between blocks is preserved
758
- */
759
- PRESERVE = 2
760
- }
761
- interface Container {
762
- left: number;
763
- top: number;
764
- marginLeft: number;
765
- marginRight: number;
766
- marginTop: number;
767
- marginBottom: number;
768
- borderLeft: number;
769
- borderRight: number;
770
- borderTop: number;
771
- borderBottom: number;
772
- paddingLeft: number;
773
- paddingRight: number;
774
- paddingTop: number;
775
- paddingBottom: number;
776
- width: number;
777
- height: number;
778
- originX: number;
779
- originY: number;
780
- exclusions: GeometryUtil.Shape[];
781
- innerShape: GeometryUtil.Shape;
782
- computedBlockSize: number;
783
- snapWidth: number;
784
- snapHeight: number;
785
- snapOffsetX: number;
786
- snapOffsetY: number;
787
- vertical: boolean;
788
- rtl: boolean;
789
- element: Element;
790
- getInsetTop(): number;
791
- getInsetBottom(): number;
792
- getInsetLeft(): number;
793
- getInsetRight(): number;
794
- getInsetBefore(): number;
795
- getInsetAfter(): number;
796
- getInsetStart(): number;
797
- getInsetEnd(): number;
798
- getBeforeEdge(box: ClientRect): number;
799
- getAfterEdge(box: ClientRect): number;
800
- getStartEdge(box: ClientRect): number;
801
- getEndEdge(box: ClientRect): number;
802
- getInlineSize(box: ClientRect): number;
803
- getBoxSize(box: ClientRect): number;
804
- getBoxDir(): number;
805
- getInlineDir(): number;
806
- copyFrom(other: Container): void;
807
- setVerticalPosition(top: number, height: number): void;
808
- setHorizontalPosition(left: number, width: number): void;
809
- setBlockPosition(start: number, extent: number): void;
810
- setInlinePosition(start: number, extent: number): void;
811
- clear(): void;
812
- getInnerShape(): GeometryUtil.Shape;
813
- getInnerRect(): GeometryUtil.Rect;
814
- getPaddingRect(): GeometryUtil.Rect;
815
- getOuterShape(outerShapeProp: Css.Val, context: Exprs.Context): GeometryUtil.Shape;
816
- getOuterRect(): GeometryUtil.Rect;
817
- }
818
- /**
819
- * @enum {number}
820
- */
821
- enum ShadowType {
822
- NONE = 0,
823
- CONTENT = 1,
824
- ROOTLESS = 2,
825
- ROOTED = 3
826
- }
827
- /**
828
- * Data about shadow tree instance.
829
- */
830
- interface ShadowContext {
831
- readonly owner: Element;
832
- readonly root: Element;
833
- readonly xmldoc: XmlDoc.XMLDocHolder;
834
- readonly parentShadow: ShadowContext;
835
- subShadow: ShadowContext;
836
- readonly type: Vtree.ShadowType;
837
- readonly styler: CssStyler.AbstractStyler;
838
- equals(other: ShadowContext): boolean;
839
- }
840
- /**
841
- * Information about :first-letter or :first-line pseudoelements
842
- * @param count 0 - first-letter, 1 or more - first line(s)
843
- */
844
- interface FirstPseudo {
845
- readonly outer: FirstPseudo;
846
- readonly count: number;
847
- }
848
- /**
849
- * NodeContext represents a position in the document + layout-related
850
- * information attached to it. When after=false and offsetInNode=0, the
851
- * position is inside the element (node), but just before its first child.
852
- * When offsetInNode>0 it represents offset in the textual content of the
853
- * node. When after=true it represents position right after the last child
854
- * of the node. boxOffset is incremented by 1 for any valid node position.
855
- */
856
- interface NodeContext {
857
- offsetInNode: number;
858
- after: boolean;
859
- shadowType: ShadowType;
860
- shadowContext: Vtree.ShadowContext;
861
- nodeShadow: Vtree.ShadowContext;
862
- shadowSibling: NodeContext;
863
- shared: boolean;
864
- inline: boolean;
865
- overflow: boolean;
866
- breakPenalty: number;
867
- display: string | null;
868
- floatReference: PageFloats.FloatReference;
869
- floatSide: string | null;
870
- clearSide: string | null;
871
- floatMinWrapBlock: Css.Numeric | null;
872
- columnSpan: Css.Val | null;
873
- verticalAlign: string;
874
- captionSide: string;
875
- inlineBorderSpacing: number;
876
- blockBorderSpacing: number;
877
- flexContainer: boolean;
878
- whitespace: Whitespace;
879
- hyphenateCharacter: string | null;
880
- breakWord: boolean;
881
- establishesBFC: boolean;
882
- containingBlockForAbsolute: boolean;
883
- breakBefore: string | null;
884
- breakAfter: string | null;
885
- viewNode: Node;
886
- clearSpacer: Node;
887
- inheritedProps: {
888
- [key: string]: number | string | Css.Val;
889
- };
890
- vertical: boolean;
891
- direction: string;
892
- firstPseudo: FirstPseudo;
893
- lang: string | null;
894
- preprocessedTextContent: Diff.Change[] | null;
895
- formattingContext: FormattingContext;
896
- repeatOnBreak: string | null;
897
- pluginProps: {
898
- [key: string]: string | number | undefined | null | (number | null)[];
899
- };
900
- fragmentIndex: number;
901
- afterIfContinues: Selectors.AfterIfContinues;
902
- footnotePolicy: Css.Ident | null;
903
- pageType: string | null;
904
- sourceNode: Node;
905
- parent: NodeContext;
906
- boxOffset: number;
907
- resetView(): void;
908
- modify(): NodeContext;
909
- copy(): NodeContext;
910
- clone(): NodeContext;
911
- toNodePositionStep(): NodePositionStep;
912
- toNodePosition(): NodePosition;
913
- isInsideBFC(): boolean;
914
- getContainingBlockForAbsolute(): NodeContext;
915
- belongsTo(formattingContext: FormattingContext): boolean;
916
- }
917
- interface ChunkPosition {
918
- floats: NodePosition[];
919
- primary: NodePosition;
920
- clone(): ChunkPosition;
921
- isSamePosition(other: ChunkPosition): boolean;
922
- }
923
- type ExprContentListener = (p1: Exprs.Val, p2: string, p3: Document) => Node | null;
924
- }
925
- export declare namespace XmlDoc {
926
- interface XMLDocHolder {
927
- lang: string | null;
928
- totalOffset: number;
929
- root: Element;
930
- body: Element;
931
- head: Element;
932
- last: Element;
933
- lastOffset: number;
934
- idMap: {
935
- [key: string]: Element;
936
- };
937
- readonly store: XMLDocStore;
938
- readonly url: string;
939
- readonly document: Document;
940
- doc(): NodeList;
941
- getElementOffset(element: Element): number;
942
- getNodeOffset(srcNode: Node, offsetInNode: number, after: boolean): number;
943
- getTotalOffset(): number;
944
- /**
945
- * @return last node such that its offset is less or equal to the given
946
- */
947
- getNodeByOffset(offset: number): Node;
948
- /**
949
- * Get element by URL in the source document(s). URL must be in either '#id'
950
- * or 'url#id' form.
951
- */
952
- getElement(url: string): Element | null;
953
- }
954
- interface Predicate {
955
- readonly fn: (p1: Node) => boolean;
956
- check(node: Node): boolean;
957
- withAttribute(name: string, value: string): Predicate;
958
- withChild(name: string, opt_childPredicate?: Predicate): Predicate;
959
- }
960
- interface NodeList {
961
- readonly nodes: Node[];
962
- asArray(): Node[];
963
- size(): number;
964
- /**
965
- * Filter with predicate
966
- */
967
- predicate(pr: Predicate): NodeList;
968
- forEachNode(fn: (p1: Node, p2: (p1: Node) => void) => void): NodeList;
969
- forEach<T>(fn: (p1: Node) => T): T[];
970
- forEachNonNull<T>(fn: (p1: Node) => T): T[];
971
- child(tag: string): NodeList;
972
- childElements(): NodeList;
973
- attribute(name: string): (string | null)[];
974
- textContent(): (string | null)[];
975
- }
976
- type XMLDocStore = Net.ResourceStore<XMLDocHolder>;
977
- }
1
+ /**
2
+ * Copyright 2019 Vivliostyle Foundation
3
+ *
4
+ * Vivliostyle.js is free software: you can redistribute it and/or modify
5
+ * it under the terms of the GNU Affero General Public License as published by
6
+ * the Free Software Foundation, either version 3 of the License, or
7
+ * (at your option) any later version.
8
+ *
9
+ * Vivliostyle.js is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License
15
+ * along with Vivliostyle.js. If not, see <http://www.gnu.org/licenses/>.
16
+ *
17
+ * @fileoverview Types - Type definiions.
18
+ */
19
+ import * as Base from "./base";
20
+ import * as Css from "./css";
21
+ import * as Diff from "./diff";
22
+ import * as Exprs from "./exprs";
23
+ import * as GeometryUtil from "./geometry-util";
24
+ import * as Task from "./task";
25
+ import * as TaskUtil from "./task-util";
26
+ export type FormattingContextType = "Block" | "RepetitiveElementsOwner" | "Table";
27
+ export type FragmentLayoutConstraintType = "AfterIfContinue" | "EntireTable" | "RepetitiveElementsOwner" | "TableRow";
28
+ export declare namespace CssCascade {
29
+ type ElementStyle = {
30
+ [key: string]: any;
31
+ };
32
+ }
33
+ export declare namespace CssStyler {
34
+ interface AbstractStyler {
35
+ getStyle(element: Element, deep: boolean): CssCascade.ElementStyle;
36
+ processContent(element: Element, styles: {
37
+ [key: string]: Css.Val;
38
+ }, viewNode: Node): any;
39
+ }
40
+ }
41
+ export declare namespace Layout {
42
+ /**
43
+ * Represents a constraint on layout
44
+ */
45
+ interface LayoutConstraint {
46
+ /**
47
+ * Returns if this constraint allows the node context to be laid out at the
48
+ * current position.
49
+ */
50
+ allowLayout(nodeContext: Vtree.NodeContext): boolean;
51
+ }
52
+ /**
53
+ * Represents constraints on laying out fragments
54
+ */
55
+ interface FragmentLayoutConstraint {
56
+ flagmentLayoutConstraintType: FragmentLayoutConstraintType;
57
+ allowLayout(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, column: Column): boolean;
58
+ nextCandidate(nodeContext: Vtree.NodeContext): boolean;
59
+ postLayout(allowed: boolean, positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Column): any;
60
+ finishBreak(nodeContext: Vtree.NodeContext, column: Column): Task.Result<boolean>;
61
+ equalsTo(constraint: FragmentLayoutConstraint): boolean;
62
+ getPriorityOfFinishBreak(): number;
63
+ }
64
+ /**
65
+ * Potential breaking position.
66
+ */
67
+ interface BreakPosition {
68
+ /**
69
+ * @return break position, if found
70
+ */
71
+ findAcceptableBreak(column: Column, penalty: number): Vtree.NodeContext;
72
+ /**
73
+ * @return penalty for this break position
74
+ */
75
+ getMinBreakPenalty(): number;
76
+ calculateOffset(column: Column): {
77
+ current: number;
78
+ minimum: number;
79
+ };
80
+ breakPositionChosen(column: Column): void;
81
+ }
82
+ interface AbstractBreakPosition extends BreakPosition {
83
+ getNodeContext(): Vtree.NodeContext;
84
+ }
85
+ type BreakPositionAndNodeContext = {
86
+ breakPosition: BreakPosition;
87
+ nodeContext: Vtree.NodeContext;
88
+ };
89
+ /**
90
+ * Potential breaking position inside CSS box (between lines).
91
+ * @param checkPoints array of breaking points for
92
+ * breakable block
93
+ */
94
+ interface BoxBreakPosition extends AbstractBreakPosition {
95
+ breakNodeContext: Vtree.NodeContext;
96
+ readonly checkPoints: Vtree.NodeContext[];
97
+ readonly penalty: number;
98
+ }
99
+ /**
100
+ * Potential edge breaking position.
101
+ */
102
+ interface EdgeBreakPosition extends AbstractBreakPosition {
103
+ overflowIfRepetitiveElementsDropped: boolean;
104
+ readonly position: Vtree.NodeContext;
105
+ readonly breakOnEdge: string | null;
106
+ overflows: boolean;
107
+ readonly computedBlockSize: number;
108
+ }
109
+ interface Column extends Vtree.Container {
110
+ last: Node;
111
+ viewDocument: Document;
112
+ flowRootFormattingContext: Vtree.FormattingContext;
113
+ isFloat: boolean;
114
+ isFootnote: boolean;
115
+ startEdge: number;
116
+ endEdge: number;
117
+ beforeEdge: number;
118
+ afterEdge: number;
119
+ footnoteEdge: number;
120
+ box: GeometryUtil.Rect;
121
+ chunkPositions: Vtree.ChunkPosition[];
122
+ bands: GeometryUtil.Band[];
123
+ overflown: boolean;
124
+ breakPositions: BreakPosition[];
125
+ pageBreakType: string | null;
126
+ forceNonfitting: boolean;
127
+ leftFloatEdge: number;
128
+ /**
129
+ * bottom of the bottommost left float
130
+ */
131
+ rightFloatEdge: number;
132
+ /**
133
+ * bottom of the bottommost right float
134
+ */
135
+ bottommostFloatTop: number;
136
+ /**
137
+ * Top of the bottommost float
138
+ */
139
+ stopAtOverflow: boolean;
140
+ lastAfterPosition: Vtree.NodePosition | null;
141
+ fragmentLayoutConstraints: FragmentLayoutConstraint[];
142
+ pseudoParent: Column;
143
+ nodeContextOverflowingDueToRepetitiveElements: Vtree.NodeContext | null;
144
+ blockDistanceToBlockEndFloats: number;
145
+ computedBlockSize: number;
146
+ layoutContext: Vtree.LayoutContext;
147
+ clientLayout: Vtree.ClientLayout;
148
+ readonly layoutConstraint: LayoutConstraint;
149
+ readonly pageFloatLayoutContext: PageFloats.PageFloatLayoutContext;
150
+ getTopEdge(): number;
151
+ getBottomEdge(): number;
152
+ getLeftEdge(): number;
153
+ getRightEdge(): number;
154
+ isFloatNodeContext(nodeContext: Vtree.NodeContext): boolean;
155
+ stopByOverflow(nodeContext: Vtree.NodeContext): boolean;
156
+ isOverflown(edge: number): boolean;
157
+ getExclusions(): GeometryUtil.Shape[];
158
+ openAllViews(position: Vtree.NodePosition): Task.Result<Vtree.NodeContext>;
159
+ calculateOffsetInNodeForNodeContext(position: Vtree.NodePosition): number;
160
+ /**
161
+ * @param count first-XXX nesting identifier
162
+ */
163
+ maybePeelOff(position: Vtree.NodeContext, count: number): Task.Result<Vtree.NodeContext>;
164
+ /**
165
+ * Builds the view until a CSS box edge is reached.
166
+ * @param position start source position.
167
+ * @param checkPoints array to append possible breaking points.
168
+ * @return holding box edge position reached or null if the source is exhausted.
169
+ */
170
+ buildViewToNextBlockEdge(position: Vtree.NodeContext, checkPoints: Vtree.NodeContext[]): Task.Result<Vtree.NodeContext>;
171
+ nextInTree(position: Vtree.NodeContext, atUnforcedBreak?: boolean): Task.Result<Vtree.NodeContext>;
172
+ /**
173
+ * Builds the view for a single unbreakable element.
174
+ * @param position start source position.
175
+ * @return holding box edge position reached or null if the source is exhausted.
176
+ */
177
+ buildDeepElementView(position: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
178
+ /**
179
+ * Create a single floating element (for exclusion areas).
180
+ * @param ref container's child to insert float before (can be null).
181
+ * @param side float side ("left" or "right").
182
+ * @param width float inline dimension.
183
+ * @param height float box progression dimension.
184
+ * @return newly created float element.
185
+ */
186
+ createFloat(ref: Node, side: string, width: number, height: number): Element;
187
+ /**
188
+ * Remove all the exclusion floats.
189
+ */
190
+ killFloats(): void;
191
+ /**
192
+ * Create exclusion floats for a column.
193
+ */
194
+ createFloats(): void;
195
+ /**
196
+ * @param nodeContext position after the block
197
+ * @param checkPoints array of possible breaking points.
198
+ * @param index index of the breaking point
199
+ * @param boxOffset box offset
200
+ * @return edge position
201
+ */
202
+ calculateEdge(nodeContext: Vtree.NodeContext, checkPoints: Vtree.NodeContext[], index: number, boxOffset: number): number;
203
+ /**
204
+ * Parse CSS computed length (in pixels)
205
+ * @param val CSS length in "px" units or a number.
206
+ * @return value in pixels or 0 if not parsable
207
+ */
208
+ parseComputedLength(val: string | number): number;
209
+ /**
210
+ * Reads element's computed CSS margin.
211
+ */
212
+ getComputedMargin(element: Element): GeometryUtil.Insets;
213
+ /**
214
+ * Reads element's computed padding + borders.
215
+ */
216
+ getComputedPaddingBorder(element: Element): GeometryUtil.Insets;
217
+ /**
218
+ * Reads element's computed CSS insets(margins + border + padding or margins :
219
+ * depends on box-sizing)
220
+ */
221
+ getComputedInsets(element: Element): GeometryUtil.Insets;
222
+ /**
223
+ * Set element's computed CSS insets to Column Container
224
+ */
225
+ setComputedInsets(element: Element, container: Column): void;
226
+ /**
227
+ * Set element's computed width and height to Column Container
228
+ */
229
+ setComputedWidthAndHeight(element: Element, container: Column): void;
230
+ /**
231
+ * Layout a single unbreakable element.
232
+ */
233
+ layoutUnbreakable(nodeContextIn: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
234
+ /**
235
+ * Layout a single float element.
236
+ */
237
+ layoutFloat(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
238
+ setupFloatArea(area: PageFloatArea, floatReference: PageFloats.FloatReference, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): boolean;
239
+ createPageFloatArea(float: PageFloats.PageFloat | null, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): PageFloatArea | null;
240
+ layoutSinglePageFloatFragment(continuations: PageFloats.PageFloatContinuation[], floatSide: string, clearSide: string | null, allowFragmented: boolean, strategy: PageFloats.PageFloatLayoutStrategy, anchorEdge: number | null, pageFloatFragment?: PageFloats.PageFloatFragment | null): Task.Result<SinglePageFloatLayoutResult>;
241
+ layoutPageFloatInner(continuation: PageFloats.PageFloatContinuation, strategy: PageFloats.PageFloatLayoutStrategy, anchorEdge: number | null, pageFloatFragment?: PageFloats.PageFloatFragment): Task.Result<boolean>;
242
+ setFloatAnchorViewNode(nodeContext: Vtree.NodeContext): Vtree.NodeContext;
243
+ resolveFloatReferenceFromColumnSpan(floatReference: PageFloats.FloatReference, columnSpan: Css.Val, nodeContext: Vtree.NodeContext): Task.Result<PageFloats.FloatReference>;
244
+ layoutPageFloat(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
245
+ processLineStyling(nodeContext: Vtree.NodeContext, resNodeContext: Vtree.NodeContext, checkPoints: Vtree.NodeContext[]): Task.Result<Vtree.NodeContext>;
246
+ isLoneImage(checkPoints: Vtree.NodeContext[]): boolean;
247
+ getTrailingMarginEdgeAdjustment(trailingEdgeContexts: Vtree.NodeContext[]): number;
248
+ /**
249
+ * Layout a single CSS box.
250
+ */
251
+ layoutBreakableBlock(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
252
+ postLayoutBlock(nodeContext: Vtree.NodeContext, checkPoints: Vtree.NodeContext[]): void;
253
+ findEndOfLine(linePosition: number, checkPoints: Vtree.NodeContext[], isUpdateMaxReachedAfterEdge: boolean): {
254
+ nodeContext: Vtree.NodeContext;
255
+ index: number;
256
+ checkPointIndex: number;
257
+ };
258
+ findAcceptableBreakInside(checkPoints: Vtree.NodeContext[], edgePosition: number, force: boolean): Vtree.NodeContext;
259
+ resolveTextNodeBreaker(nodeContext: Vtree.NodeContext): TextNodeBreaker;
260
+ /**
261
+ * Read ranges skipping special elments
262
+ */
263
+ getRangeBoxes(start: Node, end: Node): Vtree.ClientRect[];
264
+ /**
265
+ * Give block's initial and final nodes, find positions of the line bottoms.
266
+ * This is, of course, somewhat hacky implementation.
267
+ * @return position of line breaks
268
+ */
269
+ findLinePositions(checkPoints: Vtree.NodeContext[]): number[];
270
+ calculateClonedPaddingBorder(nodeContext: Vtree.NodeContext): number;
271
+ findBoxBreakPosition(bp: BoxBreakPosition, force: boolean): Vtree.NodeContext;
272
+ getAfterEdgeOfBlockContainer(nodeContext: Vtree.NodeContext): number;
273
+ findFirstOverflowingEdgeAndCheckPoint(checkPoints: Vtree.NodeContext[]): {
274
+ edge: number;
275
+ checkPoint: Vtree.NodeContext | null;
276
+ };
277
+ findEdgeBreakPosition(bp: EdgeBreakPosition): Vtree.NodeContext;
278
+ /**
279
+ * Finalize a line break.
280
+ * @return holing true
281
+ */
282
+ finishBreak(nodeContext: Vtree.NodeContext, forceRemoveSelf: boolean, endOfColumn: boolean): Task.Result<boolean>;
283
+ findAcceptableBreakPosition(): BreakPositionAndNodeContext;
284
+ doFinishBreak(nodeContext: Vtree.NodeContext, overflownNodeContext: Vtree.NodeContext, initialNodeContext: Vtree.NodeContext, initialComputedBlockSize: number): Task.Result<Vtree.NodeContext>;
285
+ /**
286
+ * Determines if a page break is acceptable at this position
287
+ */
288
+ isBreakable(flowPosition: Vtree.NodeContext): boolean;
289
+ /**
290
+ * Determines if an indent value is zero
291
+ */
292
+ zeroIndent(val: string | number): boolean;
293
+ /**
294
+ * @return true if overflows
295
+ */
296
+ checkOverflowAndSaveEdge(nodeContext: Vtree.NodeContext, trailingEdgeContexts: Vtree.NodeContext[]): boolean;
297
+ /**
298
+ * Save a possible page break position on a CSS block edge. Check if it
299
+ * overflows.
300
+ * @return true if overflows
301
+ */
302
+ checkOverflowAndSaveEdgeAndBreakPosition(nodeContext: Vtree.NodeContext, trailingEdgeContexts: Vtree.NodeContext[], saveEvenOverflown: boolean, breakAtTheEdge: string | null): boolean;
303
+ applyClearance(nodeContext: Vtree.NodeContext): boolean;
304
+ isBFC(formattingContext: Vtree.FormattingContext): boolean;
305
+ /**
306
+ * Skips positions until either the start of unbreakable block or inline
307
+ * content. Also sets breakBefore on the result combining break-before and
308
+ * break-after properties from all elements that meet at the edge.
309
+ */
310
+ skipEdges(nodeContext: Vtree.NodeContext, leadingEdge: boolean, forcedBreakValue: string | null): Task.Result<Vtree.NodeContext>;
311
+ /**
312
+ * Skips non-renderable positions until it hits the end of the flow or some
313
+ * renderable content. Returns the nodeContext that was passed in if some
314
+ * content remains and null if all content could be skipped.
315
+ */
316
+ skipTailEdges(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
317
+ layoutFloatOrFootnote(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
318
+ /**
319
+ * Layout next portion of the source.
320
+ */
321
+ layoutNext(nodeContext: Vtree.NodeContext, leadingEdge: boolean, forcedBreakValue?: string | null): Task.Result<Vtree.NodeContext>;
322
+ clearOverflownViewNodes(nodeContext: Vtree.NodeContext, removeSelf: boolean): void;
323
+ initGeom(): void;
324
+ init(): void;
325
+ /**
326
+ * Save the potential breaking position at the edge. Should, in general, save
327
+ * "after" position but only after skipping all of the "before" ones and
328
+ * getting to the non-empty content (to get breakAtEdge right).
329
+ */
330
+ saveEdgeBreakPosition(position: Vtree.NodeContext, breakAtEdge: string | null, overflows: boolean): void;
331
+ /**
332
+ * @param checkPoints array of breaking points for breakable block
333
+ */
334
+ saveBoxBreakPosition(checkPoints: Vtree.NodeContext[]): void;
335
+ updateMaxReachedAfterEdge(afterEdge: number): void;
336
+ /**
337
+ * @param chunkPosition starting position.
338
+ * @return holding end position.
339
+ */
340
+ layout(chunkPosition: Vtree.ChunkPosition, leadingEdge: boolean, breakAfter?: string | null): Task.Result<Vtree.ChunkPosition>;
341
+ isFullWithPageFloats(): boolean;
342
+ getMaxBlockSizeOfPageFloats(): number;
343
+ doFinishBreakOfFragmentLayoutConstraints(nodeContext: any): void;
344
+ /**
345
+ * @param nodeContext starting position.
346
+ * @return holding end position.
347
+ */
348
+ doLayout(nodeContext: Vtree.NodeContext, leadingEdge: boolean, breakAfter?: string | null): Task.Result<{
349
+ nodeContext: Vtree.NodeContext;
350
+ overflownNodeContext: Vtree.NodeContext;
351
+ }>;
352
+ /**
353
+ * Re-layout already laid-out chunks. Return the position of the last flow if
354
+ * there is an overflow.
355
+ * TODO: deal with chunks that did not fit at all.
356
+ * @return holding end position.
357
+ */
358
+ redoLayout(): Task.Result<Vtree.ChunkPosition>;
359
+ saveDistanceToBlockEndFloats(): void;
360
+ collectElementsOffset(): RepetitiveElement.ElementsOffset[];
361
+ }
362
+ type SinglePageFloatLayoutResult = {
363
+ floatArea: PageFloatArea | null;
364
+ pageFloatFragment: PageFloats.PageFloatFragment | null;
365
+ newPosition: Vtree.ChunkPosition | null;
366
+ };
367
+ /**
368
+ * breaking point resolver for Text Node.
369
+ */
370
+ interface TextNodeBreaker {
371
+ breakTextNode(textNode: Text, nodeContext: Vtree.NodeContext, low: number, checkPoints: Vtree.NodeContext[], checkpointIndex: number, force: boolean): Vtree.NodeContext;
372
+ breakAfterSoftHyphen(textNode: Text, text: string, viewIndex: number, nodeContext: Vtree.NodeContext): number;
373
+ breakAfterOtherCharacter(textNode: Text, text: string, viewIndex: number, nodeContext: Vtree.NodeContext): number;
374
+ updateNodeContext(nodeContext: Vtree.NodeContext, viewIndex: number, textNode: Text): Vtree.NodeContext;
375
+ }
376
+ interface LayoutMode {
377
+ doLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
378
+ accept(nodeContext: Vtree.NodeContext, column: Layout.Column): boolean;
379
+ postLayout(positionAfter: Vtree.NodeContext, initialPosition: Vtree.NodeContext, column: Layout.Column, accepted: boolean): boolean;
380
+ }
381
+ interface PageFloatArea extends Column {
382
+ adjustContentRelativeSize: boolean;
383
+ readonly floatSide: string;
384
+ readonly parentContainer: Vtree.Container;
385
+ convertPercentageSizesToPx(target: Element): void;
386
+ fixFloatSizeAndPosition(nodeContext: Vtree.NodeContext): void;
387
+ getContentInlineSize(): number;
388
+ }
389
+ }
390
+ export declare namespace LayoutProcessor {
391
+ interface BlockFormattingContext extends Vtree.FormattingContext {
392
+ }
393
+ function isInstanceOfBlockFormattingContext(object: Vtree.FormattingContext): object is BlockFormattingContext;
394
+ }
395
+ export declare namespace Net {
396
+ type Response = {
397
+ status: number;
398
+ statusText: string | null;
399
+ url: string;
400
+ contentType: string | null;
401
+ responseText: string | null;
402
+ responseXML: Document;
403
+ responseBlob: Blob;
404
+ };
405
+ interface ResourceStore<Resource> {
406
+ resources: {
407
+ [key: string]: Resource;
408
+ };
409
+ fetchers: {
410
+ [key: string]: TaskUtil.Fetcher<Resource>;
411
+ };
412
+ readonly parser: (p1: Response, p2: ResourceStore<Resource>) => Task.Result<Resource>;
413
+ readonly type: XMLHttpRequestResponseType;
414
+ /**
415
+ * @return resource for the given URL
416
+ */
417
+ load(url: string, opt_required?: boolean, opt_message?: string): Task.Result<Resource>;
418
+ /**
419
+ * @return fetcher for the resource for the given URL
420
+ */
421
+ fetch(url: string, opt_required?: boolean, opt_message?: string): TaskUtil.Fetcher<Resource>;
422
+ get(url: string): XmlDoc.XMLDocHolder;
423
+ delete(url: string): void;
424
+ }
425
+ }
426
+ export declare namespace PageFloats {
427
+ /**
428
+ * @enum {string}
429
+ */
430
+ enum FloatReference {
431
+ INLINE = "inline",
432
+ COLUMN = "column",
433
+ REGION = "region",
434
+ PAGE = "page"
435
+ }
436
+ type PageFloatID = string;
437
+ interface PageFloat {
438
+ order: number | null;
439
+ id: PageFloatID | null;
440
+ readonly nodePosition: Vtree.NodePosition;
441
+ readonly floatReference: FloatReference;
442
+ readonly floatSide: string;
443
+ readonly clearSide: string | null;
444
+ readonly flowName: string;
445
+ readonly floatMinWrapBlock: Css.Numeric | null;
446
+ getOrder(): number;
447
+ getId(): PageFloatID;
448
+ isAllowedOnContext(pageFloatLayoutContext: PageFloatLayoutContext): boolean;
449
+ isAllowedToPrecede(other: PageFloat): boolean;
450
+ }
451
+ interface PageFloatFragment {
452
+ readonly floatReference: FloatReference;
453
+ readonly floatSide: string;
454
+ readonly continuations: PageFloatContinuation[];
455
+ readonly area: Vtree.Container;
456
+ readonly continues: boolean;
457
+ hasFloat(float: PageFloat): boolean;
458
+ findNotAllowedFloat(context: PageFloatLayoutContext): PageFloat | null;
459
+ getOuterShape(): GeometryUtil.Shape;
460
+ getOuterRect(): GeometryUtil.Rect;
461
+ getOrder(): number;
462
+ shouldBeStashedBefore(float: PageFloat): boolean;
463
+ addContinuations(continuations: PageFloatContinuation[]): void;
464
+ getFlowName(): string;
465
+ }
466
+ interface PageFloatContinuation {
467
+ readonly float: PageFloat;
468
+ readonly nodePosition: Vtree.NodePosition;
469
+ equals(other: PageFloatContinuation | null): boolean;
470
+ }
471
+ type PageFloatPlacementCondition = {
472
+ [key: string]: boolean;
473
+ };
474
+ interface PageFloatLayoutContext {
475
+ writingMode: Css.Val;
476
+ direction: Css.Val;
477
+ floatFragments: PageFloatFragment[];
478
+ readonly parent: PageFloatLayoutContext;
479
+ readonly flowName: string | null;
480
+ readonly generatingNodePosition: Vtree.NodePosition | null;
481
+ getContainer(floatReference?: FloatReference): Vtree.Container;
482
+ setContainer(container: Vtree.Container): any;
483
+ addPageFloat(float: PageFloat): void;
484
+ getPageFloatLayoutContext(floatReference: FloatReference): PageFloatLayoutContext;
485
+ findPageFloatByNodePosition(nodePosition: Vtree.NodePosition): PageFloat | null;
486
+ isForbidden(float: PageFloat): boolean;
487
+ addPageFloatFragment(floatFragment: PageFloatFragment, dontInvalidate?: boolean): void;
488
+ removePageFloatFragment(floatFragment: PageFloatFragment, dontInvalidate?: boolean): void;
489
+ findPageFloatFragment(float: PageFloat): PageFloatFragment | null;
490
+ hasFloatFragments(condition?: (p1: PageFloatFragment) => boolean): boolean;
491
+ hasContinuingFloatFragmentsInFlow(flowName: string): boolean;
492
+ registerPageFloatAnchor(float: PageFloat, anchorViewNode: Node): void;
493
+ collectPageFloatAnchors(): any;
494
+ isAnchorAlreadyAppeared(floatId: PageFloatID): boolean;
495
+ deferPageFloat(continuation: PageFloatContinuation): void;
496
+ hasPrecedingFloatsDeferredToNext(float: PageFloat, ignoreReference?: boolean): boolean;
497
+ getLastFollowingFloatInFragments(float: PageFloat): PageFloat | null;
498
+ getDeferredPageFloatContinuations(flowName?: string | null): PageFloatContinuation[];
499
+ getPageFloatContinuationsDeferredToNext(flowName?: string | null): PageFloatContinuation[];
500
+ getFloatsDeferredToNextInChildContexts(): PageFloat[];
501
+ checkAndForbidNotAllowedFloat(): boolean;
502
+ checkAndForbidFloatFollowingDeferredFloat(): boolean;
503
+ finish(): void;
504
+ hasSameContainerAs(other: PageFloatLayoutContext): boolean;
505
+ invalidate(): void;
506
+ detachChildren(): PageFloatLayoutContext[];
507
+ attachChildren(children: PageFloatLayoutContext[]): void;
508
+ isInvalidated(): boolean;
509
+ validate(): void;
510
+ removeEndFloatFragments(floatSide: string): void;
511
+ stashEndFloatFragments(float: PageFloat): void;
512
+ restoreStashedFragments(floatReference: FloatReference): void;
513
+ discardStashedFragments(floatReference: FloatReference): void;
514
+ getStashedFloatFragments(floatReference: FloatReference): PageFloatFragment[];
515
+ /**
516
+ * @param anchorEdge Null indicates that the anchor is not in the current
517
+ * container.
518
+ * @return Logical float side (snap-block is resolved when init=false). Null
519
+ * indicates that the float area does not fit inside the container
520
+ */
521
+ setFloatAreaDimensions(area: Layout.PageFloatArea, floatReference: FloatReference, floatSide: string, anchorEdge: number | null, init: boolean, force: boolean, condition: PageFloatPlacementCondition): string | null;
522
+ getFloatFragmentExclusions(): GeometryUtil.Shape[];
523
+ getMaxReachedAfterEdge(): number;
524
+ getBlockStartEdgeOfBlockEndFloats(): number;
525
+ getPageFloatClearEdge(clear: string, column: Layout.Column): number;
526
+ getPageFloatPlacementCondition(float: PageFloat, floatSide: string, clearSide: string | null): PageFloatPlacementCondition;
527
+ getLayoutConstraints(): Layout.LayoutConstraint[];
528
+ addLayoutConstraint(layoutConstraint: Layout.LayoutConstraint, floatReference: FloatReference): void;
529
+ getMaxBlockSizeOfPageFloats(): number;
530
+ lock(): void;
531
+ unlock(): void;
532
+ isLocked(): boolean;
533
+ }
534
+ interface PageFloatLayoutStrategy {
535
+ appliesToNodeContext(nodeContext: Vtree.NodeContext): boolean;
536
+ appliesToFloat(float: PageFloat): boolean;
537
+ createPageFloat(nodeContext: Vtree.NodeContext, pageFloatLayoutContext: PageFloatLayoutContext, column: Layout.Column): Task.Result<PageFloat>;
538
+ createPageFloatFragment(continuations: PageFloatContinuation[], floatSide: string, floatArea: Layout.PageFloatArea, continues: boolean): PageFloatFragment;
539
+ findPageFloatFragment(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): PageFloatFragment | null;
540
+ adjustPageFloatArea(floatArea: Layout.PageFloatArea, floatContainer: Vtree.Container, column: Layout.Column): any;
541
+ forbid(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): any;
542
+ }
543
+ }
544
+ export declare namespace Selectors {
545
+ interface AfterIfContinues {
546
+ readonly sourceNode: Element;
547
+ readonly styler: PseudoElement.PseudoelementStyler;
548
+ createElement(column: Layout.Column, parentNodeContext: Vtree.NodeContext): Task.Result<Element>;
549
+ }
550
+ interface AfterIfContinuesLayoutConstraint extends Layout.FragmentLayoutConstraint {
551
+ nodeContext: Vtree.NodeContext;
552
+ afterIfContinues: AfterIfContinues;
553
+ pseudoElementHeight: number;
554
+ getRepetitiveElements(): AfterIfContinuesElementsOffset;
555
+ }
556
+ function isInstanceOfAfterIfContinuesLayoutConstraint(object: Layout.FragmentLayoutConstraint): object is AfterIfContinuesLayoutConstraint;
557
+ interface AfterIfContinuesElementsOffset extends RepetitiveElement.ElementsOffset {
558
+ nodeContext: Vtree.NodeContext;
559
+ pseudoElementHeight: number;
560
+ affectTo(nodeContext: Vtree.NodeContext): boolean;
561
+ }
562
+ }
563
+ export declare namespace PseudoElement {
564
+ interface PseudoelementStyler extends CssStyler.AbstractStyler {
565
+ contentProcessed: {
566
+ [key: string]: boolean;
567
+ };
568
+ readonly element: Element;
569
+ style: CssCascade.ElementStyle;
570
+ styler: CssStyler.AbstractStyler;
571
+ readonly context: Exprs.Context;
572
+ readonly exprContentListener: Vtree.ExprContentListener;
573
+ }
574
+ }
575
+ export declare namespace RepetitiveElement {
576
+ interface RepetitiveElementsOwnerFormattingContext extends Vtree.FormattingContext {
577
+ isRoot: boolean;
578
+ repetitiveElements: RepetitiveElements;
579
+ readonly parent: Vtree.FormattingContext;
580
+ readonly rootSourceNode: Element;
581
+ getRepetitiveElements(): RepetitiveElements;
582
+ getRootViewNode(position: Vtree.NodeContext): Element | null;
583
+ getRootNodeContext(nodeContext: Vtree.NodeContext): Vtree.NodeContext | null;
584
+ initializeRepetitiveElements(vertical: boolean): void;
585
+ }
586
+ function isInstanceOfRepetitiveElementsOwnerFormattingContext(object: Vtree.FormattingContext): object is RepetitiveElementsOwnerFormattingContext;
587
+ interface ElementsOffset {
588
+ calculateOffset(nodeContext: Vtree.NodeContext): number;
589
+ calculateMinimumOffset(nodeContext: Vtree.NodeContext): number;
590
+ }
591
+ interface RepetitiveElements extends ElementsOffset {
592
+ isSkipHeader: boolean;
593
+ isSkipFooter: boolean;
594
+ enableSkippingFooter: boolean;
595
+ enableSkippingHeader: boolean;
596
+ doneInitialLayout: boolean;
597
+ firstContentSourceNode: Element | null;
598
+ lastContentSourceNode: Element | null;
599
+ allowInsert: boolean;
600
+ allowInsertRepeatitiveElements: boolean;
601
+ ownerSourceNode: Element;
602
+ setHeaderNodeContext(nodeContext: Vtree.NodeContext): void;
603
+ setFooterNodeContext(nodeContext: Vtree.NodeContext): void;
604
+ updateHeight(column: Layout.Column): void;
605
+ prepareLayoutFragment(): void;
606
+ appendHeaderToFragment(rootNodeContext: Vtree.NodeContext, firstChild: Node | null, column: Layout.Column): Task.Result<boolean>;
607
+ appendFooterToFragment(rootNodeContext: Vtree.NodeContext, firstChild: Node | null, column: Layout.Column): Task.Result<boolean>;
608
+ appendElementToFragment(nodePosition: Vtree.NodePosition, rootNodeContext: Vtree.NodeContext, firstChild: Node | null, column: Layout.Column): Task.Result<boolean>;
609
+ moveChildren(from: Element, to: Element, firstChild: Node | null): void;
610
+ isAfterLastContent(nodeContext: Vtree.NodeContext): boolean;
611
+ isFirstContentNode(nodeContext: Vtree.NodeContext): boolean;
612
+ isEnableToUpdateState(): boolean;
613
+ updateState(): void;
614
+ preventSkippingHeader(): void;
615
+ preventSkippingFooter(): void;
616
+ isHeaderRegistered(): boolean;
617
+ isFooterRegistered(): boolean;
618
+ isHeaderSourceNode(node: Node): boolean;
619
+ isFooterSourceNode(node: Node): boolean;
620
+ }
621
+ interface RepetitiveElementsOwnerLayoutConstraint extends Layout.FragmentLayoutConstraint {
622
+ getRepetitiveElements(): RepetitiveElements;
623
+ }
624
+ function isInstanceOfRepetitiveElementsOwnerLayoutConstraint(object: Layout.FragmentLayoutConstraint): object is RepetitiveElementsOwnerLayoutConstraint;
625
+ }
626
+ export declare namespace Table {
627
+ interface TableFormattingContext extends RepetitiveElement.RepetitiveElementsOwnerFormattingContext {
628
+ }
629
+ function isInstanceOfTableFormattingContext(object: Vtree.FormattingContext): object is TableFormattingContext;
630
+ interface TableRowLayoutConstraint extends RepetitiveElement.RepetitiveElementsOwnerLayoutConstraint {
631
+ cellFragmentLayoutConstraints: {
632
+ constraints: Layout.FragmentLayoutConstraint[];
633
+ breakPosition: Vtree.NodeContext;
634
+ }[];
635
+ removeDummyRowNodes(nodeContext: Vtree.NodeContext): void;
636
+ getElementsOffsetsForTableCell(column: Layout.Column): RepetitiveElement.ElementsOffset[];
637
+ }
638
+ function isInstanceOfTableRowLayoutConstraint(object: Layout.FragmentLayoutConstraint): object is TableRowLayoutConstraint;
639
+ }
640
+ export declare namespace Vtree {
641
+ type ClientRect = {
642
+ left: number;
643
+ top: number;
644
+ right: number;
645
+ bottom: number;
646
+ width: number;
647
+ height: number;
648
+ };
649
+ /**
650
+ * Interface to read the position assigned to the elements and ranges by the
651
+ * browser.
652
+ */
653
+ interface ClientLayout {
654
+ getRangeClientRects(range: Range): ClientRect[];
655
+ getElementClientRect(element: Element): ClientRect;
656
+ /**
657
+ * @return element's computed style
658
+ */
659
+ getElementComputedStyle(element: Element): CSSStyleDeclaration;
660
+ }
661
+ /**
662
+ * Styling, creating a single node's view, etc.
663
+ */
664
+ interface LayoutContext {
665
+ /**
666
+ * Creates a functionally equivalent, but uninitialized layout context,
667
+ * suitable for building a separate column.
668
+ */
669
+ clone(): LayoutContext;
670
+ /**
671
+ * Set the current source node and create a view. Parameter firstTime
672
+ * is true (and possibly offsetInNode > 0) if node was broken on
673
+ * the previous page.
674
+ * @return true if children should be processed as well
675
+ */
676
+ setCurrent(nodeContext: NodeContext, firstTime: boolean, atUnforcedBreak?: boolean): Task.Result<boolean>;
677
+ /**
678
+ * Set the container element that holds view elements produced from the
679
+ * source.
680
+ */
681
+ setViewRoot(viewRoot: Element, isFootnote: boolean): any;
682
+ /**
683
+ * Moves to the next view node, creating it and appending it to the view tree
684
+ * if needed.
685
+ * @return that corresponds to the next view node
686
+ */
687
+ nextInTree(nodeContext: NodeContext, atUnforcedBreak?: boolean): Task.Result<NodeContext>;
688
+ /**
689
+ * Apply pseudo-element styles (if any).
690
+ * @param target element to apply styles to
691
+ */
692
+ applyPseudoelementStyle(nodeContext: NodeContext, pseudoName: string, target: Element): void;
693
+ /**
694
+ * Apply styles to footnote container.
695
+ * @param target element to apply styles to
696
+ * @return vertical
697
+ */
698
+ applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): boolean;
699
+ /**
700
+ * Peel off innermost first-XXX pseudoelement, create and create view nodes
701
+ * after the end of that pseudoelement.
702
+ */
703
+ peelOff(nodeContext: NodeContext, nodeOffset: number): Task.Result<NodeContext>;
704
+ /**
705
+ * Process a block-end edge of a fragmented block.
706
+ */
707
+ processFragmentedBlockEdge(nodeContext: NodeContext): any;
708
+ convertLengthToPx(numeric: Css.Numeric, viewNode: Node, clientLayout: ClientLayout): number | Css.Numeric;
709
+ /**
710
+ * Returns if two NodePositions represents the same position in the document.
711
+ */
712
+ isSameNodePosition(nodePosition1: NodePosition, nodePosition2: NodePosition): boolean;
713
+ addEventListener(type: string, listener: Base.EventListener, capture?: boolean): void;
714
+ removeEventListener(type: string, listener: Base.EventListener, capture?: boolean): void;
715
+ dispatchEvent(evt: Base.Event): void;
716
+ }
717
+ /**
718
+ * Formatting context.
719
+ */
720
+ interface FormattingContext {
721
+ formattingContextType: FormattingContextType;
722
+ getName(): string;
723
+ isFirstTime(nodeContext: NodeContext, firstTime: boolean): boolean;
724
+ getParent(): FormattingContext;
725
+ saveState(): any;
726
+ restoreState(state: any): any;
727
+ }
728
+ type NodePositionStep = {
729
+ node: Node;
730
+ shadowType: ShadowType;
731
+ shadowContext: ShadowContext | null;
732
+ nodeShadow: ShadowContext | null;
733
+ shadowSibling: NodePositionStep | null;
734
+ formattingContext: FormattingContext | null;
735
+ fragmentIndex: number;
736
+ };
737
+ type NodePosition = {
738
+ steps: NodePositionStep[];
739
+ offsetInNode: number;
740
+ after: boolean;
741
+ preprocessedTextContent: Diff.Change[] | null;
742
+ };
743
+ /**
744
+ * Handling of purely whitespace sequences between blocks
745
+ * @enum {number}
746
+ */
747
+ enum Whitespace {
748
+ /**
749
+ * Whitespace sequence between blocks is ignored
750
+ */
751
+ IGNORE = 0,
752
+ /**
753
+ * Whitespace sequence between blocks is ignored unless it containes newline
754
+ */
755
+ NEWLINE = 1,
756
+ /**
757
+ * Whitespace sequence between blocks is preserved
758
+ */
759
+ PRESERVE = 2
760
+ }
761
+ interface Container {
762
+ left: number;
763
+ top: number;
764
+ marginLeft: number;
765
+ marginRight: number;
766
+ marginTop: number;
767
+ marginBottom: number;
768
+ borderLeft: number;
769
+ borderRight: number;
770
+ borderTop: number;
771
+ borderBottom: number;
772
+ paddingLeft: number;
773
+ paddingRight: number;
774
+ paddingTop: number;
775
+ paddingBottom: number;
776
+ width: number;
777
+ height: number;
778
+ originX: number;
779
+ originY: number;
780
+ exclusions: GeometryUtil.Shape[];
781
+ innerShape: GeometryUtil.Shape;
782
+ computedBlockSize: number;
783
+ snapWidth: number;
784
+ snapHeight: number;
785
+ snapOffsetX: number;
786
+ snapOffsetY: number;
787
+ vertical: boolean;
788
+ rtl: boolean;
789
+ element: Element;
790
+ getInsetTop(): number;
791
+ getInsetBottom(): number;
792
+ getInsetLeft(): number;
793
+ getInsetRight(): number;
794
+ getInsetBefore(): number;
795
+ getInsetAfter(): number;
796
+ getInsetStart(): number;
797
+ getInsetEnd(): number;
798
+ getBeforeEdge(box: ClientRect): number;
799
+ getAfterEdge(box: ClientRect): number;
800
+ getStartEdge(box: ClientRect): number;
801
+ getEndEdge(box: ClientRect): number;
802
+ getInlineSize(box: ClientRect): number;
803
+ getBoxSize(box: ClientRect): number;
804
+ getBoxDir(): number;
805
+ getInlineDir(): number;
806
+ copyFrom(other: Container): void;
807
+ setVerticalPosition(top: number, height: number): void;
808
+ setHorizontalPosition(left: number, width: number): void;
809
+ setBlockPosition(start: number, extent: number): void;
810
+ setInlinePosition(start: number, extent: number): void;
811
+ clear(): void;
812
+ getInnerShape(): GeometryUtil.Shape;
813
+ getInnerRect(): GeometryUtil.Rect;
814
+ getPaddingRect(): GeometryUtil.Rect;
815
+ getOuterShape(outerShapeProp: Css.Val, context: Exprs.Context): GeometryUtil.Shape;
816
+ getOuterRect(): GeometryUtil.Rect;
817
+ }
818
+ /**
819
+ * @enum {number}
820
+ */
821
+ enum ShadowType {
822
+ NONE = 0,
823
+ CONTENT = 1,
824
+ ROOTLESS = 2,
825
+ ROOTED = 3
826
+ }
827
+ /**
828
+ * Data about shadow tree instance.
829
+ */
830
+ interface ShadowContext {
831
+ readonly owner: Element;
832
+ readonly root: Element;
833
+ readonly xmldoc: XmlDoc.XMLDocHolder;
834
+ readonly parentShadow: ShadowContext;
835
+ subShadow: ShadowContext;
836
+ readonly type: Vtree.ShadowType;
837
+ readonly styler: CssStyler.AbstractStyler;
838
+ equals(other: ShadowContext): boolean;
839
+ }
840
+ /**
841
+ * Information about :first-letter or :first-line pseudoelements
842
+ * @param count 0 - first-letter, 1 or more - first line(s)
843
+ */
844
+ interface FirstPseudo {
845
+ readonly outer: FirstPseudo;
846
+ readonly count: number;
847
+ }
848
+ /**
849
+ * NodeContext represents a position in the document + layout-related
850
+ * information attached to it. When after=false and offsetInNode=0, the
851
+ * position is inside the element (node), but just before its first child.
852
+ * When offsetInNode>0 it represents offset in the textual content of the
853
+ * node. When after=true it represents position right after the last child
854
+ * of the node. boxOffset is incremented by 1 for any valid node position.
855
+ */
856
+ interface NodeContext {
857
+ offsetInNode: number;
858
+ after: boolean;
859
+ shadowType: ShadowType;
860
+ shadowContext: Vtree.ShadowContext;
861
+ nodeShadow: Vtree.ShadowContext;
862
+ shadowSibling: NodeContext;
863
+ shared: boolean;
864
+ inline: boolean;
865
+ overflow: boolean;
866
+ breakPenalty: number;
867
+ display: string | null;
868
+ floatReference: PageFloats.FloatReference;
869
+ floatSide: string | null;
870
+ clearSide: string | null;
871
+ floatMinWrapBlock: Css.Numeric | null;
872
+ columnSpan: Css.Val | null;
873
+ verticalAlign: string;
874
+ captionSide: string;
875
+ inlineBorderSpacing: number;
876
+ blockBorderSpacing: number;
877
+ flexContainer: boolean;
878
+ whitespace: Whitespace;
879
+ hyphenateCharacter: string | null;
880
+ breakWord: boolean;
881
+ establishesBFC: boolean;
882
+ containingBlockForAbsolute: boolean;
883
+ breakBefore: string | null;
884
+ breakAfter: string | null;
885
+ viewNode: Node;
886
+ clearSpacer: Node;
887
+ inheritedProps: {
888
+ [key: string]: number | string | Css.Val;
889
+ };
890
+ vertical: boolean;
891
+ direction: string;
892
+ firstPseudo: FirstPseudo;
893
+ lang: string | null;
894
+ preprocessedTextContent: Diff.Change[] | null;
895
+ formattingContext: FormattingContext;
896
+ repeatOnBreak: string | null;
897
+ pluginProps: {
898
+ [key: string]: string | number | undefined | null | (number | null)[];
899
+ };
900
+ fragmentIndex: number;
901
+ afterIfContinues: Selectors.AfterIfContinues;
902
+ footnotePolicy: Css.Ident | null;
903
+ pageType: string | null;
904
+ sourceNode: Node;
905
+ parent: NodeContext;
906
+ boxOffset: number;
907
+ resetView(): void;
908
+ modify(): NodeContext;
909
+ copy(): NodeContext;
910
+ clone(): NodeContext;
911
+ toNodePositionStep(): NodePositionStep;
912
+ toNodePosition(): NodePosition;
913
+ isInsideBFC(): boolean;
914
+ getContainingBlockForAbsolute(): NodeContext;
915
+ belongsTo(formattingContext: FormattingContext): boolean;
916
+ }
917
+ interface ChunkPosition {
918
+ floats: NodePosition[];
919
+ primary: NodePosition;
920
+ clone(): ChunkPosition;
921
+ isSamePosition(other: ChunkPosition): boolean;
922
+ }
923
+ type ExprContentListener = (p1: Exprs.Val, p2: string, p3: Document) => Node | null;
924
+ }
925
+ export declare namespace XmlDoc {
926
+ interface XMLDocHolder {
927
+ lang: string | null;
928
+ totalOffset: number;
929
+ root: Element;
930
+ body: Element;
931
+ head: Element;
932
+ last: Element;
933
+ lastOffset: number;
934
+ idMap: {
935
+ [key: string]: Element;
936
+ };
937
+ readonly store: XMLDocStore;
938
+ readonly url: string;
939
+ readonly document: Document;
940
+ doc(): NodeList;
941
+ getElementOffset(element: Element): number;
942
+ getNodeOffset(srcNode: Node, offsetInNode: number, after: boolean): number;
943
+ getTotalOffset(): number;
944
+ /**
945
+ * @return last node such that its offset is less or equal to the given
946
+ */
947
+ getNodeByOffset(offset: number): Node;
948
+ /**
949
+ * Get element by URL in the source document(s). URL must be in either '#id'
950
+ * or 'url#id' form.
951
+ */
952
+ getElement(url: string): Element | null;
953
+ }
954
+ interface Predicate {
955
+ readonly fn: (p1: Node) => boolean;
956
+ check(node: Node): boolean;
957
+ withAttribute(name: string, value: string): Predicate;
958
+ withChild(name: string, opt_childPredicate?: Predicate): Predicate;
959
+ }
960
+ interface NodeList {
961
+ readonly nodes: Node[];
962
+ asArray(): Node[];
963
+ size(): number;
964
+ /**
965
+ * Filter with predicate
966
+ */
967
+ predicate(pr: Predicate): NodeList;
968
+ forEachNode(fn: (p1: Node, p2: (p1: Node) => void) => void): NodeList;
969
+ forEach<T>(fn: (p1: Node) => T): T[];
970
+ forEachNonNull<T>(fn: (p1: Node) => T): T[];
971
+ child(tag: string): NodeList;
972
+ childElements(): NodeList;
973
+ attribute(name: string): (string | null)[];
974
+ textContent(): (string | null)[];
975
+ }
976
+ type XMLDocStore = Net.ResourceStore<XMLDocHolder>;
977
+ }