@likecoin/epubcheck-ts 0.1.0
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/LICENSE +674 -0
- package/README.md +339 -0
- package/dist/index.cjs +1904 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +523 -0
- package/dist/index.d.ts +523 -0
- package/dist/index.js +1895 -0
- package/dist/index.js.map +1 -0
- package/package.json +69 -0
- package/schemas/applications.rng +429 -0
- package/schemas/aria.rng +3355 -0
- package/schemas/block.rng +488 -0
- package/schemas/common.rng +1076 -0
- package/schemas/container.rng +24 -0
- package/schemas/core-scripting.rng +950 -0
- package/schemas/data.rng +161 -0
- package/schemas/datatypes.rng +401 -0
- package/schemas/embed.rng +980 -0
- package/schemas/epub-mathml3-inc.rng +161 -0
- package/schemas/epub-nav-30.rnc +44 -0
- package/schemas/epub-nav-30.rng +19985 -0
- package/schemas/epub-nav-30.sch +87 -0
- package/schemas/epub-prefix-attr.rng +17 -0
- package/schemas/epub-shared-inc.rng +29 -0
- package/schemas/epub-ssml-attrs.rng +17 -0
- package/schemas/epub-svg-30.rnc +17 -0
- package/schemas/epub-svg-30.rng +19903 -0
- package/schemas/epub-svg-30.sch +7 -0
- package/schemas/epub-svg-forgiving-inc.rng +315 -0
- package/schemas/epub-switch.rng +121 -0
- package/schemas/epub-trigger.rng +90 -0
- package/schemas/epub-type-attr.rng +12 -0
- package/schemas/epub-xhtml-30.rnc +6 -0
- package/schemas/epub-xhtml-30.rng +19882 -0
- package/schemas/epub-xhtml-30.sch +409 -0
- package/schemas/epub-xhtml-inc.rng +151 -0
- package/schemas/epub-xhtml-integration.rng +565 -0
- package/schemas/epub-xhtml-svg-mathml.rng +17 -0
- package/schemas/form-datatypes.rng +54 -0
- package/schemas/mathml3-common.rng +336 -0
- package/schemas/mathml3-content.rng +1552 -0
- package/schemas/mathml3-inc.rng +30 -0
- package/schemas/mathml3-presentation.rng +2341 -0
- package/schemas/mathml3-strict-content.rng +205 -0
- package/schemas/media.rng +374 -0
- package/schemas/meta.rng +754 -0
- package/schemas/microdata.rng +192 -0
- package/schemas/ncx.rng +308 -0
- package/schemas/ocf-container-30.rnc +37 -0
- package/schemas/ocf-container-30.rng +568 -0
- package/schemas/opf.rng +15 -0
- package/schemas/opf20.rng +513 -0
- package/schemas/package-30.rnc +133 -0
- package/schemas/package-30.rng +1153 -0
- package/schemas/package-30.sch +444 -0
- package/schemas/phrase.rng +746 -0
- package/schemas/rdfa.rng +552 -0
- package/schemas/revision.rng +106 -0
- package/schemas/ruby.rng +141 -0
- package/schemas/sectional.rng +278 -0
- package/schemas/structural.rng +298 -0
- package/schemas/tables.rng +420 -0
- package/schemas/web-components.rng +184 -0
- package/schemas/web-forms.rng +975 -0
- package/schemas/web-forms2.rng +1236 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a manifest item in the OPF
|
|
3
|
+
*/
|
|
4
|
+
interface ManifestItem {
|
|
5
|
+
/** Unique identifier for this item */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Path relative to the OPF file */
|
|
8
|
+
href: string;
|
|
9
|
+
/** MIME media type */
|
|
10
|
+
mediaType: string;
|
|
11
|
+
/** Fallback item ID for non-standard media types */
|
|
12
|
+
fallback?: string;
|
|
13
|
+
/** Media overlay ID */
|
|
14
|
+
mediaOverlay?: string;
|
|
15
|
+
/** Item properties (EPUB 3) - e.g., 'nav', 'scripted', 'svg', 'remote-resources' */
|
|
16
|
+
properties?: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Represents a spine itemref in the OPF
|
|
20
|
+
*/
|
|
21
|
+
interface SpineItemRef {
|
|
22
|
+
/** Reference to manifest item ID */
|
|
23
|
+
idref: string;
|
|
24
|
+
/** Whether this item is part of the linear reading order */
|
|
25
|
+
linear: boolean;
|
|
26
|
+
/** Itemref properties (EPUB 3) - e.g., 'page-spread-left', 'page-spread-right' */
|
|
27
|
+
properties?: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Represents a guide reference (EPUB 2)
|
|
31
|
+
*/
|
|
32
|
+
interface GuideReference {
|
|
33
|
+
/** Type of reference (cover, toc, etc.) */
|
|
34
|
+
type: string;
|
|
35
|
+
/** Title for display */
|
|
36
|
+
title?: string;
|
|
37
|
+
/** Path to the referenced item */
|
|
38
|
+
href: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Dublin Core metadata element
|
|
42
|
+
*/
|
|
43
|
+
interface DCElement {
|
|
44
|
+
/** The element name (title, creator, identifier, etc.) */
|
|
45
|
+
name: string;
|
|
46
|
+
/** The text content */
|
|
47
|
+
value: string;
|
|
48
|
+
/** The id attribute, if any */
|
|
49
|
+
id?: string;
|
|
50
|
+
/** Additional attributes */
|
|
51
|
+
attributes?: Record<string, string>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* EPUB 3 meta element
|
|
55
|
+
*/
|
|
56
|
+
interface MetaElement {
|
|
57
|
+
/** Property name (with optional prefix) */
|
|
58
|
+
property: string;
|
|
59
|
+
/** The text content */
|
|
60
|
+
value: string;
|
|
61
|
+
/** ID of the element this meta refines */
|
|
62
|
+
refines?: string;
|
|
63
|
+
/** Scheme for the value */
|
|
64
|
+
scheme?: string;
|
|
65
|
+
/** The id attribute, if any */
|
|
66
|
+
id?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* EPUB 3 link element
|
|
70
|
+
*/
|
|
71
|
+
interface LinkElement {
|
|
72
|
+
/** Relationship type */
|
|
73
|
+
rel: string;
|
|
74
|
+
/** URL to the linked resource */
|
|
75
|
+
href: string;
|
|
76
|
+
/** Media type of the linked resource */
|
|
77
|
+
mediaType?: string;
|
|
78
|
+
/** ID of the element this link refines */
|
|
79
|
+
refines?: string;
|
|
80
|
+
/** Link properties */
|
|
81
|
+
properties?: string[];
|
|
82
|
+
/** The id attribute, if any */
|
|
83
|
+
id?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Parsed OPF package document
|
|
87
|
+
*/
|
|
88
|
+
interface PackageDocument {
|
|
89
|
+
/** EPUB version from package@version */
|
|
90
|
+
version: EPUBVersion;
|
|
91
|
+
/** Unique identifier reference (package@unique-identifier) */
|
|
92
|
+
uniqueIdentifier: string;
|
|
93
|
+
/** Package prefix declarations (EPUB 3) */
|
|
94
|
+
prefixes?: Record<string, string>;
|
|
95
|
+
/** Package direction (rtl, ltr, auto) */
|
|
96
|
+
dir?: string;
|
|
97
|
+
/** Dublin Core metadata elements */
|
|
98
|
+
dcElements: DCElement[];
|
|
99
|
+
/** EPUB 3 meta elements */
|
|
100
|
+
metaElements: MetaElement[];
|
|
101
|
+
/** EPUB 3 link elements */
|
|
102
|
+
linkElements: LinkElement[];
|
|
103
|
+
/** Manifest items */
|
|
104
|
+
manifest: ManifestItem[];
|
|
105
|
+
/** Spine item references */
|
|
106
|
+
spine: SpineItemRef[];
|
|
107
|
+
/** Spine toc attribute (NCX reference for EPUB 2) */
|
|
108
|
+
spineToc?: string;
|
|
109
|
+
/** Spine page-progression-direction */
|
|
110
|
+
pageProgressionDirection?: 'ltr' | 'rtl' | 'default';
|
|
111
|
+
/** Guide references (EPUB 2) */
|
|
112
|
+
guide: GuideReference[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Severity levels for validation messages
|
|
117
|
+
*/
|
|
118
|
+
type Severity = 'fatal' | 'error' | 'warning' | 'info' | 'usage';
|
|
119
|
+
/**
|
|
120
|
+
* Supported EPUB versions
|
|
121
|
+
*/
|
|
122
|
+
type EPUBVersion = '2.0' | '3.0' | '3.1' | '3.2' | '3.3';
|
|
123
|
+
/**
|
|
124
|
+
* EPUB validation profiles
|
|
125
|
+
*/
|
|
126
|
+
type EPUBProfile = 'default' | 'edupub' | 'idx' | 'dict' | 'preview';
|
|
127
|
+
/**
|
|
128
|
+
* Location within an EPUB file
|
|
129
|
+
*/
|
|
130
|
+
interface EPUBLocation {
|
|
131
|
+
/** Path to the file within the EPUB container */
|
|
132
|
+
path: string;
|
|
133
|
+
/** Line number (1-based), if applicable */
|
|
134
|
+
line?: number;
|
|
135
|
+
/** Column number (1-based), if applicable */
|
|
136
|
+
column?: number;
|
|
137
|
+
/** Additional context about the location */
|
|
138
|
+
context?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* A validation message (error, warning, etc.)
|
|
142
|
+
*/
|
|
143
|
+
interface ValidationMessage {
|
|
144
|
+
/** Unique message identifier */
|
|
145
|
+
id: string;
|
|
146
|
+
/** Severity level */
|
|
147
|
+
severity: Severity;
|
|
148
|
+
/** Human-readable message */
|
|
149
|
+
message: string;
|
|
150
|
+
/** Location where the issue was found */
|
|
151
|
+
location?: EPUBLocation;
|
|
152
|
+
/** Suggestion for fixing the issue */
|
|
153
|
+
suggestion?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Result of EPUB validation
|
|
157
|
+
*/
|
|
158
|
+
interface EpubCheckResult {
|
|
159
|
+
/** Whether the EPUB is valid (no errors or fatal errors) */
|
|
160
|
+
valid: boolean;
|
|
161
|
+
/** All validation messages */
|
|
162
|
+
messages: ValidationMessage[];
|
|
163
|
+
/** Count of fatal errors */
|
|
164
|
+
fatalCount: number;
|
|
165
|
+
/** Count of errors */
|
|
166
|
+
errorCount: number;
|
|
167
|
+
/** Count of warnings */
|
|
168
|
+
warningCount: number;
|
|
169
|
+
/** Count of info messages */
|
|
170
|
+
infoCount: number;
|
|
171
|
+
/** Count of usage messages */
|
|
172
|
+
usageCount: number;
|
|
173
|
+
/** Detected EPUB version */
|
|
174
|
+
version?: EPUBVersion | undefined;
|
|
175
|
+
/** Time taken for validation in milliseconds */
|
|
176
|
+
elapsedMs: number;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Options for EpubCheck
|
|
180
|
+
*/
|
|
181
|
+
interface EpubCheckOptions {
|
|
182
|
+
/** EPUB version to validate against (auto-detected if not specified) */
|
|
183
|
+
version?: EPUBVersion;
|
|
184
|
+
/** Validation profile */
|
|
185
|
+
profile?: EPUBProfile;
|
|
186
|
+
/** Whether to include usage messages */
|
|
187
|
+
includeUsage?: boolean;
|
|
188
|
+
/** Whether to include info messages */
|
|
189
|
+
includeInfo?: boolean;
|
|
190
|
+
/** Maximum number of errors before stopping (0 = unlimited) */
|
|
191
|
+
maxErrors?: number;
|
|
192
|
+
/** Locale for messages (e.g., 'en', 'de', 'fr') */
|
|
193
|
+
locale?: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Internal validation context passed through the validation pipeline
|
|
197
|
+
*/
|
|
198
|
+
interface ValidationContext {
|
|
199
|
+
/** EPUB file data */
|
|
200
|
+
data: Uint8Array;
|
|
201
|
+
/** Validation options */
|
|
202
|
+
options: Required<EpubCheckOptions>;
|
|
203
|
+
/** Detected EPUB version */
|
|
204
|
+
version: EPUBVersion;
|
|
205
|
+
/** Validation messages collected so far */
|
|
206
|
+
messages: ValidationMessage[];
|
|
207
|
+
/** Files extracted from EPUB container */
|
|
208
|
+
files: Map<string, Uint8Array>;
|
|
209
|
+
/** Rootfiles found in container.xml */
|
|
210
|
+
rootfiles: Rootfile[];
|
|
211
|
+
/** Path to the package document (OPF) */
|
|
212
|
+
opfPath?: string;
|
|
213
|
+
/** Parsed package document */
|
|
214
|
+
packageDocument?: PackageDocument;
|
|
215
|
+
/** NCX UID for validation against OPF identifier */
|
|
216
|
+
ncxUid?: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Rootfile reference from container.xml
|
|
220
|
+
*/
|
|
221
|
+
interface Rootfile {
|
|
222
|
+
path: string;
|
|
223
|
+
mediaType: string;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Main EPUB validation class
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* import { EpubCheck } from 'epubcheck-ts';
|
|
232
|
+
*
|
|
233
|
+
* // Validate from a Uint8Array (works in Node.js and browsers)
|
|
234
|
+
* const result = await EpubCheck.validate(epubData);
|
|
235
|
+
*
|
|
236
|
+
* if (result.valid) {
|
|
237
|
+
* console.log('EPUB is valid!');
|
|
238
|
+
* } else {
|
|
239
|
+
* console.log(`Found ${result.errorCount} errors`);
|
|
240
|
+
* for (const msg of result.messages) {
|
|
241
|
+
* console.log(`${msg.severity}: ${msg.message}`);
|
|
242
|
+
* }
|
|
243
|
+
* }
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
declare class EpubCheck {
|
|
247
|
+
private readonly options;
|
|
248
|
+
/**
|
|
249
|
+
* Create a new EpubCheck instance with custom options
|
|
250
|
+
*/
|
|
251
|
+
constructor(options?: EpubCheckOptions);
|
|
252
|
+
/**
|
|
253
|
+
* Validate an EPUB file
|
|
254
|
+
*
|
|
255
|
+
* @param data - The EPUB file as a Uint8Array
|
|
256
|
+
* @returns Validation result
|
|
257
|
+
*/
|
|
258
|
+
check(data: Uint8Array): Promise<EpubCheckResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Static method to validate an EPUB file with default options
|
|
261
|
+
*
|
|
262
|
+
* @param data - The EPUB file as a Uint8Array
|
|
263
|
+
* @param options - Optional validation options
|
|
264
|
+
* @returns Validation result
|
|
265
|
+
*/
|
|
266
|
+
static validate(data: Uint8Array, options?: EpubCheckOptions): Promise<EpubCheckResult>;
|
|
267
|
+
/**
|
|
268
|
+
* Get the current EPUB version being validated against
|
|
269
|
+
*/
|
|
270
|
+
get version(): EPUBVersion;
|
|
271
|
+
/**
|
|
272
|
+
* Validate NCX navigation document (EPUB 2.0)
|
|
273
|
+
*/
|
|
274
|
+
private validateNCX;
|
|
275
|
+
/**
|
|
276
|
+
* Add a validation message to the context
|
|
277
|
+
*/
|
|
278
|
+
protected addMessage(messages: ValidationMessage[], message: ValidationMessage): void;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Build a validation result from messages
|
|
283
|
+
*/
|
|
284
|
+
declare function buildReport(messages: ValidationMessage[], version: EPUBVersion | undefined, elapsedMs: number): EpubCheckResult;
|
|
285
|
+
/**
|
|
286
|
+
* Count messages by severity
|
|
287
|
+
*/
|
|
288
|
+
declare function countBySeverity(messages: ValidationMessage[]): Record<Severity, number>;
|
|
289
|
+
/**
|
|
290
|
+
* Filter messages by severity
|
|
291
|
+
*/
|
|
292
|
+
declare function filterBySeverity(messages: ValidationMessage[], severity: Severity): ValidationMessage[];
|
|
293
|
+
/**
|
|
294
|
+
* Filter messages by path
|
|
295
|
+
*/
|
|
296
|
+
declare function filterByPath(messages: ValidationMessage[], path: string): ValidationMessage[];
|
|
297
|
+
/**
|
|
298
|
+
* Format messages as a string for display
|
|
299
|
+
*/
|
|
300
|
+
declare function formatMessages(messages: ValidationMessage[]): string;
|
|
301
|
+
/**
|
|
302
|
+
* Convert result to JSON report format (compatible with EPUBCheck JSON output)
|
|
303
|
+
*/
|
|
304
|
+
declare function toJSONReport(result: EpubCheckResult): string;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Message IDs for EPUB validation errors and warnings
|
|
308
|
+
*
|
|
309
|
+
* These IDs are compatible with the Java EPUBCheck implementation
|
|
310
|
+
* to ensure consistent error reporting.
|
|
311
|
+
*
|
|
312
|
+
* Prefix meanings:
|
|
313
|
+
* - ACC: Accessibility
|
|
314
|
+
* - CHK: Internal checker errors
|
|
315
|
+
* - CSS: CSS validation
|
|
316
|
+
* - HTM: HTML/XHTML content
|
|
317
|
+
* - MED: Media (audio, video, images)
|
|
318
|
+
* - NAV: Navigation document
|
|
319
|
+
* - NCX: NCX (EPUB 2 navigation)
|
|
320
|
+
* - OPF: Package document
|
|
321
|
+
* - PKG: Package/container level
|
|
322
|
+
* - RSC: Resources
|
|
323
|
+
* - SCH: Schematron validation
|
|
324
|
+
* - SCP: Scripting
|
|
325
|
+
*/
|
|
326
|
+
declare enum MessageId {
|
|
327
|
+
PKG_001 = "PKG-001",// Unable to read EPUB file
|
|
328
|
+
PKG_002 = "PKG-002",// Missing META-INF directory
|
|
329
|
+
PKG_003 = "PKG-003",// Missing container.xml
|
|
330
|
+
PKG_004 = "PKG-004",// No rootfile in container.xml
|
|
331
|
+
PKG_005 = "PKG-005",// Mimetype not first in ZIP
|
|
332
|
+
PKG_006 = "PKG-006",// Missing mimetype file
|
|
333
|
+
PKG_007 = "PKG-007",// Invalid mimetype content
|
|
334
|
+
PKG_008 = "PKG-008",// Mimetype has extra whitespace
|
|
335
|
+
PKG_009 = "PKG-009",// Mimetype compressed
|
|
336
|
+
PKG_010 = "PKG-010",// Rootfile not found
|
|
337
|
+
PKG_011 = "PKG-011",// Filename contains invalid characters
|
|
338
|
+
PKG_012 = "PKG-012",// Duplicate filename with different case
|
|
339
|
+
PKG_020 = "PKG-020",// OPF file not found
|
|
340
|
+
PKG_021 = "PKG-021",// Unexpected file in META-INF
|
|
341
|
+
PKG_022 = "PKG-022",// Cannot decrypt encrypted file
|
|
342
|
+
PKG_023 = "PKG-023",// Encrypted file without encryption.xml
|
|
343
|
+
PKG_024 = "PKG-024",// Obfuscated resource without encryption.xml
|
|
344
|
+
PKG_025 = "PKG-025",// Fatal error during validation
|
|
345
|
+
OPF_001 = "OPF-001",// Missing unique identifier
|
|
346
|
+
OPF_002 = "OPF-002",// Missing title element
|
|
347
|
+
OPF_003 = "OPF-003",// Missing language element
|
|
348
|
+
OPF_004 = "OPF-004",// Item not in manifest
|
|
349
|
+
OPF_005 = "OPF-005",// Manifest item not found
|
|
350
|
+
OPF_006 = "OPF-006",// Spine item not in manifest
|
|
351
|
+
OPF_007 = "OPF-007",// Duplicate manifest item ID
|
|
352
|
+
OPF_008 = "OPF-008",// Duplicate manifest item href
|
|
353
|
+
OPF_009 = "OPF-009",// Invalid spine toc reference
|
|
354
|
+
OPF_010 = "OPF-010",// Missing nav document
|
|
355
|
+
OPF_011 = "OPF-011",// Invalid date format
|
|
356
|
+
OPF_012 = "OPF-012",// Missing dc:identifier
|
|
357
|
+
OPF_013 = "OPF-013",// Remote resource not allowed
|
|
358
|
+
OPF_014 = "OPF-014",// Invalid manifest item media-type
|
|
359
|
+
OPF_097 = "OPF-097",// Resource not referenced
|
|
360
|
+
OPF_015 = "OPF-015",// Invalid guide reference
|
|
361
|
+
RSC_001 = "RSC-001",// Could not open resource
|
|
362
|
+
RSC_002 = "RSC-002",// Resource missing from manifest
|
|
363
|
+
RSC_003 = "RSC-003",// Resource not found
|
|
364
|
+
RSC_004 = "RSC-004",// Fragment identifier not found
|
|
365
|
+
RSC_005 = "RSC-005",// Schema validation error
|
|
366
|
+
RSC_006 = "RSC-006",// Remote resource referenced
|
|
367
|
+
RSC_007 = "RSC-007",// Referenced resource not in manifest
|
|
368
|
+
RSC_007w = "RSC-007w",// LINK reference missing (warning for EPUB 3)
|
|
369
|
+
RSC_008 = "RSC-008",// Undeclared resource
|
|
370
|
+
RSC_009 = "RSC-009",// Resource in spine not content document
|
|
371
|
+
RSC_010 = "RSC-010",// Non-content hyperlink
|
|
372
|
+
RSC_011 = "RSC-011",// Hyperlink to non-spine
|
|
373
|
+
RSC_012 = "RSC-012",// Fragment identifier not found
|
|
374
|
+
RSC_013 = "RSC-013",// Invalid language tag
|
|
375
|
+
RSC_014 = "RSC-014",// Invalid link relation
|
|
376
|
+
RSC_015 = "RSC-015",// Resource not reachable
|
|
377
|
+
RSC_016 = "RSC-016",// Fatal error reading resource
|
|
378
|
+
RSC_017 = "RSC-017",// Warning for resource
|
|
379
|
+
RSC_018 = "RSC-018",// Unused resource in package
|
|
380
|
+
RSC_019 = "RSC-019",// Fallback cycle detected
|
|
381
|
+
RSC_020 = "RSC-020",// Malformed URL
|
|
382
|
+
RSC_026 = "RSC-026",// File URL not allowed
|
|
383
|
+
RSC_027 = "RSC-027",// Absolute path not allowed
|
|
384
|
+
RSC_028 = "RSC-028",// Parent directory reference
|
|
385
|
+
RSC_029 = "RSC-029",// Data URL not allowed (EPUB 3)
|
|
386
|
+
RSC_031 = "RSC-031",// HTTPS required for remote
|
|
387
|
+
HTM_001 = "HTM-001",// Invalid XHTML
|
|
388
|
+
HTM_002 = "HTM-002",// Deprecated element
|
|
389
|
+
HTM_003 = "HTM-003",// Entity not declared
|
|
390
|
+
HTM_004 = "HTM-004",// External entity
|
|
391
|
+
HTM_005 = "HTM-005",// Element not allowed
|
|
392
|
+
HTM_006 = "HTM-006",// Required attribute missing
|
|
393
|
+
HTM_007 = "HTM-007",// ID not unique
|
|
394
|
+
HTM_008 = "HTM-008",// Invalid ID value
|
|
395
|
+
HTM_009 = "HTM-009",// HTML5 element in XHTML
|
|
396
|
+
HTM_010 = "HTM-010",// Namespace error
|
|
397
|
+
HTM_011 = "HTM-011",// Text not allowed
|
|
398
|
+
HTM_012 = "HTM-012",// Missing DOCTYPE
|
|
399
|
+
HTM_013 = "HTM-013",// Invalid DOCTYPE
|
|
400
|
+
HTM_014 = "HTM-014",// Invalid content
|
|
401
|
+
HTM_015 = "HTM-015",// Attribute not allowed
|
|
402
|
+
HTM_016 = "HTM-016",// Attribute value invalid
|
|
403
|
+
HTM_017 = "HTM-017",// Heading hierarchy
|
|
404
|
+
HTM_018 = "HTM-018",// Empty heading
|
|
405
|
+
HTM_019 = "HTM-019",// Anchors in same file
|
|
406
|
+
HTM_020 = "HTM-020",// SSML phoneme
|
|
407
|
+
HTM_021 = "HTM-021",// Invalid hyperlink target
|
|
408
|
+
HTM_022 = "HTM-022",// HREF value empty
|
|
409
|
+
HTM_023 = "HTM-023",// External hyperlink
|
|
410
|
+
HTM_024 = "HTM-024",// Hyperlink to non-document
|
|
411
|
+
HTM_025 = "HTM-025",// Non-registered attribute
|
|
412
|
+
HTM_026 = "HTM-026",// SVG font-face-src
|
|
413
|
+
HTM_027 = "HTM-027",// SVG switch
|
|
414
|
+
HTM_028 = "HTM-028",// Invalid lang attribute
|
|
415
|
+
HTM_029 = "HTM-029",// Character reference invalid
|
|
416
|
+
HTM_030 = "HTM-030",// Unescaped character
|
|
417
|
+
HTM_031 = "HTM-031",// Attribute duplicate
|
|
418
|
+
HTM_032 = "HTM-032",// Namespace undeclared
|
|
419
|
+
HTM_033 = "HTM-033",// Invalid attribute
|
|
420
|
+
CSS_001 = "CSS-001",// CSS parse error
|
|
421
|
+
CSS_002 = "CSS-002",// Unknown property
|
|
422
|
+
CSS_003 = "CSS-003",// Invalid property value
|
|
423
|
+
CSS_004 = "CSS-004",// CSS syntax error
|
|
424
|
+
CSS_005 = "CSS-005",// @font-face missing src
|
|
425
|
+
CSS_006 = "CSS-006",// Font not in manifest
|
|
426
|
+
CSS_007 = "CSS-007",// CSS import
|
|
427
|
+
CSS_008 = "CSS-008",// CSS encoding
|
|
428
|
+
CSS_009 = "CSS-009",// Invalid fixed layout CSS
|
|
429
|
+
CSS_010 = "CSS-010",// CSS property not allowed
|
|
430
|
+
CSS_011 = "CSS-011",// Viewport dimensions
|
|
431
|
+
CSS_012 = "CSS-012",// Font-face src format
|
|
432
|
+
CSS_015 = "CSS-015",// Font property deprecated
|
|
433
|
+
CSS_016 = "CSS-016",// CSS property vendor specific
|
|
434
|
+
CSS_017 = "CSS-017",// CSS pseudo element
|
|
435
|
+
CSS_019 = "CSS-019",// CSS absolute position
|
|
436
|
+
CSS_020 = "CSS-020",// CSS font embedded
|
|
437
|
+
CSS_021 = "CSS-021",// CSS unusual font
|
|
438
|
+
CSS_022 = "CSS-022",// CSS font OpenType
|
|
439
|
+
CSS_023 = "CSS-023",// Invalid font-face
|
|
440
|
+
NAV_001 = "NAV-001",// Invalid nav element
|
|
441
|
+
NAV_002 = "NAV-002",// Missing toc nav
|
|
442
|
+
NAV_003 = "NAV-003",// Nav heading order
|
|
443
|
+
NAV_004 = "NAV-004",// Nav reference external
|
|
444
|
+
NAV_005 = "NAV-005",// Nav reference invalid
|
|
445
|
+
NAV_006 = "NAV-006",// Nav structure invalid
|
|
446
|
+
NAV_007 = "NAV-007",// Nav element not found
|
|
447
|
+
NAV_008 = "NAV-008",// Nav link text empty
|
|
448
|
+
NAV_009 = "NAV-009",// Nav nested list
|
|
449
|
+
NCX_001 = "NCX-001",// NCX parse error
|
|
450
|
+
NCX_002 = "NCX-002",// NCX reference invalid
|
|
451
|
+
NCX_003 = "NCX-003",// NCX navPoint missing text
|
|
452
|
+
NCX_004 = "NCX-004",// NCX reference broken
|
|
453
|
+
NCX_005 = "NCX-005",// NCX required for EPUB 2
|
|
454
|
+
ACC_001 = "ACC-001",// Missing alt text
|
|
455
|
+
ACC_002 = "ACC-002",// Missing accessibilityFeature
|
|
456
|
+
ACC_003 = "ACC-003",// Accessibility metadata
|
|
457
|
+
ACC_004 = "ACC-004",// Page list recommended
|
|
458
|
+
ACC_005 = "ACC-005",// Missing epub:type
|
|
459
|
+
ACC_006 = "ACC-006",// Invalid ARIA
|
|
460
|
+
ACC_007 = "ACC-007",// Page list source
|
|
461
|
+
ACC_008 = "ACC-008",// Page numbering gaps
|
|
462
|
+
ACC_009 = "ACC-009",// DC source recommended
|
|
463
|
+
ACC_010 = "ACC-010",// accessMode recommended
|
|
464
|
+
ACC_011 = "ACC-011",// accessibilityHazard
|
|
465
|
+
ACC_012 = "ACC-012",// accessibilitySummary
|
|
466
|
+
ACC_013 = "ACC-013",// aria-describedby
|
|
467
|
+
ACC_014 = "ACC-014",// Empty table header
|
|
468
|
+
ACC_015 = "ACC-015",// Missing table summary
|
|
469
|
+
ACC_016 = "ACC-016",// Visual adjustments
|
|
470
|
+
ACC_017 = "ACC-017",// schema.org accessMode
|
|
471
|
+
MED_001 = "MED-001",// Invalid media type
|
|
472
|
+
MED_002 = "MED-002",// Media overlay error
|
|
473
|
+
MED_003 = "MED-003",// Unsupported audio codec
|
|
474
|
+
MED_004 = "MED-004",// Unsupported video codec
|
|
475
|
+
MED_005 = "MED-005",// Core media type required
|
|
476
|
+
MED_006 = "MED-006",// Media fallback chain
|
|
477
|
+
MED_007 = "MED-007",// Foreign resource no fallback
|
|
478
|
+
MED_008 = "MED-008",// Invalid image format
|
|
479
|
+
MED_009 = "MED-009",// Poster image required
|
|
480
|
+
MED_010 = "MED-010",// Audio source missing
|
|
481
|
+
MED_011 = "MED-011",// Video dimensions
|
|
482
|
+
MED_012 = "MED-012",// Media duration
|
|
483
|
+
MED_013 = "MED-013",// Invalid cover image
|
|
484
|
+
MED_014 = "MED-014",// Cover image dimensions
|
|
485
|
+
MED_015 = "MED-015",// SMIL file not found
|
|
486
|
+
SCP_001 = "SCP-001",// Scripting not allowed
|
|
487
|
+
SCP_002 = "SCP-002",// Script in spine item
|
|
488
|
+
SCP_003 = "SCP-003",// Inline script
|
|
489
|
+
SCP_004 = "SCP-004",// Event handler attribute
|
|
490
|
+
SCP_005 = "SCP-005",// Script not declared
|
|
491
|
+
SCP_006 = "SCP-006",// JavaScript URL
|
|
492
|
+
SCP_007 = "SCP-007",// Container-constrained script
|
|
493
|
+
SCP_008 = "SCP-008",// Scripted content missing type
|
|
494
|
+
SCP_009 = "SCP-009",// Script execution error
|
|
495
|
+
SCP_010 = "SCP-010",// Epubcfi URL
|
|
496
|
+
CHK_001 = "CHK-001",// Internal error
|
|
497
|
+
CHK_002 = "CHK-002",// Parser error
|
|
498
|
+
CHK_003 = "CHK-003",// Schema error
|
|
499
|
+
CHK_004 = "CHK-004",// Resource error
|
|
500
|
+
CHK_005 = "CHK-005",// Timeout error
|
|
501
|
+
CHK_006 = "CHK-006",// Memory error
|
|
502
|
+
CHK_007 = "CHK-007"
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Interface for schema validators
|
|
507
|
+
*/
|
|
508
|
+
interface SchemaValidator {
|
|
509
|
+
/**
|
|
510
|
+
* Validate XML content against a schema
|
|
511
|
+
*
|
|
512
|
+
* @param xml - The XML content to validate
|
|
513
|
+
* @param schemaPath - Path to the schema file
|
|
514
|
+
* @returns Array of validation messages
|
|
515
|
+
*/
|
|
516
|
+
validate(xml: string, schemaPath: string): Promise<ValidationMessage[]>;
|
|
517
|
+
/**
|
|
518
|
+
* Dispose of any resources held by the validator
|
|
519
|
+
*/
|
|
520
|
+
dispose(): void;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export { type EPUBProfile, type EPUBVersion, EpubCheck, type EpubCheckOptions, type EpubCheckResult, MessageId, type SchemaValidator, type Severity, type ValidationContext, type ValidationMessage, buildReport, countBySeverity, filterByPath, filterBySeverity, formatMessages, toJSONReport };
|