@vivliostyle/core 2.24.2 → 2.24.3
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 +3 -3
- package/lib/vivliostyle/base.d.ts +4 -4
- package/lib/vivliostyle/break-position.d.ts +1 -1
- package/lib/vivliostyle/break.d.ts +2 -2
- package/lib/vivliostyle/cfi.d.ts +1 -1
- package/lib/vivliostyle/columns.d.ts +2 -2
- package/lib/vivliostyle/core-viewer.d.ts +6 -6
- package/lib/vivliostyle/css-cascade.d.ts +5 -5
- package/lib/vivliostyle/css-page.d.ts +6 -5
- package/lib/vivliostyle/css-tokenizer.d.ts +1 -1
- package/lib/vivliostyle/css-validator.d.ts +1 -1
- package/lib/vivliostyle/diff.d.ts +1 -1
- package/lib/vivliostyle/epub.d.ts +4 -4
- package/lib/vivliostyle/exprs.d.ts +6 -6
- package/lib/vivliostyle/layout-util.d.ts +1 -1
- package/lib/vivliostyle/layout.d.ts +4 -4
- package/lib/vivliostyle/logging.d.ts +1 -1
- package/lib/vivliostyle/net.d.ts +2 -2
- package/lib/vivliostyle/ops.d.ts +2 -2
- package/lib/vivliostyle/page-floats.d.ts +3 -3
- package/lib/vivliostyle/plugin.d.ts +9 -9
- package/lib/vivliostyle/repetitive-element.d.ts +1 -1
- package/lib/vivliostyle/table.d.ts +1 -1
- package/lib/vivliostyle/toc.d.ts +1 -1
- package/lib/vivliostyle/types.d.ts +2 -2
- package/lib/vivliostyle/vgen.d.ts +1 -1
- package/lib/vivliostyle/vtree.d.ts +12 -12
- package/lib/vivliostyle/xml-doc.d.ts +1 -1
- package/lib/vivliostyle.js +1 -1
- package/lib/vivliostyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -6,8 +6,8 @@ import * as Font from "./font";
|
|
|
6
6
|
import * as Task from "./task";
|
|
7
7
|
import * as Vgen from "./vgen";
|
|
8
8
|
import * as Vtree from "./vtree";
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type Action = (p1: Base.JSON) => Task.Result<boolean>;
|
|
10
|
+
export type ViewportSize = {
|
|
11
11
|
marginLeft: number;
|
|
12
12
|
marginRight: number;
|
|
13
13
|
marginTop: number;
|
|
@@ -25,7 +25,7 @@ export declare enum PageViewMode {
|
|
|
25
25
|
SPREAD = "spread",
|
|
26
26
|
AUTO_SPREAD = "autoSpread"
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export type SingleDocumentParam = {
|
|
29
29
|
url: string;
|
|
30
30
|
startPage: number | null;
|
|
31
31
|
skipPagesBefore: number | null;
|
|
@@ -8,7 +8,7 @@ export declare const firstLetterPattern: RegExp;
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const ELEMENT_OFFSET_ATTR = "data-adapt-eloff";
|
|
10
10
|
export declare let emptyObj: {};
|
|
11
|
-
export
|
|
11
|
+
export type JSON = any;
|
|
12
12
|
export declare function jsonToString(json: JSON): string;
|
|
13
13
|
export declare function stringToJSON(str: string): JSON;
|
|
14
14
|
export declare function stripFragment(url: string): string;
|
|
@@ -163,7 +163,7 @@ export declare function mapObj<P, R>(obj: {
|
|
|
163
163
|
[key: string]: R;
|
|
164
164
|
};
|
|
165
165
|
export declare function mapSize(obj: object): number;
|
|
166
|
-
export
|
|
166
|
+
export type Event = {
|
|
167
167
|
type: string;
|
|
168
168
|
target?: any;
|
|
169
169
|
currentTarget?: any;
|
|
@@ -173,7 +173,7 @@ export declare type Event = {
|
|
|
173
173
|
href?: any;
|
|
174
174
|
content?: any;
|
|
175
175
|
};
|
|
176
|
-
export
|
|
176
|
+
export type EventListener = (p1: Event) => void;
|
|
177
177
|
/**
|
|
178
178
|
* Extemely simple-minded EventTarget implementation. Consider using
|
|
179
179
|
* goog.events.EventTarget if you are using Closure library.
|
|
@@ -186,4 +186,4 @@ export declare class SimpleEventTarget {
|
|
|
186
186
|
addEventListener(type: string, listener: EventListener, capture?: boolean): void;
|
|
187
187
|
removeEventListener(type: string, listener: EventListener, capture?: boolean): void;
|
|
188
188
|
}
|
|
189
|
-
export
|
|
189
|
+
export type EventTarget = SimpleEventTarget;
|
|
@@ -2,7 +2,7 @@ import { Layout, RepetitiveElement, Vtree } from "./types";
|
|
|
2
2
|
/**
|
|
3
3
|
* Potential breaking position.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type BreakPosition = Layout.BreakPosition;
|
|
6
6
|
export declare abstract class AbstractBreakPosition implements Layout.AbstractBreakPosition {
|
|
7
7
|
abstract findAcceptableBreak(column: Layout.Column, penalty: number): Vtree.NodeContext;
|
|
8
8
|
abstract getMinBreakPenalty(): number;
|
|
@@ -35,7 +35,7 @@ export declare function isCloneBoxDecorationBreak(element: Element): boolean;
|
|
|
35
35
|
* justify: the computed value of `text-align` property is `justify`
|
|
36
36
|
* clone: the computed value of `box-decoration-break` property is `clone`
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
type BoxBreakFlag = "inline-start" | "inline-end" | "block-start" | "block-end" | "text-start" | "text-end" | "justify" | "clone";
|
|
39
39
|
export declare function getBoxBreakFlags(element: Element): BoxBreakFlag[];
|
|
40
40
|
export declare function setBoxBreakFlags(element: Element, boxBreakFlags: BoxBreakFlag[]): void;
|
|
41
41
|
export declare function setBoxBreakFlag(element: Element, boxBreakFlag: BoxBreakFlag): void;
|
|
@@ -49,7 +49,7 @@ export declare function setBoxBreakFlag(element: Element, boxBreakFlag: BoxBreak
|
|
|
49
49
|
* inline-start: the inline-start margin is discarded
|
|
50
50
|
* inline-end: the inline-end margin is discarded
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
type MarginDiscardFlag = "block-start" | "block-end" | "inline-start" | "inline-end";
|
|
53
53
|
export declare function getMarginDiscardFlags(element: Element): MarginDiscardFlag[];
|
|
54
54
|
export declare function setMarginDiscardFlags(element: Element, marginDiscardFlags: MarginDiscardFlag[]): void;
|
|
55
55
|
export declare function setMarginDiscardFlag(element: Element, marginDiscardFlag: MarginDiscardFlag): void;
|
package/lib/vivliostyle/cfi.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import * as PageFloats from "./page-floats";
|
|
|
3
3
|
import * as Task from "./task";
|
|
4
4
|
import * as Vtree from "./vtree";
|
|
5
5
|
import { Layout } from "./types";
|
|
6
|
-
export
|
|
6
|
+
export type ColumnLayoutResult = {
|
|
7
7
|
columns: Layout.Column[];
|
|
8
8
|
position: Vtree.LayoutPosition;
|
|
9
9
|
columnPageFloatLayoutContexts?: PageFloats.PageFloatLayoutContext[];
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ColumnGenerator = () => Task.Result<ColumnLayoutResult | null>;
|
|
12
12
|
export declare class ColumnBalancingTrialResult {
|
|
13
13
|
readonly layoutResult: ColumnLayoutResult;
|
|
14
14
|
readonly penalty: number;
|
|
@@ -42,7 +42,7 @@ export interface Payload {
|
|
|
42
42
|
* - window: Window object. If omitted, current `window` is used.
|
|
43
43
|
* - debug: Debug flag.
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type CoreViewerSettings = {
|
|
46
46
|
userAgentRootURL?: string;
|
|
47
47
|
viewportElement: HTMLElement;
|
|
48
48
|
window?: Window;
|
|
@@ -67,7 +67,7 @@ export declare type CoreViewerSettings = {
|
|
|
67
67
|
* improves layout precision, emulating high pixel ratio.
|
|
68
68
|
* default: 8. Set 0 to disable pixel ratio emulation.
|
|
69
69
|
*/
|
|
70
|
-
export
|
|
70
|
+
export type CoreViewerOptions = {
|
|
71
71
|
autoResize?: boolean;
|
|
72
72
|
fontSize?: number;
|
|
73
73
|
pageBorderWidth?: number;
|
|
@@ -95,7 +95,7 @@ export declare type CoreViewerOptions = {
|
|
|
95
95
|
* A single stylesheet may be a URL of the style sheet or a text content of
|
|
96
96
|
* the style sheet.
|
|
97
97
|
*/
|
|
98
|
-
export
|
|
98
|
+
export type DocumentOptions = {
|
|
99
99
|
documentObject?: Document;
|
|
100
100
|
fragment?: string;
|
|
101
101
|
authorStyleSheet?: {
|
|
@@ -118,7 +118,7 @@ export declare type DocumentOptions = {
|
|
|
118
118
|
* on the first page of the document.
|
|
119
119
|
* This option is ignored if `startPageNumber` option is also specified.
|
|
120
120
|
*/
|
|
121
|
-
export
|
|
121
|
+
export type SingleDocumentOptions = string | {
|
|
122
122
|
url: string;
|
|
123
123
|
startPage?: number;
|
|
124
124
|
skipPagesBefore?: number;
|
|
@@ -234,7 +234,7 @@ export declare enum Navigation {
|
|
|
234
234
|
LAST = "last",
|
|
235
235
|
EPAGE = "epage"
|
|
236
236
|
}
|
|
237
|
-
export
|
|
237
|
+
export type ZoomType = AdaptiveViewer.ZoomType;
|
|
238
238
|
export declare const ZoomType: typeof AdaptiveViewer.ZoomType;
|
|
239
|
-
export
|
|
239
|
+
export type PageViewMode = AdaptiveViewer.PageViewMode;
|
|
240
240
|
export declare const PageViewMode: typeof AdaptiveViewer.PageViewMode;
|
|
@@ -7,7 +7,7 @@ import * as Matchers from "./matchers";
|
|
|
7
7
|
import * as Vtree from "./vtree";
|
|
8
8
|
import { CssStyler } from "./types";
|
|
9
9
|
import { TokenType } from "./css-tokenizer";
|
|
10
|
-
export
|
|
10
|
+
export type ElementStyle = {
|
|
11
11
|
[key: string]: CascadeValue | CascadeValue[] | ElementStyleMap | {
|
|
12
12
|
matcher: Matchers.Matcher;
|
|
13
13
|
styles: ElementStyle;
|
|
@@ -165,7 +165,7 @@ export declare function cascadeValues(context: Exprs.Context, tv: CascadeValue,
|
|
|
165
165
|
* setProp(style, name, cascadeValues(context, getProp(style, name), value))
|
|
166
166
|
*/
|
|
167
167
|
export declare function setPropCascadeValue(style: ElementStyle, name: string, value: CascadeValue, context?: Exprs.Context): void;
|
|
168
|
-
export
|
|
168
|
+
export type ElementStyleMap = {
|
|
169
169
|
[key: string]: ElementStyle;
|
|
170
170
|
};
|
|
171
171
|
export declare const SPECIALS: {
|
|
@@ -201,7 +201,7 @@ export declare class InheritanceVisitor extends Css.FilterVisitor {
|
|
|
201
201
|
}
|
|
202
202
|
export declare function convertFontRelativeLengthToPx(numeric: Css.Numeric, baseFontSize: number, context: Exprs.Context): Css.Numeric;
|
|
203
203
|
export declare function convertFontSizeToPx(numeric: Css.Numeric, parentFontSize: number, context: Exprs.Context): Css.Numeric;
|
|
204
|
-
export
|
|
204
|
+
export type ActionTable = {
|
|
205
205
|
[key: string]: CascadeAction;
|
|
206
206
|
};
|
|
207
207
|
export declare class CascadeAction {
|
|
@@ -517,7 +517,7 @@ export declare class QuotesScopeItem implements ConditionItem {
|
|
|
517
517
|
/** @override */
|
|
518
518
|
pop(cascadeInstance: CascadeInstance, depth: number): boolean;
|
|
519
519
|
}
|
|
520
|
-
export
|
|
520
|
+
export type CounterValues = {
|
|
521
521
|
[key: string]: number[];
|
|
522
522
|
};
|
|
523
523
|
export interface CounterListener {
|
|
@@ -613,7 +613,7 @@ export declare const fixed: {
|
|
|
613
613
|
export declare function additiveFormat(entries: any[], num: number): string;
|
|
614
614
|
export declare function expandAlphabet(str: string): string[] | null;
|
|
615
615
|
export declare function alphabeticFormat(alphabetStr: string, num: number): string;
|
|
616
|
-
export
|
|
616
|
+
export type ChineseNumbering = {
|
|
617
617
|
digits: string;
|
|
618
618
|
markers: string;
|
|
619
619
|
negative: string;
|
|
@@ -11,7 +11,7 @@ import * as Vtree from "./vtree";
|
|
|
11
11
|
* Resolve page progression direction from writing-mode and direction.
|
|
12
12
|
*/
|
|
13
13
|
export declare function resolvePageProgression(style: CssCascade.ElementStyle): Constants.PageProgression;
|
|
14
|
-
export
|
|
14
|
+
export type PageSize = {
|
|
15
15
|
width: Css.Numeric;
|
|
16
16
|
height: Css.Numeric;
|
|
17
17
|
};
|
|
@@ -39,7 +39,7 @@ export declare const defaultPrinterMarkLineLength: Css.Numeric;
|
|
|
39
39
|
* defaultPrinterMarkLineLength)
|
|
40
40
|
*/
|
|
41
41
|
export declare const defaultBleedOffset: Css.Numeric;
|
|
42
|
-
export
|
|
42
|
+
export type PageSizeAndBleed = {
|
|
43
43
|
width: Css.Numeric;
|
|
44
44
|
height: Css.Numeric;
|
|
45
45
|
bleed: Css.Numeric;
|
|
@@ -49,7 +49,7 @@ export declare type PageSizeAndBleed = {
|
|
|
49
49
|
export declare function resolvePageSizeAndBleed(style: {
|
|
50
50
|
[key: string]: CssCascade.CascadeValue;
|
|
51
51
|
}): PageSizeAndBleed;
|
|
52
|
-
export
|
|
52
|
+
export type EvaluatedPageSizeAndBleed = {
|
|
53
53
|
pageWidth: number;
|
|
54
54
|
pageHeight: number;
|
|
55
55
|
bleed: number;
|
|
@@ -134,7 +134,7 @@ export declare enum MarginBoxPositionAlongVariableDimension {
|
|
|
134
134
|
CENTER = "center",
|
|
135
135
|
END = "end"
|
|
136
136
|
}
|
|
137
|
-
export
|
|
137
|
+
export type PageMarginBoxInformation = {
|
|
138
138
|
order: number;
|
|
139
139
|
isInTopRow: boolean;
|
|
140
140
|
isInBottomRow: boolean;
|
|
@@ -209,7 +209,7 @@ export declare class PageMarginBoxPartition extends PageMaster.Partition<PageMar
|
|
|
209
209
|
applySpecified(style: CssCascade.ElementStyle): void;
|
|
210
210
|
createInstance(parentInstance: any): PageMaster.PageBoxInstance;
|
|
211
211
|
}
|
|
212
|
-
export
|
|
212
|
+
export type PageAreaDimension = {
|
|
213
213
|
borderBoxWidth: Exprs.Val;
|
|
214
214
|
borderBoxHeight: Exprs.Val;
|
|
215
215
|
marginTop: Exprs.Val;
|
|
@@ -274,6 +274,7 @@ export declare class PageRulePartitionInstance extends PageMaster.PartitionInsta
|
|
|
274
274
|
* dimension specified in the page at-rules.
|
|
275
275
|
*/
|
|
276
276
|
private resolvePageBoxDimensions;
|
|
277
|
+
private hasBorderOrOutline;
|
|
277
278
|
prepareContainer(context: Exprs.Context, container: Vtree.Container, page: Vtree.Page, docFaces: Font.DocumentFaces, clientLayout: Vtree.ClientLayout): void;
|
|
278
279
|
}
|
|
279
280
|
export declare class PageMarginBoxPartitionInstance extends PageMaster.PartitionInstance<PageMarginBoxPartition> {
|
|
@@ -176,7 +176,7 @@ export declare enum Action {
|
|
|
176
176
|
CDO = 81,
|
|
177
177
|
CDC = 82
|
|
178
178
|
}
|
|
179
|
-
export declare function makeActions(def: Action, spec:
|
|
179
|
+
export declare function makeActions(def: Action, spec: number[]): Action[];
|
|
180
180
|
/**
|
|
181
181
|
* Start of the token.
|
|
182
182
|
*/
|
|
@@ -102,7 +102,7 @@ export declare const ALLOW_ZERO_PERCENT = 1024;
|
|
|
102
102
|
export declare const ALLOW_SLASH = 2048;
|
|
103
103
|
export declare const ALLOW_URANGE = 4096;
|
|
104
104
|
export declare const ALLOW_IMAGE = 8192;
|
|
105
|
-
export
|
|
105
|
+
export type ValueMap = {
|
|
106
106
|
[key: string]: Css.Val;
|
|
107
107
|
};
|
|
108
108
|
/**
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @fileoverview Diff utility
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type Change = (number | string)[];
|
|
21
21
|
export declare function diffChars(originalText: string, newText: string): Change[];
|
|
22
22
|
export declare function restoreOriginalText(changes: Change[]): string;
|
|
23
23
|
export declare function restoreNewText(changes: Change[]): string;
|
|
@@ -11,7 +11,7 @@ import * as Toc from "./toc";
|
|
|
11
11
|
import * as Vgen from "./vgen";
|
|
12
12
|
import * as Vtree from "./vtree";
|
|
13
13
|
import * as XmlDoc from "./xml-doc";
|
|
14
|
-
export
|
|
14
|
+
export type Position = {
|
|
15
15
|
spineIndex: number;
|
|
16
16
|
pageIndex: number;
|
|
17
17
|
offsetInItem: number;
|
|
@@ -46,7 +46,7 @@ export declare class EPUBDocStore extends OPS.OPSDocStore {
|
|
|
46
46
|
load(url: string): Task.Result<XmlDoc.XMLDocHolder>;
|
|
47
47
|
processViewportMeta(meta: Element): string;
|
|
48
48
|
}
|
|
49
|
-
export
|
|
49
|
+
export type OPFItemParam = {
|
|
50
50
|
url: string;
|
|
51
51
|
index: number;
|
|
52
52
|
startPage: number | null;
|
|
@@ -180,12 +180,12 @@ export declare class OPFDoc {
|
|
|
180
180
|
resolveEPage(epage: number): Task.Result<Position | null>;
|
|
181
181
|
getEPageFromPosition(position: Position): Task.Result<number>;
|
|
182
182
|
}
|
|
183
|
-
export
|
|
183
|
+
export type PageAndPosition = {
|
|
184
184
|
page: Vtree.Page;
|
|
185
185
|
position: Position;
|
|
186
186
|
};
|
|
187
187
|
export declare const makePageAndPosition: (page: Vtree.Page, pageIndex: number) => PageAndPosition;
|
|
188
|
-
export
|
|
188
|
+
export type OPFViewItem = {
|
|
189
189
|
item: OPFItem;
|
|
190
190
|
xmldoc: XmlDoc.XMLDocHolder;
|
|
191
191
|
instance: OPS.StyleInstance;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* @fileoverview Exprs - `-epubx-expr` Adaptive Layout expressions.
|
|
20
20
|
*/
|
|
21
21
|
import * as Base from "./base";
|
|
22
|
-
export
|
|
22
|
+
export type Preferences = {
|
|
23
23
|
fontFamily: string;
|
|
24
24
|
lineHeight: number;
|
|
25
25
|
margin: number;
|
|
@@ -41,7 +41,7 @@ export declare function clonePreferences(pref: Preferences): Preferences;
|
|
|
41
41
|
export declare const defaultPreferencesInstance: Preferences;
|
|
42
42
|
interface Pending {
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
type Special = Pending;
|
|
45
45
|
/**
|
|
46
46
|
* Special marker value that indicates that the expression result is being
|
|
47
47
|
* calculated.
|
|
@@ -49,8 +49,8 @@ declare type Special = Pending;
|
|
|
49
49
|
export declare const Special: {
|
|
50
50
|
PENDING: Pending;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
53
|
-
export
|
|
52
|
+
export type Result = string | number | boolean | undefined;
|
|
53
|
+
export type PendingResult = Special | Result;
|
|
54
54
|
export declare function letterbox(viewW: number, viewH: number, objW: number, objH: number): string;
|
|
55
55
|
/**
|
|
56
56
|
* @return string that can be parsed as CSS string with value str
|
|
@@ -100,7 +100,7 @@ export declare const defaultUnitSizes: {
|
|
|
100
100
|
* Returns if a unit should be converted to px before applied to the raw DOM.
|
|
101
101
|
*/
|
|
102
102
|
export declare function needUnitConversion(unit: string): boolean;
|
|
103
|
-
export
|
|
103
|
+
export type ScopeContext = {
|
|
104
104
|
[key: string]: Result;
|
|
105
105
|
};
|
|
106
106
|
/**
|
|
@@ -143,7 +143,7 @@ export declare class Context {
|
|
|
143
143
|
queryVal(scope: LexicalScope, key: string): Result | undefined;
|
|
144
144
|
storeVal(scope: LexicalScope, key: string, val: Result): void;
|
|
145
145
|
}
|
|
146
|
-
export
|
|
146
|
+
export type DependencyCache = {
|
|
147
147
|
[key: string]: boolean | Special;
|
|
148
148
|
};
|
|
149
149
|
export declare class Val {
|
|
@@ -84,7 +84,7 @@ export declare const mediaTags: {
|
|
|
84
84
|
/**
|
|
85
85
|
* Represents a constraint on layout
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
87
|
+
export type LayoutConstraint = Layout.LayoutConstraint;
|
|
88
88
|
/**
|
|
89
89
|
* Represents a constraint that allows layout if all the constraints it contains
|
|
90
90
|
* allow layout.
|
|
@@ -98,8 +98,8 @@ export declare class AllLayoutConstraint implements LayoutConstraint {
|
|
|
98
98
|
/**
|
|
99
99
|
* Represents constraints on laying out fragments
|
|
100
100
|
*/
|
|
101
|
-
export
|
|
102
|
-
export
|
|
101
|
+
export type FragmentLayoutConstraint = Layout.FragmentLayoutConstraint;
|
|
102
|
+
export type BreakPositionAndNodeContext = Layout.BreakPositionAndNodeContext;
|
|
103
103
|
/**
|
|
104
104
|
* Potential breaking position inside CSS box (between lines).
|
|
105
105
|
* @param checkPoints array of breaking points for breakable block
|
|
@@ -398,7 +398,7 @@ export declare class PseudoColumn {
|
|
|
398
398
|
getColumnElement(): Element;
|
|
399
399
|
getColumn(): Layout.Column;
|
|
400
400
|
}
|
|
401
|
-
export
|
|
401
|
+
export type SinglePageFloatLayoutResult = Layout.SinglePageFloatLayoutResult;
|
|
402
402
|
/**
|
|
403
403
|
* breaking point resolver for Text Node.
|
|
404
404
|
*/
|
package/lib/vivliostyle/net.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare enum XMLHttpRequestResponseType {
|
|
|
33
33
|
JSON = "json",
|
|
34
34
|
TEXT = "text"
|
|
35
35
|
}
|
|
36
|
-
export
|
|
36
|
+
export type Response = Net.Response;
|
|
37
37
|
export declare function ajax(url: string, opt_type?: XMLHttpRequestResponseType, opt_method?: string, opt_data?: string, opt_contentType?: string): Task.Result<Response>;
|
|
38
38
|
export declare function makeBlob(parts: (string | Blob | ArrayBuffer | ArrayBufferView)[], opt_type?: string): Blob;
|
|
39
39
|
export declare function readBlob(blob: Blob): Task.Result<ArrayBuffer>;
|
|
@@ -67,6 +67,6 @@ export declare class ResourceStore<Resource> implements Net.ResourceStore<Resour
|
|
|
67
67
|
get(url: string): XmlDoc.XMLDocHolder;
|
|
68
68
|
delete(url: string): void;
|
|
69
69
|
}
|
|
70
|
-
export
|
|
70
|
+
export type JSONStore = ResourceStore<Base.JSON>;
|
|
71
71
|
export declare function parseJSONResource(response: Response, store: JSONStore): Task.Result<Base.JSON>;
|
|
72
72
|
export declare function newJSONStore(): JSONStore;
|
package/lib/vivliostyle/ops.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ import * as XmlDoc from "./xml-doc";
|
|
|
44
44
|
import { Layout as LayoutType } from "./types";
|
|
45
45
|
export declare const uaStylesheetBaseFetcher: TaskUtil.Fetcher<boolean>;
|
|
46
46
|
export declare function loadUABase(): Task.Result<boolean>;
|
|
47
|
-
export
|
|
47
|
+
export type FontFace = {
|
|
48
48
|
properties: CssCascade.ElementStyle;
|
|
49
49
|
condition: Exprs.Val;
|
|
50
50
|
};
|
|
@@ -215,7 +215,7 @@ export declare class StyleParserHandler extends CssParser.DispatchParserHandler
|
|
|
215
215
|
};
|
|
216
216
|
constructor(validatorSet: CssValidator.ValidatorSet);
|
|
217
217
|
}
|
|
218
|
-
export
|
|
218
|
+
export type StyleSource = {
|
|
219
219
|
url: string;
|
|
220
220
|
text: string | null;
|
|
221
221
|
flavor: CssParser.StylesheetFlavor;
|
|
@@ -3,8 +3,8 @@ import * as GeometryUtil from "./geometry-util";
|
|
|
3
3
|
import * as Task from "./task";
|
|
4
4
|
import { Layout as LayoutType, PageFloats, Vtree } from "./types";
|
|
5
5
|
export declare const FloatReference: typeof PageFloats.FloatReference;
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export type FloatReference = PageFloats.FloatReference;
|
|
7
|
+
type PageFloatID = PageFloats.PageFloatID;
|
|
8
8
|
export declare function floatReferenceOf(str: string): FloatReference;
|
|
9
9
|
export declare function isPageFloat(floatReference: FloatReference): boolean;
|
|
10
10
|
/**
|
|
@@ -62,7 +62,7 @@ export declare class PageFloatContinuation implements PageFloats.PageFloatContin
|
|
|
62
62
|
constructor(float: PageFloat, nodePosition: Vtree.NodePosition);
|
|
63
63
|
equals(other: PageFloatContinuation | null): boolean;
|
|
64
64
|
}
|
|
65
|
-
export
|
|
65
|
+
export type PageFloatPlacementCondition = PageFloats.PageFloatPlacementCondition;
|
|
66
66
|
/**
|
|
67
67
|
* @param generatingNodePosition Source NodePosition generating the context.
|
|
68
68
|
* Specify when a column context is generated by a non-root element (for
|
|
@@ -127,18 +127,18 @@ export declare enum HOOKS {
|
|
|
127
127
|
*/
|
|
128
128
|
POST_LAYOUT_BLOCK = "POST_LAYOUT_BLOCK"
|
|
129
129
|
}
|
|
130
|
-
export
|
|
131
|
-
export
|
|
132
|
-
export
|
|
133
|
-
export
|
|
134
|
-
export
|
|
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
135
|
needResize: boolean | null | undefined;
|
|
136
136
|
needRefresh: boolean | null | undefined;
|
|
137
137
|
};
|
|
138
|
-
export
|
|
139
|
-
export
|
|
140
|
-
export
|
|
141
|
-
export
|
|
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
142
|
/**
|
|
143
143
|
* Register a function to a hook with the specified name.
|
|
144
144
|
* The registered function is called at appropriate timings by the core code.
|
|
@@ -25,7 +25,7 @@ export declare class RepetitiveElementsOwnerFormattingContext implements Repetit
|
|
|
25
25
|
/** @override */
|
|
26
26
|
restoreState(state: any): void;
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export type ElementsOffset = RepetitiveElement.ElementsOffset;
|
|
29
29
|
export declare class RepetitiveElements implements RepetitiveElement.RepetitiveElements {
|
|
30
30
|
private readonly vertical;
|
|
31
31
|
ownerSourceNode: Element;
|
|
@@ -67,7 +67,7 @@ export declare class InsideTableRowBreakPosition extends BreakPosition.AbstractB
|
|
|
67
67
|
getAcceptableCellBreakPositions(): Layout.BreakPositionAndNodeContext[];
|
|
68
68
|
private getCellFragments;
|
|
69
69
|
}
|
|
70
|
-
export
|
|
70
|
+
export type BrokenTableCellPosition = {
|
|
71
71
|
cellNodePosition: Vtree.NodePosition;
|
|
72
72
|
breakChunkPosition: Vtree.ChunkPosition;
|
|
73
73
|
cell: TableCell;
|
package/lib/vivliostyle/toc.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import * as XmlDoc from "./xml-doc";
|
|
|
30
30
|
export declare const bulletClosed = "\u25B8";
|
|
31
31
|
export declare const bulletOpen = "\u25BE";
|
|
32
32
|
export declare const bulletEmpty = "\u25B9";
|
|
33
|
-
export
|
|
33
|
+
export type TOCItem = {
|
|
34
34
|
id: string;
|
|
35
35
|
title: string;
|
|
36
36
|
children: TOCItem[];
|
|
@@ -23,8 +23,8 @@ import * as Exprs from "./exprs";
|
|
|
23
23
|
import * as GeometryUtil from "./geometry-util";
|
|
24
24
|
import * as Task from "./task";
|
|
25
25
|
import * as TaskUtil from "./task-util";
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type FormattingContextType = "Block" | "RepetitiveElementsOwner" | "Table";
|
|
27
|
+
export type FragmentLayoutConstraintType = "AfterIfContinue" | "EntireTable" | "RepetitiveElementsOwner" | "TableRow";
|
|
28
28
|
export declare namespace CssCascade {
|
|
29
29
|
type ElementStyle = {
|
|
30
30
|
[key: string]: any;
|
|
@@ -8,7 +8,7 @@ import * as Task from "./task";
|
|
|
8
8
|
import * as TaskUtil from "./task-util";
|
|
9
9
|
import * as Vtree from "./vtree";
|
|
10
10
|
import { XmlDoc } from "./types";
|
|
11
|
-
export
|
|
11
|
+
export type CustomRenderer = (p1: Element, p2: Element, p3: {
|
|
12
12
|
[key: string]: Css.Val;
|
|
13
13
|
}) => Task.Result<Element>;
|
|
14
14
|
export interface CustomRendererFactory {
|
|
@@ -42,14 +42,14 @@ export declare class DelayedItem {
|
|
|
42
42
|
value: Css.Val;
|
|
43
43
|
constructor(target: Element, name: string, value: Css.Val);
|
|
44
44
|
}
|
|
45
|
-
export
|
|
45
|
+
export type PageHyperlinkEvent = {
|
|
46
46
|
type: string;
|
|
47
47
|
target: any;
|
|
48
48
|
currentTarget: any;
|
|
49
49
|
anchorElement: Element;
|
|
50
50
|
href: string;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
52
|
+
export type Trigger = {
|
|
53
53
|
observer: string;
|
|
54
54
|
event: string;
|
|
55
55
|
action: string;
|
|
@@ -111,7 +111,7 @@ export declare class Page extends Base.SimpleEventTarget {
|
|
|
111
111
|
registerElementWithId(element: Element, id: string): void;
|
|
112
112
|
finish(triggers: Trigger[], clientLayout: ClientLayout): void;
|
|
113
113
|
}
|
|
114
|
-
export
|
|
114
|
+
export type Spread = {
|
|
115
115
|
left: Page;
|
|
116
116
|
right: Page;
|
|
117
117
|
};
|
|
@@ -120,7 +120,7 @@ export declare type Spread = {
|
|
|
120
120
|
*/
|
|
121
121
|
export declare const SPECIAL_ATTR = "data-adapt-spec";
|
|
122
122
|
export declare const Whitespace: typeof Vtree.Whitespace;
|
|
123
|
-
export
|
|
123
|
+
export type Whitespace = Vtree.Whitespace;
|
|
124
124
|
/**
|
|
125
125
|
* Resolves Whitespace value from a value of 'white-space' property
|
|
126
126
|
* @param whitespace The value of 'white-space' property
|
|
@@ -148,32 +148,32 @@ export declare class FlowChunk {
|
|
|
148
148
|
constructor(flowName: string, element: Element, startOffset: number, priority: number, linger: number, exclusive: boolean, repeated: boolean, last: boolean, breakBefore: string | null);
|
|
149
149
|
isBetter(other: FlowChunk): boolean;
|
|
150
150
|
}
|
|
151
|
-
export
|
|
151
|
+
export type ClientRect = Vtree.ClientRect;
|
|
152
152
|
export declare function clientrectIncreasingTop(r1: ClientRect, r2: ClientRect): number;
|
|
153
153
|
export declare function clientrectDecreasingRight(r1: ClientRect, r2: ClientRect): number;
|
|
154
154
|
/**
|
|
155
155
|
* Interface to read the position assigned to the elements and ranges by the
|
|
156
156
|
* browser.
|
|
157
157
|
*/
|
|
158
|
-
export
|
|
158
|
+
export type ClientLayout = Vtree.ClientLayout;
|
|
159
159
|
/**
|
|
160
160
|
* Styling, creating a single node's view, etc.
|
|
161
161
|
*/
|
|
162
|
-
export
|
|
162
|
+
export type LayoutContext = Vtree.LayoutContext;
|
|
163
163
|
/**
|
|
164
164
|
* Formatting context.
|
|
165
165
|
*/
|
|
166
|
-
export
|
|
166
|
+
export type FormattingContext = Vtree.FormattingContext;
|
|
167
167
|
export declare function eachAncestorFormattingContext(nodeContext: NodeContext, callback: (p1: FormattingContext) => any): void;
|
|
168
|
-
export
|
|
168
|
+
export type NodePositionStep = Vtree.NodePositionStep;
|
|
169
169
|
export declare function isSameNodePositionStep(nps1: NodePositionStep, nps2: NodePositionStep): boolean;
|
|
170
|
-
export
|
|
170
|
+
export type NodePosition = Vtree.NodePosition;
|
|
171
171
|
export declare function isSameNodePosition(np1: NodePosition | null, np2: NodePosition | null): boolean;
|
|
172
172
|
export declare function newNodePositionFromNode(node: Node): NodePosition;
|
|
173
173
|
export declare function newNodePositionFromNodeContext(nodeContext: Vtree.NodeContext, initialFragmentIndex: number | null): NodePosition;
|
|
174
174
|
export declare function makeNodeContextFromNodePositionStep(step: NodePositionStep, parent: Vtree.NodeContext): NodeContext;
|
|
175
175
|
export declare const ShadowType: typeof Vtree.ShadowType;
|
|
176
|
-
export
|
|
176
|
+
export type ShadowType = Vtree.ShadowType;
|
|
177
177
|
/**
|
|
178
178
|
* Data about shadow tree instance.
|
|
179
179
|
*/
|
|
@@ -376,7 +376,7 @@ export declare class Container implements Vtree.Container {
|
|
|
376
376
|
getOuterShape(outerShapeProp: Css.Val, context: Exprs.Context): GeometryUtil.Shape;
|
|
377
377
|
getOuterRect(): GeometryUtil.Rect;
|
|
378
378
|
}
|
|
379
|
-
export
|
|
379
|
+
export type ExprContentListener = Vtree.ExprContentListener;
|
|
380
380
|
export declare class ContentPropertyHandler extends Css.Visitor {
|
|
381
381
|
readonly elem: Element;
|
|
382
382
|
readonly context: Exprs.Context;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Net from "./net";
|
|
2
2
|
import * as Task from "./task";
|
|
3
3
|
import { XmlDoc } from "./types";
|
|
4
|
-
export
|
|
4
|
+
export type XMLDocStore = XmlDoc.XMLDocStore;
|
|
5
5
|
export declare class XMLDocHolder implements XmlDoc.XMLDocHolder {
|
|
6
6
|
readonly store: XMLDocStore;
|
|
7
7
|
readonly url: string;
|