@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.
- package/lib/vivliostyle/adaptive-viewer.d.ts +167 -167
- package/lib/vivliostyle/asserts.d.ts +21 -21
- package/lib/vivliostyle/assets.d.ts +35 -35
- package/lib/vivliostyle/base.d.ts +189 -189
- package/lib/vivliostyle/break-position.d.ts +39 -39
- package/lib/vivliostyle/break.d.ts +112 -112
- package/lib/vivliostyle/cfi.d.ts +77 -77
- package/lib/vivliostyle/columns.d.ts +52 -52
- package/lib/vivliostyle/constants.d.ts +53 -53
- package/lib/vivliostyle/core-viewer.d.ts +240 -240
- package/lib/vivliostyle/counters.d.ts +130 -127
- package/lib/vivliostyle/css-cascade.d.ts +974 -954
- package/lib/vivliostyle/css-logical-util.d.ts +3 -3
- package/lib/vivliostyle/css-page.d.ts +451 -451
- package/lib/vivliostyle/css-parser.d.ts +320 -320
- package/lib/vivliostyle/css-prop.d.ts +74 -74
- package/lib/vivliostyle/css-styler.d.ts +210 -210
- package/lib/vivliostyle/css-tokenizer.d.ts +243 -243
- package/lib/vivliostyle/css-validator.d.ts +319 -319
- package/lib/vivliostyle/css.d.ts +205 -205
- package/lib/vivliostyle/diff.d.ts +26 -26
- package/lib/vivliostyle/display.d.ts +62 -57
- package/lib/vivliostyle/epub.d.ts +329 -329
- package/lib/vivliostyle/exprs.d.ts +395 -395
- package/lib/vivliostyle/font.d.ts +87 -87
- package/lib/vivliostyle/footnotes.d.ts +41 -41
- package/lib/vivliostyle/geometry-util.d.ts +110 -110
- package/lib/vivliostyle/layout-helper.d.ts +16 -15
- package/lib/vivliostyle/layout-processor.d.ts +73 -73
- package/lib/vivliostyle/layout-retryers.d.ts +21 -21
- package/lib/vivliostyle/layout-util.d.ts +55 -55
- package/lib/vivliostyle/layout.d.ts +456 -456
- package/lib/vivliostyle/logging.d.ts +56 -56
- package/lib/vivliostyle/matchers.d.ts +36 -36
- package/lib/vivliostyle/math-util.d.ts +22 -22
- package/lib/vivliostyle/net.d.ts +72 -72
- package/lib/vivliostyle/ops.d.ts +263 -263
- package/lib/vivliostyle/page-floats.d.ts +178 -178
- package/lib/vivliostyle/page-master.d.ts +247 -247
- package/lib/vivliostyle/plugin.d.ts +172 -172
- package/lib/vivliostyle/print.d.ts +7 -7
- package/lib/vivliostyle/profile.d.ts +59 -59
- package/lib/vivliostyle/pseudo-element.d.ts +32 -32
- package/lib/vivliostyle/repetitive-element.d.ts +162 -162
- package/lib/vivliostyle/scripts.d.ts +15 -15
- package/lib/vivliostyle/sha1.d.ts +33 -33
- package/lib/vivliostyle/shared.d.ts +24 -24
- package/lib/vivliostyle/sizing.d.ts +29 -29
- package/lib/vivliostyle/table.d.ts +263 -263
- package/lib/vivliostyle/task-util.d.ts +37 -37
- package/lib/vivliostyle/task.d.ts +357 -357
- package/lib/vivliostyle/text-polyfill.d.ts +3 -3
- package/lib/vivliostyle/toc.d.ts +64 -64
- package/lib/vivliostyle/types.d.ts +977 -977
- package/lib/vivliostyle/urls.d.ts +25 -25
- package/lib/vivliostyle/vgen.d.ts +213 -213
- package/lib/vivliostyle/viewer-app.d.ts +19 -19
- package/lib/vivliostyle/vtree.d.ts +392 -392
- package/lib/vivliostyle/xml-doc.d.ts +88 -88
- package/lib/vivliostyle.d.ts +6 -6
- package/lib/vivliostyle.js +1 -1
- package/lib/vivliostyle.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2016 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 Plugin - Plugin mechanism
|
|
19
|
-
*/
|
|
20
|
-
import * as Base from "./base";
|
|
21
|
-
import * as Css from "./css";
|
|
22
|
-
import * as LayoutProcessor from "./layout-processor";
|
|
23
|
-
import * as Task from "./task";
|
|
24
|
-
import { Layout, Vtree } from "./types";
|
|
25
|
-
/**
|
|
26
|
-
* Type of implemented hooks.
|
|
27
|
-
* @enum {string}
|
|
28
|
-
*/
|
|
29
|
-
export declare enum HOOKS {
|
|
30
|
-
/**
|
|
31
|
-
* Called when a single property declaration is parsed.
|
|
32
|
-
*
|
|
33
|
-
* The hook is called with an object with the following properties:
|
|
34
|
-
* {string} name: Property name
|
|
35
|
-
* {!Css.Val} value: Property value
|
|
36
|
-
* {boolean} important: Whether '!important' flag is present or not
|
|
37
|
-
* Functions called by this hook are expected to return a value with the same
|
|
38
|
-
* type as the above. The declaration is then replaced by the returned value.
|
|
39
|
-
*
|
|
40
|
-
* Note that a shorthand declaration is not directly passed to this hook.
|
|
41
|
-
* After the shorthand declaration is interpreted and broken into
|
|
42
|
-
* non-shorthand declarations, the hook is called for each of the
|
|
43
|
-
* non-shorthand declarations.
|
|
44
|
-
*/
|
|
45
|
-
SIMPLE_PROPERTY = "SIMPLE_PROPERTY",
|
|
46
|
-
/**
|
|
47
|
-
* Called when a single document (i.e. a single spine item) has been fetched,
|
|
48
|
-
* before parsing.
|
|
49
|
-
*
|
|
50
|
-
* The hook is called with the Document object.
|
|
51
|
-
*/
|
|
52
|
-
PREPROCESS_SINGLE_DOCUMENT = "PREPROCESS_SINGLE_DOCUMENT",
|
|
53
|
-
/**
|
|
54
|
-
* Called before creating a text node for modifying a text content.
|
|
55
|
-
*
|
|
56
|
-
* The hook is called with an object with the following properties:
|
|
57
|
-
* {Vtree.NodeContext} nodeContext
|
|
58
|
-
* {string} sourceTextContent
|
|
59
|
-
*
|
|
60
|
-
* Functions called by this hook are expected to return a
|
|
61
|
-
* Task.Result.<string>. The text content is then replaced by the
|
|
62
|
-
* returned value.
|
|
63
|
-
*/
|
|
64
|
-
PREPROCESS_TEXT_CONTENT = "PREPROCESS_TEXT_CONTENT",
|
|
65
|
-
/**
|
|
66
|
-
* Called before creating a element for modifying a element style.
|
|
67
|
-
*
|
|
68
|
-
* The hook is called with an object with the following properties:
|
|
69
|
-
* {Vtree.NodeContext} nodeContext
|
|
70
|
-
* {!Object} style
|
|
71
|
-
*/
|
|
72
|
-
PREPROCESS_ELEMENT_STYLE = "PREPROCESS_ELEMENT_STYLE",
|
|
73
|
-
/**
|
|
74
|
-
* Called before geting CssCascade.polyfilledInheritedProps.
|
|
75
|
-
*
|
|
76
|
-
* The hook return a array of polyfilled inherited property name.
|
|
77
|
-
*/
|
|
78
|
-
POLYFILLED_INHERITED_PROPS = "POLYFILLED_INHERITED_PROPS",
|
|
79
|
-
/**
|
|
80
|
-
* Called when a Viewer is configured.
|
|
81
|
-
*
|
|
82
|
-
* The hook is called with an object with the following properties:
|
|
83
|
-
* {Base.JSON} command
|
|
84
|
-
*/
|
|
85
|
-
CONFIGURATION = "CONFIGURATION",
|
|
86
|
-
/**
|
|
87
|
-
* Called when resolving a text node breaker
|
|
88
|
-
* which detects an acceptable breakpoint and break text node at this point.
|
|
89
|
-
*
|
|
90
|
-
* The hook is called with an object with the following properties:
|
|
91
|
-
* {Vtree.NodeContext} nodeContext
|
|
92
|
-
*
|
|
93
|
-
* Functions called by this hook are expected to
|
|
94
|
-
* return an instnce of {Layout.TextNodeBreaker} or null.
|
|
95
|
-
*/
|
|
96
|
-
RESOLVE_TEXT_NODE_BREAKER = "RESOLVE_TEXT_NODE_BREAKER",
|
|
97
|
-
/**
|
|
98
|
-
* Called when resolving a formatting context.
|
|
99
|
-
*
|
|
100
|
-
* The hook is called with the following parameters:
|
|
101
|
-
* nodeContext: a NodeContext object
|
|
102
|
-
* firstTime: a boolean flag representing whether this node is encountered
|
|
103
|
-
* for the first time or not display: an Css.Ident value representing
|
|
104
|
-
* 'display' value of the node position: an Css.Ident value representing
|
|
105
|
-
* 'position' value of the node float: an Css.Ident value representing
|
|
106
|
-
* 'float' value of the node isRoot: a boolean flag representing whether this
|
|
107
|
-
* node is a root (of a flow) or not Functions called by this hook are
|
|
108
|
-
* expected to return a formatting context for the NodeContext.
|
|
109
|
-
*/
|
|
110
|
-
RESOLVE_FORMATTING_CONTEXT = "RESOLVE_FORMATTING_CONTEXT",
|
|
111
|
-
/**
|
|
112
|
-
* Called when resolving a layout processor (LayoutProcessor) for
|
|
113
|
-
* a formatting context.
|
|
114
|
-
*
|
|
115
|
-
* The hook is called with a formatting context
|
|
116
|
-
* (Vtree.FormattingContext). Functions called by this hook are expected
|
|
117
|
-
* to return a layout processor corresponding to the formatting context.
|
|
118
|
-
*/
|
|
119
|
-
RESOLVE_LAYOUT_PROCESSOR = "RESOLVE_LAYOUT_PROCESSOR",
|
|
120
|
-
/**
|
|
121
|
-
* Called after laid out a block contents.
|
|
122
|
-
*
|
|
123
|
-
* The hook is called with an object with the following properties:
|
|
124
|
-
* {Vtree.NodeContext} nodeContext
|
|
125
|
-
* {Array.<Vtree.NodeContext>} checkPoints
|
|
126
|
-
* {Layout.Column} column
|
|
127
|
-
*/
|
|
128
|
-
POST_LAYOUT_BLOCK = "POST_LAYOUT_BLOCK"
|
|
129
|
-
}
|
|
130
|
-
export type PreProcessSingleDocumentHook = (p1: Document) => any;
|
|
131
|
-
export type PreProcessTextContentHook = (p1: Vtree.NodeContext, p2: string) => Task.Result<string>;
|
|
132
|
-
export type PreProcessElementStyleHook = (p1: Vtree.NodeContext, p2: object) => void;
|
|
133
|
-
export type PolyfilledInheritedPropsHook = () => string[];
|
|
134
|
-
export type ConfigurationHook = (p1: Base.JSON) => {
|
|
135
|
-
needResize: boolean | null | undefined;
|
|
136
|
-
needRefresh: boolean | null | undefined;
|
|
137
|
-
};
|
|
138
|
-
export type ResolveTextNodeBreakerHook = (p1: Vtree.NodeContext) => Layout.TextNodeBreaker;
|
|
139
|
-
export type ResolveFormattingContextHook = (p1: Vtree.NodeContext, p2: boolean, p3: Css.Ident, p4: Css.Ident, p5: Css.Ident, p6: boolean) => Vtree.FormattingContext;
|
|
140
|
-
export type ResolveLayoutProcessorHook = (p1: Vtree.FormattingContext) => LayoutProcessor.LayoutProcessor;
|
|
141
|
-
export type PostLayoutBlockHook = (p1: Vtree.NodeContext, p2: Vtree.NodeContext[], p3: Layout.Column) => void;
|
|
142
|
-
/**
|
|
143
|
-
* Register a function to a hook with the specified name.
|
|
144
|
-
* The registered function is called at appropriate timings by the core code.
|
|
145
|
-
* Arguments passed to the function depend on the hook.
|
|
146
|
-
* When multiple functions are registered, they are called by the order in which
|
|
147
|
-
* they are registered.
|
|
148
|
-
* @param name Name of the hook.
|
|
149
|
-
* @param fn Function to be registered to the hook.
|
|
150
|
-
* @param atFirst If true, the function is registered at the first of the hook array.
|
|
151
|
-
*/
|
|
152
|
-
export declare function registerHook(name: string, fn: (...p1: any[]) => any, atFirst?: boolean): void;
|
|
153
|
-
/**
|
|
154
|
-
* Remove a function already registered to the specified name.
|
|
155
|
-
* Note that even if the same function are registered multiple times, this
|
|
156
|
-
* method removes only the first one.
|
|
157
|
-
* @param name Name of the hook.
|
|
158
|
-
* @param fn Function to be removed from the hook.
|
|
159
|
-
*/
|
|
160
|
-
export declare function removeHook(name: string, fn: (...p1: any[]) => any): void;
|
|
161
|
-
/**
|
|
162
|
-
* Get all hooks registered to the specified name.
|
|
163
|
-
* This method is for internal use (from the core code).
|
|
164
|
-
*/
|
|
165
|
-
export declare function getHooksForName(name: string): ((...p1: any[]) => any)[];
|
|
166
|
-
/**
|
|
167
|
-
* Pubilc members of the bundled library.
|
|
168
|
-
*/
|
|
169
|
-
export declare const plugin: {
|
|
170
|
-
registerHook: typeof registerHook;
|
|
171
|
-
removeHook: typeof removeHook;
|
|
172
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2016 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 Plugin - Plugin mechanism
|
|
19
|
+
*/
|
|
20
|
+
import * as Base from "./base";
|
|
21
|
+
import * as Css from "./css";
|
|
22
|
+
import * as LayoutProcessor from "./layout-processor";
|
|
23
|
+
import * as Task from "./task";
|
|
24
|
+
import { Layout, Vtree } from "./types";
|
|
25
|
+
/**
|
|
26
|
+
* Type of implemented hooks.
|
|
27
|
+
* @enum {string}
|
|
28
|
+
*/
|
|
29
|
+
export declare enum HOOKS {
|
|
30
|
+
/**
|
|
31
|
+
* Called when a single property declaration is parsed.
|
|
32
|
+
*
|
|
33
|
+
* The hook is called with an object with the following properties:
|
|
34
|
+
* {string} name: Property name
|
|
35
|
+
* {!Css.Val} value: Property value
|
|
36
|
+
* {boolean} important: Whether '!important' flag is present or not
|
|
37
|
+
* Functions called by this hook are expected to return a value with the same
|
|
38
|
+
* type as the above. The declaration is then replaced by the returned value.
|
|
39
|
+
*
|
|
40
|
+
* Note that a shorthand declaration is not directly passed to this hook.
|
|
41
|
+
* After the shorthand declaration is interpreted and broken into
|
|
42
|
+
* non-shorthand declarations, the hook is called for each of the
|
|
43
|
+
* non-shorthand declarations.
|
|
44
|
+
*/
|
|
45
|
+
SIMPLE_PROPERTY = "SIMPLE_PROPERTY",
|
|
46
|
+
/**
|
|
47
|
+
* Called when a single document (i.e. a single spine item) has been fetched,
|
|
48
|
+
* before parsing.
|
|
49
|
+
*
|
|
50
|
+
* The hook is called with the Document object.
|
|
51
|
+
*/
|
|
52
|
+
PREPROCESS_SINGLE_DOCUMENT = "PREPROCESS_SINGLE_DOCUMENT",
|
|
53
|
+
/**
|
|
54
|
+
* Called before creating a text node for modifying a text content.
|
|
55
|
+
*
|
|
56
|
+
* The hook is called with an object with the following properties:
|
|
57
|
+
* {Vtree.NodeContext} nodeContext
|
|
58
|
+
* {string} sourceTextContent
|
|
59
|
+
*
|
|
60
|
+
* Functions called by this hook are expected to return a
|
|
61
|
+
* Task.Result.<string>. The text content is then replaced by the
|
|
62
|
+
* returned value.
|
|
63
|
+
*/
|
|
64
|
+
PREPROCESS_TEXT_CONTENT = "PREPROCESS_TEXT_CONTENT",
|
|
65
|
+
/**
|
|
66
|
+
* Called before creating a element for modifying a element style.
|
|
67
|
+
*
|
|
68
|
+
* The hook is called with an object with the following properties:
|
|
69
|
+
* {Vtree.NodeContext} nodeContext
|
|
70
|
+
* {!Object} style
|
|
71
|
+
*/
|
|
72
|
+
PREPROCESS_ELEMENT_STYLE = "PREPROCESS_ELEMENT_STYLE",
|
|
73
|
+
/**
|
|
74
|
+
* Called before geting CssCascade.polyfilledInheritedProps.
|
|
75
|
+
*
|
|
76
|
+
* The hook return a array of polyfilled inherited property name.
|
|
77
|
+
*/
|
|
78
|
+
POLYFILLED_INHERITED_PROPS = "POLYFILLED_INHERITED_PROPS",
|
|
79
|
+
/**
|
|
80
|
+
* Called when a Viewer is configured.
|
|
81
|
+
*
|
|
82
|
+
* The hook is called with an object with the following properties:
|
|
83
|
+
* {Base.JSON} command
|
|
84
|
+
*/
|
|
85
|
+
CONFIGURATION = "CONFIGURATION",
|
|
86
|
+
/**
|
|
87
|
+
* Called when resolving a text node breaker
|
|
88
|
+
* which detects an acceptable breakpoint and break text node at this point.
|
|
89
|
+
*
|
|
90
|
+
* The hook is called with an object with the following properties:
|
|
91
|
+
* {Vtree.NodeContext} nodeContext
|
|
92
|
+
*
|
|
93
|
+
* Functions called by this hook are expected to
|
|
94
|
+
* return an instnce of {Layout.TextNodeBreaker} or null.
|
|
95
|
+
*/
|
|
96
|
+
RESOLVE_TEXT_NODE_BREAKER = "RESOLVE_TEXT_NODE_BREAKER",
|
|
97
|
+
/**
|
|
98
|
+
* Called when resolving a formatting context.
|
|
99
|
+
*
|
|
100
|
+
* The hook is called with the following parameters:
|
|
101
|
+
* nodeContext: a NodeContext object
|
|
102
|
+
* firstTime: a boolean flag representing whether this node is encountered
|
|
103
|
+
* for the first time or not display: an Css.Ident value representing
|
|
104
|
+
* 'display' value of the node position: an Css.Ident value representing
|
|
105
|
+
* 'position' value of the node float: an Css.Ident value representing
|
|
106
|
+
* 'float' value of the node isRoot: a boolean flag representing whether this
|
|
107
|
+
* node is a root (of a flow) or not Functions called by this hook are
|
|
108
|
+
* expected to return a formatting context for the NodeContext.
|
|
109
|
+
*/
|
|
110
|
+
RESOLVE_FORMATTING_CONTEXT = "RESOLVE_FORMATTING_CONTEXT",
|
|
111
|
+
/**
|
|
112
|
+
* Called when resolving a layout processor (LayoutProcessor) for
|
|
113
|
+
* a formatting context.
|
|
114
|
+
*
|
|
115
|
+
* The hook is called with a formatting context
|
|
116
|
+
* (Vtree.FormattingContext). Functions called by this hook are expected
|
|
117
|
+
* to return a layout processor corresponding to the formatting context.
|
|
118
|
+
*/
|
|
119
|
+
RESOLVE_LAYOUT_PROCESSOR = "RESOLVE_LAYOUT_PROCESSOR",
|
|
120
|
+
/**
|
|
121
|
+
* Called after laid out a block contents.
|
|
122
|
+
*
|
|
123
|
+
* The hook is called with an object with the following properties:
|
|
124
|
+
* {Vtree.NodeContext} nodeContext
|
|
125
|
+
* {Array.<Vtree.NodeContext>} checkPoints
|
|
126
|
+
* {Layout.Column} column
|
|
127
|
+
*/
|
|
128
|
+
POST_LAYOUT_BLOCK = "POST_LAYOUT_BLOCK"
|
|
129
|
+
}
|
|
130
|
+
export type PreProcessSingleDocumentHook = (p1: Document) => any;
|
|
131
|
+
export type PreProcessTextContentHook = (p1: Vtree.NodeContext, p2: string) => Task.Result<string>;
|
|
132
|
+
export type PreProcessElementStyleHook = (p1: Vtree.NodeContext, p2: object) => void;
|
|
133
|
+
export type PolyfilledInheritedPropsHook = () => string[];
|
|
134
|
+
export type ConfigurationHook = (p1: Base.JSON) => {
|
|
135
|
+
needResize: boolean | null | undefined;
|
|
136
|
+
needRefresh: boolean | null | undefined;
|
|
137
|
+
};
|
|
138
|
+
export type ResolveTextNodeBreakerHook = (p1: Vtree.NodeContext) => Layout.TextNodeBreaker;
|
|
139
|
+
export type ResolveFormattingContextHook = (p1: Vtree.NodeContext, p2: boolean, p3: Css.Ident, p4: Css.Ident, p5: Css.Ident, p6: boolean) => Vtree.FormattingContext;
|
|
140
|
+
export type ResolveLayoutProcessorHook = (p1: Vtree.FormattingContext) => LayoutProcessor.LayoutProcessor;
|
|
141
|
+
export type PostLayoutBlockHook = (p1: Vtree.NodeContext, p2: Vtree.NodeContext[], p3: Layout.Column) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Register a function to a hook with the specified name.
|
|
144
|
+
* The registered function is called at appropriate timings by the core code.
|
|
145
|
+
* Arguments passed to the function depend on the hook.
|
|
146
|
+
* When multiple functions are registered, they are called by the order in which
|
|
147
|
+
* they are registered.
|
|
148
|
+
* @param name Name of the hook.
|
|
149
|
+
* @param fn Function to be registered to the hook.
|
|
150
|
+
* @param atFirst If true, the function is registered at the first of the hook array.
|
|
151
|
+
*/
|
|
152
|
+
export declare function registerHook(name: string, fn: (...p1: any[]) => any, atFirst?: boolean): void;
|
|
153
|
+
/**
|
|
154
|
+
* Remove a function already registered to the specified name.
|
|
155
|
+
* Note that even if the same function are registered multiple times, this
|
|
156
|
+
* method removes only the first one.
|
|
157
|
+
* @param name Name of the hook.
|
|
158
|
+
* @param fn Function to be removed from the hook.
|
|
159
|
+
*/
|
|
160
|
+
export declare function removeHook(name: string, fn: (...p1: any[]) => any): void;
|
|
161
|
+
/**
|
|
162
|
+
* Get all hooks registered to the specified name.
|
|
163
|
+
* This method is for internal use (from the core code).
|
|
164
|
+
*/
|
|
165
|
+
export declare function getHooksForName(name: string): ((...p1: any[]) => any)[];
|
|
166
|
+
/**
|
|
167
|
+
* Pubilc members of the bundled library.
|
|
168
|
+
*/
|
|
169
|
+
export declare const plugin: {
|
|
170
|
+
registerHook: typeof registerHook;
|
|
171
|
+
removeHook: typeof removeHook;
|
|
172
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface PrintConfig {
|
|
2
|
-
title: string;
|
|
3
|
-
printCallback: (iframeWin: Window) => void;
|
|
4
|
-
hideIframe: boolean;
|
|
5
|
-
removeIframe: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function printHTML(htmlDoc: string, config: PrintConfig): void;
|
|
1
|
+
export interface PrintConfig {
|
|
2
|
+
title: string;
|
|
3
|
+
printCallback: (iframeWin: Window) => void;
|
|
4
|
+
hideIframe: boolean;
|
|
5
|
+
removeIframe: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function printHTML(htmlDoc: string, config: PrintConfig): void;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Performance profiler measuring execution time of the script.
|
|
3
|
-
*/
|
|
4
|
-
export declare class Profiler {
|
|
5
|
-
readonly performanceInstance: Performance;
|
|
6
|
-
timestamps: {
|
|
7
|
-
[key: string]: {
|
|
8
|
-
[key: string]: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
private registerTiming;
|
|
12
|
-
registerStartTiming: (name: string, timestamp?: number) => any;
|
|
13
|
-
registerEndTiming: (name: string, timestamp?: number) => any;
|
|
14
|
-
constructor(performanceInstance: Performance);
|
|
15
|
-
/**
|
|
16
|
-
* Registers start timing of some event, even if profile is disabled.
|
|
17
|
-
* @param name Name of event
|
|
18
|
-
* @param timestamp Used as the actual timestamp of the event if specified,
|
|
19
|
-
* instead of "now"
|
|
20
|
-
*/
|
|
21
|
-
forceRegisterStartTiming(name: string, timestamp?: number): void;
|
|
22
|
-
/**
|
|
23
|
-
* Registers end timing of some event, even if profile is disabled.
|
|
24
|
-
* @param name Name of event
|
|
25
|
-
* @param timestamp Used as the actual timestamp of the event if specified,
|
|
26
|
-
* instead of "now"
|
|
27
|
-
*/
|
|
28
|
-
forceRegisterEndTiming(name: string, timestamp?: number): void;
|
|
29
|
-
/**
|
|
30
|
-
* Log registered timings (start/end/duration).
|
|
31
|
-
* All values are printed in ms unit.
|
|
32
|
-
*/
|
|
33
|
-
printTimings(): void;
|
|
34
|
-
/**
|
|
35
|
-
* Disable profiling.
|
|
36
|
-
*/
|
|
37
|
-
disable(): void;
|
|
38
|
-
/**
|
|
39
|
-
* Enable profiling.
|
|
40
|
-
*/
|
|
41
|
-
enable(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Returns if profiling is enabled or not.
|
|
44
|
-
*/
|
|
45
|
-
isEnabled(): boolean;
|
|
46
|
-
}
|
|
47
|
-
export declare const profiler: Profiler;
|
|
48
|
-
/**
|
|
49
|
-
* Pubilc members of the bundled library.
|
|
50
|
-
*/
|
|
51
|
-
export declare const profile: {
|
|
52
|
-
profiler: {
|
|
53
|
-
registerStartTiming: (name: string, timestamp?: number) => any;
|
|
54
|
-
registerEndTiming: (name: string, timestamp?: number) => any;
|
|
55
|
-
printTimings: () => void;
|
|
56
|
-
disable: () => void;
|
|
57
|
-
enable: () => void;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Performance profiler measuring execution time of the script.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Profiler {
|
|
5
|
+
readonly performanceInstance: Performance;
|
|
6
|
+
timestamps: {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
[key: string]: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
private registerTiming;
|
|
12
|
+
registerStartTiming: (name: string, timestamp?: number) => any;
|
|
13
|
+
registerEndTiming: (name: string, timestamp?: number) => any;
|
|
14
|
+
constructor(performanceInstance: Performance);
|
|
15
|
+
/**
|
|
16
|
+
* Registers start timing of some event, even if profile is disabled.
|
|
17
|
+
* @param name Name of event
|
|
18
|
+
* @param timestamp Used as the actual timestamp of the event if specified,
|
|
19
|
+
* instead of "now"
|
|
20
|
+
*/
|
|
21
|
+
forceRegisterStartTiming(name: string, timestamp?: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Registers end timing of some event, even if profile is disabled.
|
|
24
|
+
* @param name Name of event
|
|
25
|
+
* @param timestamp Used as the actual timestamp of the event if specified,
|
|
26
|
+
* instead of "now"
|
|
27
|
+
*/
|
|
28
|
+
forceRegisterEndTiming(name: string, timestamp?: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Log registered timings (start/end/duration).
|
|
31
|
+
* All values are printed in ms unit.
|
|
32
|
+
*/
|
|
33
|
+
printTimings(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Disable profiling.
|
|
36
|
+
*/
|
|
37
|
+
disable(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Enable profiling.
|
|
40
|
+
*/
|
|
41
|
+
enable(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Returns if profiling is enabled or not.
|
|
44
|
+
*/
|
|
45
|
+
isEnabled(): boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare const profiler: Profiler;
|
|
48
|
+
/**
|
|
49
|
+
* Pubilc members of the bundled library.
|
|
50
|
+
*/
|
|
51
|
+
export declare const profile: {
|
|
52
|
+
profiler: {
|
|
53
|
+
registerStartTiming: (name: string, timestamp?: number) => any;
|
|
54
|
+
registerEndTiming: (name: string, timestamp?: number) => any;
|
|
55
|
+
printTimings: () => void;
|
|
56
|
+
disable: () => void;
|
|
57
|
+
enable: () => void;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import * as Css from "./css";
|
|
2
|
-
import * as CssCascade from "./css-cascade";
|
|
3
|
-
import * as CssStyler from "./css-styler";
|
|
4
|
-
import * as Exprs from "./exprs";
|
|
5
|
-
import * as Vtree from "./vtree";
|
|
6
|
-
import { PseudoElement } from "./types";
|
|
7
|
-
export declare const document: Document;
|
|
8
|
-
/**
|
|
9
|
-
* Pseudoelement names in the order they should be inserted in the shadow DOM,
|
|
10
|
-
* empty string is the place where the element's DOM children are processed.
|
|
11
|
-
*/
|
|
12
|
-
export declare const pseudoNames: string[];
|
|
13
|
-
export declare const PSEUDO_ATTR = "data-adapt-pseudo";
|
|
14
|
-
export declare function getPseudoName(element: Element): string;
|
|
15
|
-
export declare function setPseudoName(element: Element, name: string): void;
|
|
16
|
-
export declare class PseudoelementStyler implements PseudoElement.PseudoelementStyler {
|
|
17
|
-
readonly element: Element;
|
|
18
|
-
style: CssCascade.ElementStyle;
|
|
19
|
-
styler: CssStyler.AbstractStyler;
|
|
20
|
-
readonly context: Exprs.Context;
|
|
21
|
-
readonly exprContentListener: Vtree.ExprContentListener;
|
|
22
|
-
contentProcessed: {
|
|
23
|
-
[key: string]: boolean;
|
|
24
|
-
};
|
|
25
|
-
constructor(element: Element, style: CssCascade.ElementStyle, styler: CssStyler.AbstractStyler, context: Exprs.Context, exprContentListener: Vtree.ExprContentListener);
|
|
26
|
-
/** @override */
|
|
27
|
-
getStyle(element: Element, deep: boolean): CssCascade.ElementStyle;
|
|
28
|
-
/** @override */
|
|
29
|
-
processContent(element: Element, styles: {
|
|
30
|
-
[key: string]: Css.Val;
|
|
31
|
-
}, viewNode: Node): void;
|
|
32
|
-
}
|
|
1
|
+
import * as Css from "./css";
|
|
2
|
+
import * as CssCascade from "./css-cascade";
|
|
3
|
+
import * as CssStyler from "./css-styler";
|
|
4
|
+
import * as Exprs from "./exprs";
|
|
5
|
+
import * as Vtree from "./vtree";
|
|
6
|
+
import { PseudoElement } from "./types";
|
|
7
|
+
export declare const document: Document;
|
|
8
|
+
/**
|
|
9
|
+
* Pseudoelement names in the order they should be inserted in the shadow DOM,
|
|
10
|
+
* empty string is the place where the element's DOM children are processed.
|
|
11
|
+
*/
|
|
12
|
+
export declare const pseudoNames: string[];
|
|
13
|
+
export declare const PSEUDO_ATTR = "data-adapt-pseudo";
|
|
14
|
+
export declare function getPseudoName(element: Element): string;
|
|
15
|
+
export declare function setPseudoName(element: Element, name: string): void;
|
|
16
|
+
export declare class PseudoelementStyler implements PseudoElement.PseudoelementStyler {
|
|
17
|
+
readonly element: Element;
|
|
18
|
+
style: CssCascade.ElementStyle;
|
|
19
|
+
styler: CssStyler.AbstractStyler;
|
|
20
|
+
readonly context: Exprs.Context;
|
|
21
|
+
readonly exprContentListener: Vtree.ExprContentListener;
|
|
22
|
+
contentProcessed: {
|
|
23
|
+
[key: string]: boolean;
|
|
24
|
+
};
|
|
25
|
+
constructor(element: Element, style: CssCascade.ElementStyle, styler: CssStyler.AbstractStyler, context: Exprs.Context, exprContentListener: Vtree.ExprContentListener);
|
|
26
|
+
/** @override */
|
|
27
|
+
getStyle(element: Element, deep: boolean): CssCascade.ElementStyle;
|
|
28
|
+
/** @override */
|
|
29
|
+
processContent(element: Element, styles: {
|
|
30
|
+
[key: string]: Css.Val;
|
|
31
|
+
}, viewNode: Node): void;
|
|
32
|
+
}
|