@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,25 +1,25 @@
1
- /**
2
- * Copyright 2015 Trim-marks Inc.
3
- * Copyright 2019 Vivliostyle Foundation
4
- *
5
- * Vivliostyle.js is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * Vivliostyle.js is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with Vivliostyle.js. If not, see <http://www.gnu.org/licenses/>.
17
- *
18
- * @fileoverview Urls - URL Utilities
19
- */
20
- /**
21
- * transform all urls in attributeValue using documentURLTransformer.
22
- *
23
- * @returns transformed attributeValue
24
- */
25
- export declare const transformURIs: (attributeValue: any, baseUrl: any, documentURLTransformer: any) => any;
1
+ /**
2
+ * Copyright 2015 Trim-marks Inc.
3
+ * Copyright 2019 Vivliostyle Foundation
4
+ *
5
+ * Vivliostyle.js is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Affero General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * Vivliostyle.js is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with Vivliostyle.js. If not, see <http://www.gnu.org/licenses/>.
17
+ *
18
+ * @fileoverview Urls - URL Utilities
19
+ */
20
+ /**
21
+ * transform all urls in attributeValue using documentURLTransformer.
22
+ *
23
+ * @returns transformed attributeValue
24
+ */
25
+ export declare const transformURIs: (attributeValue: any, baseUrl: any, documentURLTransformer: any) => any;
@@ -1,213 +1,213 @@
1
- import * as Base from "./base";
2
- import * as Css from "./css";
3
- import * as CssCascade from "./css-cascade";
4
- import * as CssStyler from "./css-styler";
5
- import * as Exprs from "./exprs";
6
- import * as Font from "./font";
7
- import * as Task from "./task";
8
- import * as TaskUtil from "./task-util";
9
- import * as Vtree from "./vtree";
10
- import { XmlDoc } from "./types";
11
- export type CustomRenderer = (p1: Element, p2: Element, p3: {
12
- [key: string]: Css.Val;
13
- }) => Task.Result<Element>;
14
- export interface CustomRendererFactory {
15
- makeCustomRenderer(xmldoc: XmlDoc.XMLDocHolder): CustomRenderer;
16
- }
17
- /**
18
- * Creates an epubReadingSystem object in the iframe.contentWindow.navigator
19
- * when load event fires.
20
- */
21
- export declare function initIFrame(iframe: HTMLIFrameElement): void;
22
- export interface StylerProducer {
23
- getStylerForDoc(xmldoc: XmlDoc.XMLDocHolder): CssStyler.AbstractStyler;
24
- }
25
- export declare class ViewFactory extends Base.SimpleEventTarget implements Vtree.LayoutContext {
26
- readonly flowName: string;
27
- readonly context: Exprs.Context;
28
- readonly viewport: Viewport;
29
- readonly styler: CssStyler.Styler;
30
- readonly regionIds: string[];
31
- readonly xmldoc: XmlDoc.XMLDocHolder;
32
- readonly docFaces: Font.DocumentFaces;
33
- readonly footnoteStyle: CssCascade.ElementStyle;
34
- readonly stylerProducer: StylerProducer;
35
- readonly page: Vtree.Page;
36
- readonly customRenderer: CustomRenderer;
37
- readonly fallbackMap: {
38
- [key: string]: string;
39
- };
40
- readonly documentURLTransformer: Base.DocumentURLTransformer;
41
- private static SVG_URL_ATTRIBUTES;
42
- document: Document;
43
- exprContentListener: Vtree.ExprContentListener;
44
- nodeContext: Vtree.NodeContext | null;
45
- viewRoot: Element | null;
46
- isFootnote: boolean;
47
- sourceNode: Node | null;
48
- offsetInNode: number;
49
- viewNode: Node | null;
50
- constructor(flowName: string, context: Exprs.Context, viewport: Viewport, styler: CssStyler.Styler, regionIds: string[], xmldoc: XmlDoc.XMLDocHolder, docFaces: Font.DocumentFaces, footnoteStyle: CssCascade.ElementStyle, stylerProducer: StylerProducer, page: Vtree.Page, customRenderer: CustomRenderer, fallbackMap: {
51
- [key: string]: string;
52
- }, documentURLTransformer: Base.DocumentURLTransformer);
53
- /** @override */
54
- clone(): Vtree.LayoutContext;
55
- createPseudoelementShadow(element: Element, isRoot: boolean, cascStyle: CssCascade.ElementStyle, computedStyle: {
56
- [key: string]: Css.Val;
57
- }, styler: CssStyler.AbstractStyler, context: Exprs.Context, parentShadow: Vtree.ShadowContext, subShadow: Vtree.ShadowContext): Vtree.ShadowContext;
58
- getPseudoMap(cascStyle: CssCascade.ElementStyle, regionIds: string[], isFootnote: boolean, nodeContext: Vtree.NodeContext, context: Exprs.Context): CssCascade.ElementStyleMap;
59
- createRefShadow(href: string, type: Vtree.ShadowType, element: Element, parentShadow: Vtree.ShadowContext, subShadow: Vtree.ShadowContext): Task.Result<Vtree.ShadowContext>;
60
- createShadows(element: Element, isRoot: any, cascStyle: CssCascade.ElementStyle, computedStyle: {
61
- [key: string]: Css.Val;
62
- }, styler: CssStyler.AbstractStyler, context: Exprs.Context, shadowContext: Vtree.ShadowContext): Task.Result<Vtree.ShadowContext>;
63
- /** @override */
64
- setViewRoot(viewRoot: Element, isFootnote: boolean): void;
65
- /**
66
- * @return vertical
67
- */
68
- computeStyle(vertical: boolean, rtl: boolean, style: CssCascade.ElementStyle, computedStyle: {
69
- [key: string]: Css.Val;
70
- }): boolean;
71
- private inheritFromSourceParent;
72
- resolveURL(url: string): string;
73
- inheritLangAttribute(): void;
74
- transferPolyfilledInheritedProps(computedStyle: {
75
- [key: string]: Css.Val;
76
- }): void;
77
- resolveFormattingContext(nodeContext: Vtree.NodeContext, firstTime: boolean, display: Css.Ident, position: Css.Ident, float: Css.Ident, isRoot: boolean): void;
78
- /**
79
- * @return holding true if children should be processed
80
- */
81
- private createElementView;
82
- /**
83
- * Check if the current element is inside multi-column element
84
- * that is not root or body element in the source tree.
85
- *
86
- * Note: vivliostyle handles multi-column on the root and body element on its own,
87
- * but leaves it to the browser to handle other multi-column.
88
- * This check is for such non-root/body multi-column.
89
- */
90
- private isInsideNonRootMultiColumn;
91
- /**
92
- * Check if the current position is at a forced or unforced break
93
- * (Fix for Issue #690)
94
- *
95
- * @param nodeContext
96
- * @returns forced break type, or "auto" for unforced break, or null for not break
97
- */
98
- private getBreakTypeAt;
99
- private processAfterIfcontinues;
100
- isSVGUrlAttribute(attributeName: string): boolean;
101
- modifyElemDimensionWithImageResolution(images: {
102
- image: HTMLElement;
103
- element: HTMLElement;
104
- fetcher: TaskUtil.Fetcher<string>;
105
- }[], imageResolution: number, computedStyle: {
106
- [key: string]: Css.Val;
107
- }, isVertical: boolean): void;
108
- private preprocessElementStyle;
109
- private findAndProcessRepeatingElements;
110
- private processRepeatOnBreak;
111
- private createTextNodeView;
112
- private preprocessTextContent;
113
- /**
114
- * @return holding true if children should be processed
115
- */
116
- createNodeView(firstTime: boolean, atUnforcedBreak: boolean): Task.Result<boolean>;
117
- /** @override */
118
- setCurrent(nodeContext: Vtree.NodeContext, firstTime: boolean, atUnforcedBreak?: boolean): Task.Result<boolean>;
119
- processShadowContent(pos: Vtree.NodeContext): Vtree.NodeContext;
120
- private nextPositionInTree;
121
- isTransclusion(element: Element, elementStyle: CssCascade.ElementStyle, transclusionType: string | null): boolean;
122
- /** @override */
123
- nextInTree(position: Vtree.NodeContext, atUnforcedBreak?: boolean): Task.Result<Vtree.NodeContext>;
124
- addImageFetchers(bg: Css.Val): void;
125
- applyComputedStyles(target: Element, computedStyle: {
126
- [key: string]: Css.Val;
127
- }): void;
128
- /**
129
- * Get "lh" unit size in px
130
- */
131
- private getLineHeightUnitSize;
132
- /**
133
- * Fix ruby text font size.
134
- * Issue #673: Minimum font size setting in Chrome causes ruby font size problem
135
- * @param target the rt element
136
- * @param value the font-size value
137
- * @returns true if the font-size fix is done
138
- */
139
- fixRubyTextFontSize(target: Element, value: Css.Val): boolean;
140
- /** @override */
141
- applyPseudoelementStyle(nodeContext: Vtree.NodeContext, pseudoName: string, target: Element): void;
142
- /** @override */
143
- peelOff(nodeContext: Vtree.NodeContext, nodeOffset: number): Task.Result<Vtree.NodeContext>;
144
- createElement(ns: string, tag: string): Element;
145
- /** @override */
146
- applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): boolean;
147
- /** @override */
148
- processFragmentedBlockEdge(nodeContext: Vtree.NodeContext): void;
149
- private fixClonedBoxDecorationOverflow;
150
- private createChildAnonymousBlockIfNeeded;
151
- /** @override */
152
- convertLengthToPx(numeric: Css.Numeric, viewNode: Node, clientLayout: Vtree.ClientLayout): number | Css.Numeric;
153
- /**
154
- * Returns if two NodePositionStep are equivalent.
155
- */
156
- isSameNodePositionStep(step1: Vtree.NodePositionStep, step2: Vtree.NodePositionStep): boolean;
157
- /** @override */
158
- isSameNodePosition(nodePosition1: Vtree.NodePosition, nodePosition2: Vtree.NodePosition): boolean;
159
- isPseudoelement(elem: any): boolean;
160
- }
161
- export declare const propertiesNotPassedToDOM: {
162
- "float-min-wrap-block": boolean;
163
- "float-reference": boolean;
164
- "flow-into": boolean;
165
- "flow-linger": boolean;
166
- "flow-options": boolean;
167
- "flow-priority": boolean;
168
- "footnote-policy": boolean;
169
- "margin-break": boolean;
170
- page: boolean;
171
- };
172
- export declare class DefaultClientLayout implements Vtree.ClientLayout {
173
- layoutBox: Element;
174
- window: Window;
175
- scaleRatio: number;
176
- constructor(viewport: Viewport);
177
- private scaleRect;
178
- private subtractOffsets;
179
- /** @override */
180
- getRangeClientRects(range: Range): Vtree.ClientRect[];
181
- /** @override */
182
- getElementClientRect(element: Element): Vtree.ClientRect;
183
- /** @override */
184
- getElementComputedStyle(element: Element): CSSStyleDeclaration;
185
- }
186
- export declare class Viewport {
187
- readonly window: Window;
188
- readonly fontSize: number;
189
- readonly pixelRatio: number;
190
- document: Document;
191
- root: HTMLElement;
192
- private outerZoomBox;
193
- contentContainer: HTMLElement;
194
- layoutBox: Element;
195
- width: number;
196
- height: number;
197
- constructor(window: Window, fontSize: number, pixelRatio: number, opt_root?: HTMLElement, opt_width?: number, opt_height?: number);
198
- /**
199
- * Reset zoom.
200
- */
201
- resetZoom(): void;
202
- /**
203
- * Zoom viewport.
204
- * @param width Overall width of contents before scaling (px)
205
- * @param height Overall height of contents before scaling (px)
206
- * @param scale Factor to which the viewport will be scaled.
207
- */
208
- zoom(width: number, height: number, scale: number): void;
209
- /**
210
- * Remove all pages inside the viewport.
211
- */
212
- clear(): void;
213
- }
1
+ import * as Base from "./base";
2
+ import * as Css from "./css";
3
+ import * as CssCascade from "./css-cascade";
4
+ import * as CssStyler from "./css-styler";
5
+ import * as Exprs from "./exprs";
6
+ import * as Font from "./font";
7
+ import * as Task from "./task";
8
+ import * as TaskUtil from "./task-util";
9
+ import * as Vtree from "./vtree";
10
+ import { XmlDoc } from "./types";
11
+ export type CustomRenderer = (p1: Element, p2: Element, p3: {
12
+ [key: string]: Css.Val;
13
+ }) => Task.Result<Element>;
14
+ export interface CustomRendererFactory {
15
+ makeCustomRenderer(xmldoc: XmlDoc.XMLDocHolder): CustomRenderer;
16
+ }
17
+ /**
18
+ * Creates an epubReadingSystem object in the iframe.contentWindow.navigator
19
+ * when load event fires.
20
+ */
21
+ export declare function initIFrame(iframe: HTMLIFrameElement): void;
22
+ export interface StylerProducer {
23
+ getStylerForDoc(xmldoc: XmlDoc.XMLDocHolder): CssStyler.AbstractStyler;
24
+ }
25
+ export declare class ViewFactory extends Base.SimpleEventTarget implements Vtree.LayoutContext {
26
+ readonly flowName: string;
27
+ readonly context: Exprs.Context;
28
+ readonly viewport: Viewport;
29
+ readonly styler: CssStyler.Styler;
30
+ readonly regionIds: string[];
31
+ readonly xmldoc: XmlDoc.XMLDocHolder;
32
+ readonly docFaces: Font.DocumentFaces;
33
+ readonly footnoteStyle: CssCascade.ElementStyle;
34
+ readonly stylerProducer: StylerProducer;
35
+ readonly page: Vtree.Page;
36
+ readonly customRenderer: CustomRenderer;
37
+ readonly fallbackMap: {
38
+ [key: string]: string;
39
+ };
40
+ readonly documentURLTransformer: Base.DocumentURLTransformer;
41
+ private static SVG_URL_ATTRIBUTES;
42
+ document: Document;
43
+ exprContentListener: Vtree.ExprContentListener;
44
+ nodeContext: Vtree.NodeContext | null;
45
+ viewRoot: Element | null;
46
+ isFootnote: boolean;
47
+ sourceNode: Node | null;
48
+ offsetInNode: number;
49
+ viewNode: Node | null;
50
+ constructor(flowName: string, context: Exprs.Context, viewport: Viewport, styler: CssStyler.Styler, regionIds: string[], xmldoc: XmlDoc.XMLDocHolder, docFaces: Font.DocumentFaces, footnoteStyle: CssCascade.ElementStyle, stylerProducer: StylerProducer, page: Vtree.Page, customRenderer: CustomRenderer, fallbackMap: {
51
+ [key: string]: string;
52
+ }, documentURLTransformer: Base.DocumentURLTransformer);
53
+ /** @override */
54
+ clone(): Vtree.LayoutContext;
55
+ createPseudoelementShadow(element: Element, isRoot: boolean, cascStyle: CssCascade.ElementStyle, computedStyle: {
56
+ [key: string]: Css.Val;
57
+ }, styler: CssStyler.AbstractStyler, context: Exprs.Context, parentShadow: Vtree.ShadowContext, subShadow: Vtree.ShadowContext): Vtree.ShadowContext;
58
+ getPseudoMap(cascStyle: CssCascade.ElementStyle, regionIds: string[], isFootnote: boolean, nodeContext: Vtree.NodeContext, context: Exprs.Context): CssCascade.ElementStyleMap;
59
+ createRefShadow(href: string, type: Vtree.ShadowType, element: Element, parentShadow: Vtree.ShadowContext, subShadow: Vtree.ShadowContext): Task.Result<Vtree.ShadowContext>;
60
+ createShadows(element: Element, isRoot: any, cascStyle: CssCascade.ElementStyle, computedStyle: {
61
+ [key: string]: Css.Val;
62
+ }, styler: CssStyler.AbstractStyler, context: Exprs.Context, shadowContext: Vtree.ShadowContext): Task.Result<Vtree.ShadowContext>;
63
+ /** @override */
64
+ setViewRoot(viewRoot: Element, isFootnote: boolean): void;
65
+ /**
66
+ * @return vertical
67
+ */
68
+ computeStyle(vertical: boolean, rtl: boolean, style: CssCascade.ElementStyle, computedStyle: {
69
+ [key: string]: Css.Val;
70
+ }): boolean;
71
+ private inheritFromSourceParent;
72
+ resolveURL(url: string): string;
73
+ inheritLangAttribute(): void;
74
+ transferPolyfilledInheritedProps(computedStyle: {
75
+ [key: string]: Css.Val;
76
+ }): void;
77
+ resolveFormattingContext(nodeContext: Vtree.NodeContext, firstTime: boolean, display: Css.Ident, position: Css.Ident, float: Css.Ident, isRoot: boolean): void;
78
+ /**
79
+ * @return holding true if children should be processed
80
+ */
81
+ private createElementView;
82
+ /**
83
+ * Check if the current element is inside multi-column element
84
+ * that is not root or body element in the source tree.
85
+ *
86
+ * Note: vivliostyle handles multi-column on the root and body element on its own,
87
+ * but leaves it to the browser to handle other multi-column.
88
+ * This check is for such non-root/body multi-column.
89
+ */
90
+ private isInsideNonRootMultiColumn;
91
+ /**
92
+ * Check if the current position is at a forced or unforced break
93
+ * (Fix for Issue #690)
94
+ *
95
+ * @param nodeContext
96
+ * @returns forced break type, or "auto" for unforced break, or null for not break
97
+ */
98
+ private getBreakTypeAt;
99
+ private processAfterIfcontinues;
100
+ isSVGUrlAttribute(attributeName: string): boolean;
101
+ modifyElemDimensionWithImageResolution(images: {
102
+ image: HTMLElement;
103
+ element: HTMLElement;
104
+ fetcher: TaskUtil.Fetcher<string>;
105
+ }[], imageResolution: number, computedStyle: {
106
+ [key: string]: Css.Val;
107
+ }, isVertical: boolean): void;
108
+ private preprocessElementStyle;
109
+ private findAndProcessRepeatingElements;
110
+ private processRepeatOnBreak;
111
+ private createTextNodeView;
112
+ private preprocessTextContent;
113
+ /**
114
+ * @return holding true if children should be processed
115
+ */
116
+ createNodeView(firstTime: boolean, atUnforcedBreak: boolean): Task.Result<boolean>;
117
+ /** @override */
118
+ setCurrent(nodeContext: Vtree.NodeContext, firstTime: boolean, atUnforcedBreak?: boolean): Task.Result<boolean>;
119
+ processShadowContent(pos: Vtree.NodeContext): Vtree.NodeContext;
120
+ private nextPositionInTree;
121
+ isTransclusion(element: Element, elementStyle: CssCascade.ElementStyle, transclusionType: string | null): boolean;
122
+ /** @override */
123
+ nextInTree(position: Vtree.NodeContext, atUnforcedBreak?: boolean): Task.Result<Vtree.NodeContext>;
124
+ addImageFetchers(bg: Css.Val): void;
125
+ applyComputedStyles(target: Element, computedStyle: {
126
+ [key: string]: Css.Val;
127
+ }): void;
128
+ /**
129
+ * Get "lh" unit size in px
130
+ */
131
+ private getLineHeightUnitSize;
132
+ /**
133
+ * Fix ruby text font size.
134
+ * Issue #673: Minimum font size setting in Chrome causes ruby font size problem
135
+ * @param target the rt element
136
+ * @param value the font-size value
137
+ * @returns true if the font-size fix is done
138
+ */
139
+ fixRubyTextFontSize(target: Element, value: Css.Val): boolean;
140
+ /** @override */
141
+ applyPseudoelementStyle(nodeContext: Vtree.NodeContext, pseudoName: string, target: Element): void;
142
+ /** @override */
143
+ peelOff(nodeContext: Vtree.NodeContext, nodeOffset: number): Task.Result<Vtree.NodeContext>;
144
+ createElement(ns: string, tag: string): Element;
145
+ /** @override */
146
+ applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): boolean;
147
+ /** @override */
148
+ processFragmentedBlockEdge(nodeContext: Vtree.NodeContext): void;
149
+ private fixClonedBoxDecorationOverflow;
150
+ private createChildAnonymousBlockIfNeeded;
151
+ /** @override */
152
+ convertLengthToPx(numeric: Css.Numeric, viewNode: Node, clientLayout: Vtree.ClientLayout): number | Css.Numeric;
153
+ /**
154
+ * Returns if two NodePositionStep are equivalent.
155
+ */
156
+ isSameNodePositionStep(step1: Vtree.NodePositionStep, step2: Vtree.NodePositionStep): boolean;
157
+ /** @override */
158
+ isSameNodePosition(nodePosition1: Vtree.NodePosition, nodePosition2: Vtree.NodePosition): boolean;
159
+ isPseudoelement(elem: any): boolean;
160
+ }
161
+ export declare const propertiesNotPassedToDOM: {
162
+ "float-min-wrap-block": boolean;
163
+ "float-reference": boolean;
164
+ "flow-into": boolean;
165
+ "flow-linger": boolean;
166
+ "flow-options": boolean;
167
+ "flow-priority": boolean;
168
+ "footnote-policy": boolean;
169
+ "margin-break": boolean;
170
+ page: boolean;
171
+ };
172
+ export declare class DefaultClientLayout implements Vtree.ClientLayout {
173
+ layoutBox: Element;
174
+ window: Window;
175
+ scaleRatio: number;
176
+ constructor(viewport: Viewport);
177
+ private scaleRect;
178
+ private subtractOffsets;
179
+ /** @override */
180
+ getRangeClientRects(range: Range): Vtree.ClientRect[];
181
+ /** @override */
182
+ getElementClientRect(element: Element): Vtree.ClientRect;
183
+ /** @override */
184
+ getElementComputedStyle(element: Element): CSSStyleDeclaration;
185
+ }
186
+ export declare class Viewport {
187
+ readonly window: Window;
188
+ readonly fontSize: number;
189
+ readonly pixelRatio: number;
190
+ document: Document;
191
+ root: HTMLElement;
192
+ private outerZoomBox;
193
+ contentContainer: HTMLElement;
194
+ layoutBox: Element;
195
+ width: number;
196
+ height: number;
197
+ constructor(window: Window, fontSize: number, pixelRatio: number, opt_root?: HTMLElement, opt_width?: number, opt_height?: number);
198
+ /**
199
+ * Reset zoom.
200
+ */
201
+ resetZoom(): void;
202
+ /**
203
+ * Zoom viewport.
204
+ * @param width Overall width of contents before scaling (px)
205
+ * @param height Overall height of contents before scaling (px)
206
+ * @param scale Factor to which the viewport will be scaled.
207
+ */
208
+ zoom(width: number, height: number, scale: number): void;
209
+ /**
210
+ * Remove all pages inside the viewport.
211
+ */
212
+ clear(): void;
213
+ }
@@ -1,19 +1,19 @@
1
- import * as Base from "./base";
2
- import * as Constants from "./constants";
3
- export declare let fontSize: number;
4
- export declare let touchActive: boolean;
5
- export declare let touchX: number;
6
- export declare let touchY: number;
7
- export declare let zoomActive: boolean;
8
- export declare let pinchDist: number;
9
- export declare let currentPageProgression: Constants.PageProgression;
10
- export declare function sendCommand(cmd: Base.JSON): void;
11
- export declare function navigateToLeftPage(): void;
12
- export declare function navigateToRightPage(): void;
13
- export declare function keydown(evt: KeyboardEvent): void;
14
- export declare function touch(evt: TouchEvent): void;
15
- export declare function callback(msg: Base.JSON): void;
16
- export declare function main(arg: any): void;
17
- export declare const viewerapp: {
18
- main: typeof main;
19
- };
1
+ import * as Base from "./base";
2
+ import * as Constants from "./constants";
3
+ export declare let fontSize: number;
4
+ export declare let touchActive: boolean;
5
+ export declare let touchX: number;
6
+ export declare let touchY: number;
7
+ export declare let zoomActive: boolean;
8
+ export declare let pinchDist: number;
9
+ export declare let currentPageProgression: Constants.PageProgression;
10
+ export declare function sendCommand(cmd: Base.JSON): void;
11
+ export declare function navigateToLeftPage(): void;
12
+ export declare function navigateToRightPage(): void;
13
+ export declare function keydown(evt: KeyboardEvent): void;
14
+ export declare function touch(evt: TouchEvent): void;
15
+ export declare function callback(msg: Base.JSON): void;
16
+ export declare function main(arg: any): void;
17
+ export declare const viewerapp: {
18
+ main: typeof main;
19
+ };