@vivliostyle/core 2.24.0 → 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.
@@ -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 declare type Action = (p1: Base.JSON) => Task.Result<boolean>;
10
- export declare type ViewportSize = {
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 declare type SingleDocumentParam = {
28
+ export type SingleDocumentParam = {
29
29
  url: string;
30
30
  startPage: number | null;
31
31
  skipPagesBefore: number | null;
@@ -18,7 +18,7 @@
18
18
  * @fileoverview Assets - Bundle resources
19
19
  */
20
20
  /** vivliostyle-viewport-screen.css */
21
- export declare const VivliostyleViewportScreenCss = "\n@media screen {\n [data-vivliostyle-viewer-viewport] {\n background: #aaaaaa;\n }\n\n [data-vivliostyle-page-container] {\n background: white;\n z-index: 0;\n }\n\n [data-vivliostyle-viewer-viewport] {\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: flex;\n flex: none;\n justify-content: center;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression=\"ltr\"]\n [data-vivliostyle-spread-container] {\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression=\"rtl\"]\n [data-vivliostyle-spread-container] {\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view=\"true\"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side=\"left\"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view=\"true\"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side=\"right\"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view=\"true\"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page=\"true\"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n}\n";
21
+ export declare const VivliostyleViewportScreenCss = "\n@media screen {\n [data-vivliostyle-viewer-viewport] {\n background: #aaaaaa;\n }\n\n [data-vivliostyle-page-container] {\n background: white;\n z-index: 0;\n }\n\n [data-vivliostyle-viewer-viewport] {\n box-sizing: border-box;\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: flex;\n flex: none;\n justify-content: center;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression=\"ltr\"]\n [data-vivliostyle-spread-container] {\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression=\"rtl\"]\n [data-vivliostyle-spread-container] {\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view=\"true\"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side=\"left\"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view=\"true\"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side=\"right\"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view=\"true\"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page=\"true\"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n}\n";
22
22
  /** vivliostyle-viewport.css */
23
23
  export declare const VivliostyleViewportCss = "\n[data-vivliostyle-layout-box] {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n z-index: -1;\n transform-origin: left top;\n}\n\n[data-vivliostyle-debug] [data-vivliostyle-layout-box] {\n right: auto;\n bottom: auto;\n overflow: visible;\n z-index: auto;\n}\n\n[data-vivliostyle-spread-container] {\n transform: scale(var(--viv-outputScale,1));\n transform-origin: left top;\n}\n\n/* Emulate high pixel ratio using zoom & transform:scale() */\n@supports (zoom: 8) {\n [data-vivliostyle-layout-box] {\n zoom: calc(var(--viv-outputPixelRatio,1) / var(--viv-devicePixelRatio,1));\n transform: scale(calc(var(--viv-devicePixelRatio,1) / var(--viv-outputPixelRatio,1)));\n }\n [data-vivliostyle-spread-container] {\n zoom: calc(var(--viv-outputPixelRatio,1) / var(--viv-devicePixelRatio,1));\n transform: scale(calc(var(--viv-outputScale,1) * var(--viv-devicePixelRatio,1) / var(--viv-outputPixelRatio,1)));\n }\n /* Workaround for Chromium's default border etc. widths not zoomed but scaled down */\n [data-vivliostyle-spread-container] :where([style*=border],[style*=outline],[style*=rule]) {\n border-width: medium;\n outline-width: medium;\n column-rule-width: medium;\n }\n [data-vivliostyle-spread-container] ::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n [data-vivliostyle-spread-container] ::-webkit-scrollbar-track {\n background-color: #f4f4f4;\n }\n [data-vivliostyle-spread-container] ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: #c7c7c7;\n }\n [data-vivliostyle-spread-container] ::-webkit-scrollbar-thumb:hover {\n background: #7d7d7d;\n }\n}\n\n[data-vivliostyle-page-container] {\n position: relative;\n overflow: hidden;\n}\n\n[data-vivliostyle-bleed-box] {\n position: absolute;\n overflow: hidden;\n background-origin: content-box !important;\n box-sizing: border-box;\n}\n\n[data-vivliostyle-page-box] ~ [data-vivliostyle-page-box] {\n display: none;\n}\n\n[data-vivliostyle-toc-box] {\n position: absolute;\n left: 3px;\n top: 3px;\n overflow: scroll;\n overflow-x: hidden;\n background: rgba(248, 248, 248, 0.9);\n border-radius: 2px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);\n}\n\n@media print {\n [data-vivliostyle-toc-box] {\n display: none;\n }\n\n [data-vivliostyle-outer-zoom-box],\n [data-vivliostyle-spread-container] {\n width: 100% !important;\n height: 100% !important;\n }\n\n [data-vivliostyle-spread-container] {\n --viv-outputScale: 1 !important;\n --viv-devicePixelRatio: 1 !important;\n zoom: normal !important;\n transform: none !important;\n }\n\n @supports (zoom: 8) {\n [data-vivliostyle-spread-container] [data-vivliostyle-page-container] {\n zoom: var(--viv-outputPixelRatio,1);\n transform: scale(calc(1 / var(--viv-outputPixelRatio,1)));\n transform-origin: left top;\n }\n }\n\n [data-vivliostyle-spread-container] [data-vivliostyle-page-container] {\n display: block !important;\n max-height: 100vh;\n }\n\n [data-vivliostyle-spread-container] [data-vivliostyle-page-container]:not(:last-child) {\n break-after: page;\n }\n\n /* Gecko-only hack, see https://bugzilla.mozilla.org/show_bug.cgi?id=267029#c17 */\n @-moz-document url-prefix() {\n [data-vivliostyle-spread-container] [data-vivliostyle-page-container]:nth-last-child(n + 2) {\n top: -1px;\n margin-top: 1px;\n margin-bottom: -1px;\n }\n /* Workaround Gecko problem on page break */\n [data-vivliostyle-spread-container] [data-vivliostyle-page-container] {\n break-after: auto !important;\n height: 100% !important;\n }\n }\n}\n";
24
24
  /** validation.txt */
@@ -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 declare type JSON = any;
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 declare type Event = {
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 declare type EventListener = (p1: Event) => void;
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 declare type EventTarget = SimpleEventTarget;
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 declare type BreakPosition = Layout.BreakPosition;
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
- declare type BoxBreakFlag = "inline-start" | "inline-end" | "block-start" | "block-end" | "text-start" | "text-end" | "justify" | "clone";
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
- declare type MarginDiscardFlag = "block-start" | "block-end" | "inline-start" | "inline-end";
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;
@@ -19,7 +19,7 @@
19
19
  * @fileoverview Cfi - Support for EPUB Canonical Fragment Identifiers.
20
20
  */
21
21
  import * as Base from "./base";
22
- export declare type Position = {
22
+ export type Position = {
23
23
  node: Node;
24
24
  offset: number;
25
25
  after: boolean;
@@ -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 declare type ColumnLayoutResult = {
6
+ export type ColumnLayoutResult = {
7
7
  columns: Layout.Column[];
8
8
  position: Vtree.LayoutPosition;
9
9
  columnPageFloatLayoutContexts?: PageFloats.PageFloatLayoutContext[];
10
10
  };
11
- export declare type ColumnGenerator = () => Task.Result<ColumnLayoutResult | null>;
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 declare type CoreViewerSettings = {
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 declare type CoreViewerOptions = {
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 declare type DocumentOptions = {
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 declare type SingleDocumentOptions = string | {
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 declare type ZoomType = AdaptiveViewer.ZoomType;
237
+ export type ZoomType = AdaptiveViewer.ZoomType;
238
238
  export declare const ZoomType: typeof AdaptiveViewer.ZoomType;
239
- export declare type PageViewMode = AdaptiveViewer.PageViewMode;
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 declare type ElementStyle = {
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 declare type ElementStyleMap = {
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 declare type ActionTable = {
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 declare type CounterValues = {
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 declare type ChineseNumbering = {
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 declare type PageSize = {
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 declare type PageSizeAndBleed = {
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 declare type EvaluatedPageSizeAndBleed = {
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 declare type PageMarginBoxInformation = {
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 declare type PageAreaDimension = {
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: Action[]): Action[];
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 declare type ValueMap = {
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 declare type Change = (number | string)[];
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 declare type Position = {
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 declare type OPFItemParam = {
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 declare type PageAndPosition = {
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 declare type OPFViewItem = {
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 declare type Preferences = {
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
- declare type Special = Pending;
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 declare type Result = string | number | boolean | undefined;
53
- export declare type PendingResult = Special | Result;
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 declare type ScopeContext = {
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 declare type DependencyCache = {
146
+ export type DependencyCache = {
147
147
  [key: string]: boolean | Special;
148
148
  };
149
149
  export declare class Val {
@@ -1,6 +1,6 @@
1
1
  import * as Task from "./task";
2
2
  import { Layout, Vtree } from "./types";
3
- export declare type LayoutIteratorState = {
3
+ export type LayoutIteratorState = {
4
4
  nodeContext: Vtree.NodeContext;
5
5
  atUnforcedBreak: boolean;
6
6
  break: boolean;
@@ -84,7 +84,7 @@ export declare const mediaTags: {
84
84
  /**
85
85
  * Represents a constraint on layout
86
86
  */
87
- export declare type LayoutConstraint = Layout.LayoutConstraint;
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 declare type FragmentLayoutConstraint = Layout.FragmentLayoutConstraint;
102
- export declare type BreakPositionAndNodeContext = Layout.BreakPositionAndNodeContext;
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 declare type SinglePageFloatLayoutResult = Layout.SinglePageFloatLayoutResult;
401
+ export type SinglePageFloatLayoutResult = Layout.SinglePageFloatLayoutResult;
402
402
  /**
403
403
  * breaking point resolver for Text Node.
404
404
  */
@@ -27,7 +27,7 @@ export declare enum LogLevel {
27
27
  WARN = 3,
28
28
  ERROR = 4
29
29
  }
30
- export declare type ErrorInfo = {
30
+ export type ErrorInfo = {
31
31
  error: Error;
32
32
  messages: any[];
33
33
  };
@@ -33,7 +33,7 @@ export declare enum XMLHttpRequestResponseType {
33
33
  JSON = "json",
34
34
  TEXT = "text"
35
35
  }
36
- export declare type Response = Net.Response;
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 declare type JSONStore = ResourceStore<Base.JSON>;
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;
@@ -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 declare type FontFace = {
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 declare type StyleSource = {
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 declare type FloatReference = PageFloats.FloatReference;
7
- declare type PageFloatID = PageFloats.PageFloatID;
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 declare type PageFloatPlacementCondition = PageFloats.PageFloatPlacementCondition;
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 declare type PreProcessSingleDocumentHook = (p1: Document) => any;
131
- export declare type PreProcessTextContentHook = (p1: Vtree.NodeContext, p2: string) => Task.Result<string>;
132
- export declare type PreProcessElementStyleHook = (p1: Vtree.NodeContext, p2: object) => void;
133
- export declare type PolyfilledInheritedPropsHook = () => string[];
134
- export declare type ConfigurationHook = (p1: Base.JSON) => {
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 declare type ResolveTextNodeBreakerHook = (p1: Vtree.NodeContext) => Layout.TextNodeBreaker;
139
- export declare type ResolveFormattingContextHook = (p1: Vtree.NodeContext, p2: boolean, p3: Css.Ident, p4: Css.Ident, p5: Css.Ident, p6: boolean) => Vtree.FormattingContext;
140
- export declare type ResolveLayoutProcessorHook = (p1: Vtree.FormattingContext) => LayoutProcessor.LayoutProcessor;
141
- export declare type PostLayoutBlockHook = (p1: Vtree.NodeContext, p2: Vtree.NodeContext[], p3: Layout.Column) => void;
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 declare type ElementsOffset = RepetitiveElement.ElementsOffset;
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 declare type BrokenTableCellPosition = {
70
+ export type BrokenTableCellPosition = {
71
71
  cellNodePosition: Vtree.NodePosition;
72
72
  breakChunkPosition: Vtree.ChunkPosition;
73
73
  cell: TableCell;
@@ -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 declare type TOCItem = {
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 declare type FormattingContextType = "Block" | "RepetitiveElementsOwner" | "Table";
27
- export declare type FragmentLayoutConstraintType = "AfterIfContinue" | "EntireTable" | "RepetitiveElementsOwner" | "TableRow";
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 declare type CustomRenderer = (p1: Element, p2: Element, p3: {
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 {