@vivliostyle/core 2.31.1 → 2.31.2
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/net.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { Net, XmlDoc } from "./types";
|
|
|
25
25
|
/**
|
|
26
26
|
* @enum {string}
|
|
27
27
|
*/
|
|
28
|
-
export declare enum
|
|
28
|
+
export declare enum FetchResponseType {
|
|
29
29
|
DEFAULT = "",
|
|
30
30
|
ARRAYBUFFER = "arraybuffer",
|
|
31
31
|
BLOB = "blob",
|
|
@@ -33,8 +33,8 @@ export declare enum XMLHttpRequestResponseType {
|
|
|
33
33
|
JSON = "json",
|
|
34
34
|
TEXT = "text"
|
|
35
35
|
}
|
|
36
|
-
export type
|
|
37
|
-
export declare function
|
|
36
|
+
export type FetchResponse = Net.FetchResponse;
|
|
37
|
+
export declare function fetchFromURL(url: string, opt_type?: FetchResponseType, opt_method?: string): Task.Result<FetchResponse>;
|
|
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>;
|
|
40
40
|
export declare function revokeObjectURL(url: string): void;
|
|
@@ -46,15 +46,15 @@ export declare function createObjectURL(blob: Blob): string;
|
|
|
46
46
|
* @template Resource
|
|
47
47
|
*/
|
|
48
48
|
export declare class ResourceStore<Resource> implements Net.ResourceStore<Resource> {
|
|
49
|
-
readonly parser: (p1:
|
|
50
|
-
readonly type:
|
|
49
|
+
readonly parser: (p1: FetchResponse, p2: ResourceStore<Resource>) => Task.Result<Resource>;
|
|
50
|
+
readonly type: FetchResponseType;
|
|
51
51
|
resources: {
|
|
52
52
|
[key: string]: Resource;
|
|
53
53
|
};
|
|
54
54
|
fetchers: {
|
|
55
55
|
[key: string]: TaskUtil.Fetcher<Resource>;
|
|
56
56
|
};
|
|
57
|
-
constructor(parser: (p1:
|
|
57
|
+
constructor(parser: (p1: FetchResponse, p2: ResourceStore<Resource>) => Task.Result<Resource>, type: FetchResponseType);
|
|
58
58
|
/**
|
|
59
59
|
* @return resource for the given URL
|
|
60
60
|
*/
|
|
@@ -68,7 +68,7 @@ export declare class ResourceStore<Resource> implements Net.ResourceStore<Resour
|
|
|
68
68
|
delete(url: string): void;
|
|
69
69
|
}
|
|
70
70
|
export type JSONStore = ResourceStore<Base.JSON>;
|
|
71
|
-
export declare function parseJSONResource(response:
|
|
71
|
+
export declare function parseJSONResource(response: FetchResponse, store: JSONStore): Task.Result<Base.JSON>;
|
|
72
72
|
export declare function newJSONStore(): JSONStore;
|
|
73
73
|
/**
|
|
74
74
|
* @return holding event type (load/error/abort)
|
package/lib/vivliostyle/ops.d.ts
CHANGED
|
@@ -222,7 +222,7 @@ export type StyleSource = {
|
|
|
222
222
|
classes: string | null;
|
|
223
223
|
media: string | null;
|
|
224
224
|
};
|
|
225
|
-
export declare function parseOPSResource(response: Net.
|
|
225
|
+
export declare function parseOPSResource(response: Net.FetchResponse, store: XmlDoc.XMLDocStore): Task.Result<XmlDoc.XMLDocHolder>;
|
|
226
226
|
export declare class OPSDocStore extends Net.ResourceStore<XmlDoc.XMLDocHolder> {
|
|
227
227
|
fontDeobfuscator: ((p1: string) => ((p1: Blob) => Task.Result<Blob>) | null) | null;
|
|
228
228
|
styleByKey: {
|
|
@@ -258,6 +258,6 @@ export declare class OPSDocStore extends Net.ResourceStore<XmlDoc.XMLDocHolder>
|
|
|
258
258
|
private clearStyleSheets;
|
|
259
259
|
private addAuthorStyleSheet;
|
|
260
260
|
private addUserStyleSheet;
|
|
261
|
-
parseOPSResource(response: Net.
|
|
261
|
+
parseOPSResource(response: Net.FetchResponse): Task.Result<XmlDoc.XMLDocHolder>;
|
|
262
262
|
processViewportMeta(meta: Element): string;
|
|
263
263
|
}
|
|
@@ -105,7 +105,6 @@ export declare class TableFormattingContext extends RepetitiveElementImpl.Repeti
|
|
|
105
105
|
getCellsFallingOnRow(rowIndex: number): TableCell[];
|
|
106
106
|
getRowSpanningCellsOverflowingTheRow(rowIndex: number): TableCell[];
|
|
107
107
|
getCellFragmentOfCell(cell: TableCell): TableCellFragment;
|
|
108
|
-
isFreelyFragmentableRow(row: TableRow): boolean;
|
|
109
108
|
getColumnCount(): number;
|
|
110
109
|
updateCellSizes(clientLayout: Vtree.ClientLayout): void;
|
|
111
110
|
/**
|
|
@@ -393,7 +393,7 @@ export declare namespace LayoutProcessor {
|
|
|
393
393
|
function isInstanceOfBlockFormattingContext(object: Vtree.FormattingContext): object is BlockFormattingContext;
|
|
394
394
|
}
|
|
395
395
|
export declare namespace Net {
|
|
396
|
-
type
|
|
396
|
+
type FetchResponse = {
|
|
397
397
|
status: number;
|
|
398
398
|
statusText: string | null;
|
|
399
399
|
url: string;
|
|
@@ -409,7 +409,7 @@ export declare namespace Net {
|
|
|
409
409
|
fetchers: {
|
|
410
410
|
[key: string]: TaskUtil.Fetcher<Resource>;
|
|
411
411
|
};
|
|
412
|
-
readonly parser: (p1:
|
|
412
|
+
readonly parser: (p1: FetchResponse, p2: ResourceStore<Resource>) => Task.Result<Resource>;
|
|
413
413
|
readonly type: XMLHttpRequestResponseType;
|
|
414
414
|
/**
|
|
415
415
|
* @return resource for the given URL
|
|
@@ -52,8 +52,8 @@ export declare function parseAndReturnNullIfError(str: string, type: string, opt
|
|
|
52
52
|
* @returns null if contentType cannot be inferred from HTTP header and file
|
|
53
53
|
* extension
|
|
54
54
|
*/
|
|
55
|
-
export declare function resolveContentType(response: Net.
|
|
56
|
-
export declare function parseXMLResource(response: Net.
|
|
55
|
+
export declare function resolveContentType(response: Net.FetchResponse): string | null;
|
|
56
|
+
export declare function parseXMLResource(response: Net.FetchResponse, store: XMLDocStore): Task.Result<XmlDoc.XMLDocHolder>;
|
|
57
57
|
export declare function newXMLDocStore(): XMLDocStore;
|
|
58
58
|
export declare class Predicate implements XmlDoc.Predicate {
|
|
59
59
|
readonly fn: (p1: Node) => boolean;
|