@vivliostyle/core 2.24.3 → 2.25.1

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 +130 -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,167 +1,167 @@
1
- import * as Base from "./base";
2
- import * as Constants from "./constants";
3
- import * as Epub from "./epub";
4
- import * as Exprs from "./exprs";
5
- import * as Font from "./font";
6
- import * as Task from "./task";
7
- import * as Vgen from "./vgen";
8
- import * as Vtree from "./vtree";
9
- export type Action = (p1: Base.JSON) => Task.Result<boolean>;
10
- export type ViewportSize = {
11
- marginLeft: number;
12
- marginRight: number;
13
- marginTop: number;
14
- marginBottom: number;
15
- width: number;
16
- height: number;
17
- };
18
- export declare const VIEWPORT_STATUS_ATTRIBUTE = "data-vivliostyle-viewer-status";
19
- export declare const VIEWPORT_SPREAD_VIEW_ATTRIBUTE = "data-vivliostyle-spread-view";
20
- /**
21
- * @enum {string}
22
- */
23
- export declare enum PageViewMode {
24
- SINGLE_PAGE = "singlePage",
25
- SPREAD = "spread",
26
- AUTO_SPREAD = "autoSpread"
27
- }
28
- export type SingleDocumentParam = {
29
- url: string;
30
- startPage: number | null;
31
- skipPagesBefore: number | null;
32
- };
33
- export declare class AdaptiveViewer {
34
- readonly window: Window;
35
- readonly viewportElement: HTMLElement;
36
- readonly instanceId: string;
37
- readonly callbackFn: (p1: Base.JSON) => void;
38
- fontMapper: Font.Mapper;
39
- kick: () => void;
40
- sendCommand: (p1: Base.JSON | string) => void;
41
- resizeListener: () => void;
42
- hyperlinkListener: Base.EventListener;
43
- pageRuleStyleElement: HTMLElement;
44
- pageSheetSizeAlreadySet: boolean;
45
- renderTask: Task.Task | null;
46
- actions: {
47
- [key: string]: Action;
48
- };
49
- readyState: Constants.ReadyState;
50
- packageURL: string[];
51
- opf: Epub.OPFDoc;
52
- haveZipMetadata: boolean;
53
- touchActive: boolean;
54
- touchX: number;
55
- touchY: number;
56
- needResize: boolean;
57
- resized: boolean;
58
- needRefresh: boolean;
59
- viewportSize: ViewportSize | null;
60
- currentPage: Vtree.Page;
61
- currentSpread: Vtree.Spread | null;
62
- pagePosition: Epub.Position | null;
63
- fontSize: number;
64
- zoom: number;
65
- fitToScreen: boolean;
66
- pageViewMode: PageViewMode;
67
- waitForLoading: boolean;
68
- renderAllPages: boolean;
69
- pref: Exprs.Preferences;
70
- pageSizes: {
71
- width: number;
72
- height: number;
73
- }[];
74
- pixelRatio: number;
75
- pixelRatioLimit: number;
76
- viewport: Vgen.Viewport | null;
77
- opfView: Epub.OPFView;
78
- constructor(window: Window, viewportElement: HTMLElement, instanceId: string, callbackFn: (p1: Base.JSON) => void);
79
- private init;
80
- addLogListeners(): void;
81
- private callback;
82
- /**
83
- * Set readyState and notify to listeners
84
- */
85
- setReadyState(readyState: Constants.ReadyState): void;
86
- loadPublication(command: Base.JSON): Task.Result<boolean>;
87
- loadXML(command: Base.JSON): Task.Result<boolean>;
88
- private render;
89
- private resolveLength;
90
- configure(command: Base.JSON): Task.Result<boolean>;
91
- configurePlugins(command: Base.JSON): void;
92
- /**
93
- * Refresh view when a currently displayed page is replaced (by re-layout
94
- * caused by cross reference resolutions)
95
- */
96
- pageReplacedListener(evt: Base.Event): void;
97
- /**
98
- * Iterate through currently displayed pages and do something
99
- */
100
- private forCurrentPages;
101
- private removePageListeners;
102
- /**
103
- * Hide current pages (this.currentPage, this.currentSpread)
104
- */
105
- private hidePages;
106
- private showSinglePage;
107
- private showPage;
108
- private showSpread;
109
- private reportPosition;
110
- private createViewport;
111
- private resolveSpreadView;
112
- private updateSpreadView;
113
- private sizeIsGood;
114
- private setPageSize;
115
- private setPageSizePageRules;
116
- removePageSizePageRules(): void;
117
- private reset;
118
- /**
119
- * Show current page or spread depending on the setting
120
- * (this.pref.spreadView).
121
- * @param sync If true, get the necessary page synchronously (not waiting
122
- * another rendering task)
123
- */
124
- private showCurrent;
125
- setPageZoom(page: Vtree.Page): void;
126
- setSpreadZoom(spread: Vtree.Spread): void;
127
- /**
128
- * @returns adjusted zoom factor
129
- */
130
- getAdjustedZoomFactor(pageDimension: {
131
- width: number;
132
- height: number;
133
- }): number;
134
- /**
135
- * Returns width and height of the spread, including the margin between pages.
136
- */
137
- getSpreadDimensions(spread: Vtree.Spread): {
138
- width: number;
139
- height: number;
140
- };
141
- /**
142
- * Returns zoom factor corresponding to the specified zoom type.
143
- */
144
- queryZoomFactor(type: ZoomType): number;
145
- /**
146
- * @returns zoom factor to fit inside viewport
147
- */
148
- calculateZoomFactorToFitInsideViewPort(pageDimension: {
149
- width: number;
150
- height: number;
151
- }): number;
152
- private cancelRenderingTask;
153
- resize(): Task.Result<boolean>;
154
- private sendLocationNotification;
155
- getCurrentPageProgression(): Constants.PageProgression | null;
156
- moveTo(command: Base.JSON): Task.Result<boolean>;
157
- showTOC(command: Base.JSON): Task.Result<boolean>;
158
- runCommand(command: Base.JSON): Task.Result<boolean>;
159
- initEmbed(cmd: Base.JSON | string): void;
160
- }
161
- /**
162
- * @enum {string}
163
- */
164
- export declare enum ZoomType {
165
- FIT_INSIDE_VIEWPORT = "fit inside viewport"
166
- }
167
- export declare function maybeParse(cmd: any): Base.JSON;
1
+ import * as Base from "./base";
2
+ import * as Constants from "./constants";
3
+ import * as Epub from "./epub";
4
+ import * as Exprs from "./exprs";
5
+ import * as Font from "./font";
6
+ import * as Task from "./task";
7
+ import * as Vgen from "./vgen";
8
+ import * as Vtree from "./vtree";
9
+ export type Action = (p1: Base.JSON) => Task.Result<boolean>;
10
+ export type ViewportSize = {
11
+ marginLeft: number;
12
+ marginRight: number;
13
+ marginTop: number;
14
+ marginBottom: number;
15
+ width: number;
16
+ height: number;
17
+ };
18
+ export declare const VIEWPORT_STATUS_ATTRIBUTE = "data-vivliostyle-viewer-status";
19
+ export declare const VIEWPORT_SPREAD_VIEW_ATTRIBUTE = "data-vivliostyle-spread-view";
20
+ /**
21
+ * @enum {string}
22
+ */
23
+ export declare enum PageViewMode {
24
+ SINGLE_PAGE = "singlePage",
25
+ SPREAD = "spread",
26
+ AUTO_SPREAD = "autoSpread"
27
+ }
28
+ export type SingleDocumentParam = {
29
+ url: string;
30
+ startPage: number | null;
31
+ skipPagesBefore: number | null;
32
+ };
33
+ export declare class AdaptiveViewer {
34
+ readonly window: Window;
35
+ readonly viewportElement: HTMLElement;
36
+ readonly instanceId: string;
37
+ readonly callbackFn: (p1: Base.JSON) => void;
38
+ fontMapper: Font.Mapper;
39
+ kick: () => void;
40
+ sendCommand: (p1: Base.JSON | string) => void;
41
+ resizeListener: () => void;
42
+ hyperlinkListener: Base.EventListener;
43
+ pageRuleStyleElement: HTMLElement;
44
+ pageSheetSizeAlreadySet: boolean;
45
+ renderTask: Task.Task | null;
46
+ actions: {
47
+ [key: string]: Action;
48
+ };
49
+ readyState: Constants.ReadyState;
50
+ packageURL: string[];
51
+ opf: Epub.OPFDoc;
52
+ haveZipMetadata: boolean;
53
+ touchActive: boolean;
54
+ touchX: number;
55
+ touchY: number;
56
+ needResize: boolean;
57
+ resized: boolean;
58
+ needRefresh: boolean;
59
+ viewportSize: ViewportSize | null;
60
+ currentPage: Vtree.Page;
61
+ currentSpread: Vtree.Spread | null;
62
+ pagePosition: Epub.Position | null;
63
+ fontSize: number;
64
+ zoom: number;
65
+ fitToScreen: boolean;
66
+ pageViewMode: PageViewMode;
67
+ waitForLoading: boolean;
68
+ renderAllPages: boolean;
69
+ pref: Exprs.Preferences;
70
+ pageSizes: {
71
+ width: number;
72
+ height: number;
73
+ }[];
74
+ pixelRatio: number;
75
+ pixelRatioLimit: number;
76
+ viewport: Vgen.Viewport | null;
77
+ opfView: Epub.OPFView;
78
+ constructor(window: Window, viewportElement: HTMLElement, instanceId: string, callbackFn: (p1: Base.JSON) => void);
79
+ private init;
80
+ addLogListeners(): void;
81
+ private callback;
82
+ /**
83
+ * Set readyState and notify to listeners
84
+ */
85
+ setReadyState(readyState: Constants.ReadyState): void;
86
+ loadPublication(command: Base.JSON): Task.Result<boolean>;
87
+ loadXML(command: Base.JSON): Task.Result<boolean>;
88
+ private render;
89
+ private resolveLength;
90
+ configure(command: Base.JSON): Task.Result<boolean>;
91
+ configurePlugins(command: Base.JSON): void;
92
+ /**
93
+ * Refresh view when a currently displayed page is replaced (by re-layout
94
+ * caused by cross reference resolutions)
95
+ */
96
+ pageReplacedListener(evt: Base.Event): void;
97
+ /**
98
+ * Iterate through currently displayed pages and do something
99
+ */
100
+ private forCurrentPages;
101
+ private removePageListeners;
102
+ /**
103
+ * Hide current pages (this.currentPage, this.currentSpread)
104
+ */
105
+ private hidePages;
106
+ private showSinglePage;
107
+ private showPage;
108
+ private showSpread;
109
+ private reportPosition;
110
+ private createViewport;
111
+ private resolveSpreadView;
112
+ private updateSpreadView;
113
+ private sizeIsGood;
114
+ private setPageSize;
115
+ private setPageSizePageRules;
116
+ removePageSizePageRules(): void;
117
+ private reset;
118
+ /**
119
+ * Show current page or spread depending on the setting
120
+ * (this.pref.spreadView).
121
+ * @param sync If true, get the necessary page synchronously (not waiting
122
+ * another rendering task)
123
+ */
124
+ private showCurrent;
125
+ setPageZoom(page: Vtree.Page): void;
126
+ setSpreadZoom(spread: Vtree.Spread): void;
127
+ /**
128
+ * @returns adjusted zoom factor
129
+ */
130
+ getAdjustedZoomFactor(pageDimension: {
131
+ width: number;
132
+ height: number;
133
+ }): number;
134
+ /**
135
+ * Returns width and height of the spread, including the margin between pages.
136
+ */
137
+ getSpreadDimensions(spread: Vtree.Spread): {
138
+ width: number;
139
+ height: number;
140
+ };
141
+ /**
142
+ * Returns zoom factor corresponding to the specified zoom type.
143
+ */
144
+ queryZoomFactor(type: ZoomType): number;
145
+ /**
146
+ * @returns zoom factor to fit inside viewport
147
+ */
148
+ calculateZoomFactorToFitInsideViewPort(pageDimension: {
149
+ width: number;
150
+ height: number;
151
+ }): number;
152
+ private cancelRenderingTask;
153
+ resize(): Task.Result<boolean>;
154
+ private sendLocationNotification;
155
+ getCurrentPageProgression(): Constants.PageProgression | null;
156
+ moveTo(command: Base.JSON): Task.Result<boolean>;
157
+ showTOC(command: Base.JSON): Task.Result<boolean>;
158
+ runCommand(command: Base.JSON): Task.Result<boolean>;
159
+ initEmbed(cmd: Base.JSON | string): void;
160
+ }
161
+ /**
162
+ * @enum {string}
163
+ */
164
+ export declare enum ZoomType {
165
+ FIT_INSIDE_VIEWPORT = "fit inside viewport"
166
+ }
167
+ export declare function maybeParse(cmd: any): Base.JSON;
@@ -1,21 +1,21 @@
1
- /**
2
- * Copyright 2018 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 Asserts - Assertion utilities.
18
- */
19
- /** */
20
- export declare function assert(cond: any): void;
21
- export declare function fail(message: string): void;
1
+ /**
2
+ * Copyright 2018 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 Asserts - Assertion utilities.
18
+ */
19
+ /** */
20
+ export declare function assert(cond: any): void;
21
+ export declare function fail(message: string): void;