@storyteller-platform/epub 0.7.1 → 0.8.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/README.md +1363 -775
- package/dist/adapters/interface.d.ts +6 -8
- package/dist/adapters/interface.js +1 -0
- package/dist/adapters/memory.d.ts +3 -6
- package/dist/adapters/memory.js +69 -64
- package/dist/adapters/tmpfs.d.ts +2 -5
- package/dist/adapters/tmpfs.js +230 -161
- package/dist/epubcheck.d.ts +4 -6
- package/dist/epubcheck.js +24 -26
- package/dist/index.d.ts +1161 -5
- package/dist/index.js +2581 -2739
- package/dist/upgrade.d.ts +23 -1183
- package/dist/upgrade.js +412 -432
- package/dist/zip.d.ts +2 -5
- package/dist/zip.js +113 -100
- package/package.json +18 -31
- package/dist/adapters/interface.cjs +0 -16
- package/dist/adapters/interface.d.cts +0 -75
- package/dist/adapters/memory.cjs +0 -93
- package/dist/adapters/memory.d.cts +0 -36
- package/dist/adapters/tmpfs.cjs +0 -240
- package/dist/adapters/tmpfs.d.cts +0 -31
- package/dist/chunk-BIEQXUOY.js +0 -50
- package/dist/epubcheck.cjs +0 -60
- package/dist/epubcheck.d.cts +0 -23
- package/dist/index.cjs +0 -2846
- package/dist/index.d.cts +0 -5
- package/dist/upgrade.cjs +0 -523
- package/dist/upgrade.d.cts +0 -1196
- package/dist/zip.cjs +0 -142
- package/dist/zip.d.cts +0 -5
package/README.md
CHANGED
|
@@ -219,8 +219,7 @@ To get started with developing in the Storyteller monorepo, check out the
|
|
|
219
219
|
|
|
220
220
|
## Epub
|
|
221
221
|
|
|
222
|
-
Defined in:
|
|
223
|
-
[libraries/epub/index.ts:346](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L346)
|
|
222
|
+
Defined in: [libraries/epub/index.ts:347](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L347)
|
|
224
223
|
|
|
225
224
|
A single EPUB instance.
|
|
226
225
|
|
|
@@ -234,21 +233,21 @@ import {
|
|
|
234
233
|
getBody,
|
|
235
234
|
findByName,
|
|
236
235
|
textContent,
|
|
237
|
-
} from "@storyteller-platform/epub"
|
|
236
|
+
} from "@storyteller-platform/epub";
|
|
238
237
|
|
|
239
|
-
const epub = await Epub.from("./path/to/book.epub")
|
|
240
|
-
const title = await epub.getTitle()
|
|
241
|
-
const spineItems = await epub.getSpineItems()
|
|
242
|
-
const chptOne = spineItems[0]
|
|
243
|
-
const chptOneXml = await epub.readXhtmlItemContents(chptOne.id)
|
|
238
|
+
const epub = await Epub.from("./path/to/book.epub");
|
|
239
|
+
const title = await epub.getTitle();
|
|
240
|
+
const spineItems = await epub.getSpineItems();
|
|
241
|
+
const chptOne = spineItems[0];
|
|
242
|
+
const chptOneXml = await epub.readXhtmlItemContents(chptOne.id);
|
|
244
243
|
|
|
245
|
-
const body = getBody(chptOneXml)
|
|
246
|
-
const h1 = Epub.findXmlChildByName("h1", body)
|
|
247
|
-
const headingText = textContent(h1)
|
|
244
|
+
const body = getBody(chptOneXml);
|
|
245
|
+
const h1 = Epub.findXmlChildByName("h1", body);
|
|
246
|
+
const headingText = textContent(h1);
|
|
248
247
|
|
|
249
|
-
await epub.setTitle(headingText)
|
|
250
|
-
await epub.writeToFile("./path/to/updated.epub")
|
|
251
|
-
await epub.close()
|
|
248
|
+
await epub.setTitle(headingText);
|
|
249
|
+
await epub.writeToFile("./path/to/updated.epub");
|
|
250
|
+
await epub.close();
|
|
252
251
|
```
|
|
253
252
|
|
|
254
253
|
### Link
|
|
@@ -259,16 +258,14 @@ https://www.w3.org/TR/epub-33/
|
|
|
259
258
|
|
|
260
259
|
#### Constructor
|
|
261
260
|
|
|
262
|
-
> **new Epub**(`adapterClass`, `adapter`, `inputPath`, `readonlyOverride`):
|
|
263
|
-
> [`Epub`](#epub)
|
|
261
|
+
> **new Epub**(`adapterClass`, `adapter`, `inputPath`, `readonlyOverride`): [`Epub`](#epub)
|
|
264
262
|
|
|
265
|
-
Defined in:
|
|
266
|
-
[libraries/epub/index.ts:612](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L612)
|
|
263
|
+
Defined in: [libraries/epub/index.ts:622](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L622)
|
|
267
264
|
|
|
268
265
|
Prefer the static factories ([Epub.using](#using), [Epub.from](#from),
|
|
269
266
|
[Epub.create](#create), [Epub.upgrade](#upgrade)) over calling this constructor
|
|
270
|
-
directly. It's public so [EpubFactory](#epubfactory) can construct instances;
|
|
271
|
-
|
|
267
|
+
directly. It's public so [EpubFactory](#epubfactory) can construct instances; nothing
|
|
268
|
+
else should need to.
|
|
272
269
|
|
|
273
270
|
##### Parameters
|
|
274
271
|
|
|
@@ -276,7 +273,7 @@ nothing else should need to.
|
|
|
276
273
|
| ------------------ | ----------------------------------------------------- | ------------- |
|
|
277
274
|
| `adapterClass` | [`EpubStorageAdapterClass`](#epubstorageadapterclass) | `undefined` |
|
|
278
275
|
| `adapter` | [`EpubStorageAdapter`](#epubstorageadapter) | `undefined` |
|
|
279
|
-
| `inputPath` | `
|
|
276
|
+
| `inputPath` | `string` \| `undefined` | `undefined` |
|
|
280
277
|
| `readonlyOverride` | `boolean` | `false` |
|
|
281
278
|
|
|
282
279
|
##### Returns
|
|
@@ -289,71 +286,61 @@ nothing else should need to.
|
|
|
289
286
|
|
|
290
287
|
> `protected` **adapter**: [`EpubStorageAdapter`](#epubstorageadapter)
|
|
291
288
|
|
|
292
|
-
Defined in:
|
|
293
|
-
[libraries/epub/index.ts:614](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L614)
|
|
289
|
+
Defined in: [libraries/epub/index.ts:624](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L624)
|
|
294
290
|
|
|
295
291
|
#### adapterClass
|
|
296
292
|
|
|
297
|
-
> `protected` **adapterClass**:
|
|
298
|
-
> [`EpubStorageAdapterClass`](#epubstorageadapterclass)
|
|
293
|
+
> `protected` **adapterClass**: [`EpubStorageAdapterClass`](#epubstorageadapterclass)
|
|
299
294
|
|
|
300
|
-
Defined in:
|
|
301
|
-
[libraries/epub/index.ts:613](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L613)
|
|
295
|
+
Defined in: [libraries/epub/index.ts:623](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L623)
|
|
302
296
|
|
|
303
297
|
#### inputPath
|
|
304
298
|
|
|
305
|
-
> `protected` **inputPath**: `
|
|
299
|
+
> `protected` **inputPath**: `string` \| `undefined`
|
|
306
300
|
|
|
307
|
-
Defined in:
|
|
308
|
-
[libraries/epub/index.ts:615](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L615)
|
|
301
|
+
Defined in: [libraries/epub/index.ts:625](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L625)
|
|
309
302
|
|
|
310
303
|
#### readonlyOverride
|
|
311
304
|
|
|
312
305
|
> `protected` **readonlyOverride**: `boolean` = `false`
|
|
313
306
|
|
|
314
|
-
Defined in:
|
|
315
|
-
[libraries/epub/index.ts:616](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L616)
|
|
307
|
+
Defined in: [libraries/epub/index.ts:626](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L626)
|
|
316
308
|
|
|
317
309
|
#### storage
|
|
318
310
|
|
|
319
311
|
> `readonly` **storage**: [`EpubStorageKind`](#epubstoragekind)
|
|
320
312
|
|
|
321
|
-
Defined in:
|
|
322
|
-
[libraries/epub/index.ts:604](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L604)
|
|
313
|
+
Defined in: [libraries/epub/index.ts:614](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L614)
|
|
323
314
|
|
|
324
315
|
Storage backend kind in use for this instance
|
|
325
316
|
|
|
326
|
-
Public so callers can declare type-level requirements via
|
|
327
|
-
|
|
328
|
-
|
|
317
|
+
Public so callers can declare type-level requirements via [InMemoryEpubReader](#inmemoryepubreader)
|
|
318
|
+
Orthogonal to the read-only / writable axis (controlled by `readonlyOverride`
|
|
319
|
+
and the adapter's capability bag)
|
|
329
320
|
|
|
330
321
|
#### xhtmlBuilder
|
|
331
322
|
|
|
332
323
|
> `static` **xhtmlBuilder**: `XMLBuilder`
|
|
333
324
|
|
|
334
|
-
Defined in:
|
|
335
|
-
[libraries/epub/index.ts:394](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L394)
|
|
325
|
+
Defined in: [libraries/epub/index.ts:403](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L403)
|
|
336
326
|
|
|
337
327
|
#### xhtmlParser
|
|
338
328
|
|
|
339
329
|
> `static` **xhtmlParser**: `XMLParser`
|
|
340
330
|
|
|
341
|
-
Defined in:
|
|
342
|
-
[libraries/epub/index.ts:354](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L354)
|
|
331
|
+
Defined in: [libraries/epub/index.ts:355](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L355)
|
|
343
332
|
|
|
344
333
|
#### xmlBuilder
|
|
345
334
|
|
|
346
335
|
> `static` **xmlBuilder**: `XMLBuilder`
|
|
347
336
|
|
|
348
|
-
Defined in:
|
|
349
|
-
[libraries/epub/index.ts:387](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L387)
|
|
337
|
+
Defined in: [libraries/epub/index.ts:396](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L396)
|
|
350
338
|
|
|
351
339
|
#### xmlParser
|
|
352
340
|
|
|
353
341
|
> `static` **xmlParser**: `XMLParser`
|
|
354
342
|
|
|
355
|
-
Defined in:
|
|
356
|
-
[libraries/epub/index.ts:347](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L347)
|
|
343
|
+
Defined in: [libraries/epub/index.ts:348](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L348)
|
|
357
344
|
|
|
358
345
|
### Methods
|
|
359
346
|
|
|
@@ -361,8 +348,7 @@ Defined in:
|
|
|
361
348
|
|
|
362
349
|
> **\[dispose\]**(): `void`
|
|
363
350
|
|
|
364
|
-
Defined in:
|
|
365
|
-
[libraries/epub/index.ts:3577](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3577)
|
|
351
|
+
Defined in: [libraries/epub/index.ts:3583](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3583)
|
|
366
352
|
|
|
367
353
|
##### Returns
|
|
368
354
|
|
|
@@ -372,13 +358,13 @@ Defined in:
|
|
|
372
358
|
|
|
373
359
|
> **addCollection**(`collection`, `index?`): `Promise`\<`void`\>
|
|
374
360
|
|
|
375
|
-
Defined in:
|
|
376
|
-
[libraries/epub/index.ts:2223](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2223)
|
|
361
|
+
Defined in: [libraries/epub/index.ts:2233](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2233)
|
|
377
362
|
|
|
378
363
|
Add a collection to the EPUB metadata.
|
|
379
364
|
|
|
380
|
-
If index is provided, the collection will be placed at
|
|
381
|
-
|
|
365
|
+
If index is provided, the collection will be placed at
|
|
366
|
+
that index in the list of collections. Otherwise, it
|
|
367
|
+
will be added to the end of the list.
|
|
382
368
|
|
|
383
369
|
##### Parameters
|
|
384
370
|
|
|
@@ -395,13 +381,13 @@ collections. Otherwise, it will be added to the end of the list.
|
|
|
395
381
|
|
|
396
382
|
> **addContributor**(`contributor`, `index?`): `Promise`\<`void`\>
|
|
397
383
|
|
|
398
|
-
Defined in:
|
|
399
|
-
[libraries/epub/index.ts:2568](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2568)
|
|
384
|
+
Defined in: [libraries/epub/index.ts:2578](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2578)
|
|
400
385
|
|
|
401
386
|
Add a contributor to the EPUB metadata.
|
|
402
387
|
|
|
403
|
-
If index is provided, the creator will be placed at
|
|
404
|
-
|
|
388
|
+
If index is provided, the creator will be placed at
|
|
389
|
+
that index in the list of creators. Otherwise, it
|
|
390
|
+
will be added to the end of the list.
|
|
405
391
|
|
|
406
392
|
This is a convenience method for
|
|
407
393
|
`epub.addCreator(contributor, index, 'contributor')`.
|
|
@@ -425,13 +411,13 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
425
411
|
|
|
426
412
|
> **addCreator**(`creator`, `index?`, `type?`): `Promise`\<`void`\>
|
|
427
413
|
|
|
428
|
-
Defined in:
|
|
429
|
-
[libraries/epub/index.ts:2413](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2413)
|
|
414
|
+
Defined in: [libraries/epub/index.ts:2423](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2423)
|
|
430
415
|
|
|
431
416
|
Add a creator to the EPUB metadata.
|
|
432
417
|
|
|
433
|
-
If index is provided, the creator will be placed at
|
|
434
|
-
|
|
418
|
+
If index is provided, the creator will be placed at
|
|
419
|
+
that index in the list of creators. Otherwise, it
|
|
420
|
+
will be added to the end of the list.
|
|
435
421
|
|
|
436
422
|
##### Parameters
|
|
437
423
|
|
|
@@ -455,10 +441,10 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
455
441
|
|
|
456
442
|
> **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
457
443
|
|
|
458
|
-
Defined in:
|
|
459
|
-
[libraries/epub/index.ts:3164](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3164)
|
|
444
|
+
Defined in: [libraries/epub/index.ts:3170](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3170)
|
|
460
445
|
|
|
461
|
-
Create a new manifest item and write its contents to a
|
|
446
|
+
Create a new manifest item and write its contents to a
|
|
447
|
+
new entry.
|
|
462
448
|
|
|
463
449
|
###### Parameters
|
|
464
450
|
|
|
@@ -484,10 +470,10 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
484
470
|
|
|
485
471
|
> **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
486
472
|
|
|
487
|
-
Defined in:
|
|
488
|
-
[libraries/epub/index.ts:3169](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3169)
|
|
473
|
+
Defined in: [libraries/epub/index.ts:3175](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3175)
|
|
489
474
|
|
|
490
|
-
Create a new manifest item and write its contents to a
|
|
475
|
+
Create a new manifest item and write its contents to a
|
|
476
|
+
new entry.
|
|
491
477
|
|
|
492
478
|
###### Parameters
|
|
493
479
|
|
|
@@ -513,10 +499,10 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
513
499
|
|
|
514
500
|
> **addManifestItem**(`item`, `contents`): `Promise`\<`void`\>
|
|
515
501
|
|
|
516
|
-
Defined in:
|
|
517
|
-
[libraries/epub/index.ts:3174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3174)
|
|
502
|
+
Defined in: [libraries/epub/index.ts:3180](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3180)
|
|
518
503
|
|
|
519
|
-
Create a new manifest item and write its contents to a
|
|
504
|
+
Create a new manifest item and write its contents to a
|
|
505
|
+
new entry.
|
|
520
506
|
|
|
521
507
|
###### Parameters
|
|
522
508
|
|
|
@@ -541,14 +527,14 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
541
527
|
|
|
542
528
|
> **addMetadata**(`entry`): `Promise`\<`void`\>
|
|
543
529
|
|
|
544
|
-
Defined in:
|
|
545
|
-
[libraries/epub/index.ts:3285](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3285)
|
|
530
|
+
Defined in: [libraries/epub/index.ts:3291](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3291)
|
|
546
531
|
|
|
547
532
|
Add a new metadata entry to the Epub.
|
|
548
533
|
|
|
549
|
-
This method, like `epub.getMetadata()`, operates on
|
|
550
|
-
|
|
551
|
-
`setTitle()` and
|
|
534
|
+
This method, like `epub.getMetadata()`, operates on
|
|
535
|
+
metadata entries. For more useful semantic representations
|
|
536
|
+
of metadata, use specific methods such as `setTitle()` and
|
|
537
|
+
`setLanguage()`.
|
|
552
538
|
|
|
553
539
|
##### Parameters
|
|
554
540
|
|
|
@@ -568,16 +554,16 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
568
554
|
|
|
569
555
|
> **addSpineItem**(`manifestId`, `index?`): `Promise`\<`void`\>
|
|
570
556
|
|
|
571
|
-
Defined in:
|
|
572
|
-
[libraries/epub/index.ts:2622](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2622)
|
|
557
|
+
Defined in: [libraries/epub/index.ts:2632](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2632)
|
|
573
558
|
|
|
574
559
|
Add an item to the spine of the EPUB.
|
|
575
560
|
|
|
576
|
-
If `index` is undefined, the item will be added
|
|
577
|
-
|
|
561
|
+
If `index` is undefined, the item will be added
|
|
562
|
+
to the end of the spine. Otherwise it will be
|
|
563
|
+
inserted at the specified index.
|
|
578
564
|
|
|
579
|
-
If the manifestId does not correspond to an item
|
|
580
|
-
throw an error.
|
|
565
|
+
If the manifestId does not correspond to an item
|
|
566
|
+
in the manifest, this will throw an error.
|
|
581
567
|
|
|
582
568
|
##### Parameters
|
|
583
569
|
|
|
@@ -598,8 +584,7 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
|
598
584
|
|
|
599
585
|
> **addSubject**(`subject`): `Promise`\<`void`\>
|
|
600
586
|
|
|
601
|
-
Defined in:
|
|
602
|
-
[libraries/epub/index.ts:1752](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1752)
|
|
587
|
+
Defined in: [libraries/epub/index.ts:1762](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1762)
|
|
603
588
|
|
|
604
589
|
Add a subject to the EPUB metadata.
|
|
605
590
|
|
|
@@ -621,8 +606,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
|
|
|
621
606
|
|
|
622
607
|
> **copy**(`path?`): `Promise`\<[`Epub`](#epub)\>
|
|
623
608
|
|
|
624
|
-
Defined in:
|
|
625
|
-
[libraries/epub/index.ts:709](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L709)
|
|
609
|
+
Defined in: [libraries/epub/index.ts:719](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L719)
|
|
626
610
|
|
|
627
611
|
##### Parameters
|
|
628
612
|
|
|
@@ -636,14 +620,12 @@ Defined in:
|
|
|
636
620
|
|
|
637
621
|
#### createXhtmlDocument()
|
|
638
622
|
|
|
639
|
-
> **createXhtmlDocument**(`body`, `head?`, `language?`):
|
|
640
|
-
> `Promise`\<([`XmlElement`](#xmlelement)\<`"?xml"`\> \|
|
|
641
|
-
> [`XmlElement`](#xmlelement)\<`"html"`\>)[]\>
|
|
623
|
+
> **createXhtmlDocument**(`body`, `head?`, `language?`): `Promise`\<([`XmlElement`](#xmlelement)\<`"?xml"`\> \| [`XmlElement`](#xmlelement)\<`"html"`\>)[]\>
|
|
642
624
|
|
|
643
|
-
Defined in:
|
|
644
|
-
[libraries/epub/index.ts:2981](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2981)
|
|
625
|
+
Defined in: [libraries/epub/index.ts:2991](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2991)
|
|
645
626
|
|
|
646
|
-
Create a new XHTML document with the given body
|
|
627
|
+
Create a new XHTML document with the given body
|
|
628
|
+
and head.
|
|
647
629
|
|
|
648
630
|
##### Parameters
|
|
649
631
|
|
|
@@ -655,15 +637,13 @@ Create a new XHTML document with the given body and head.
|
|
|
655
637
|
|
|
656
638
|
##### Returns
|
|
657
639
|
|
|
658
|
-
`Promise`\<([`XmlElement`](#xmlelement)\<`"?xml"`\> \|
|
|
659
|
-
[`XmlElement`](#xmlelement)\<`"html"`\>)[]\>
|
|
640
|
+
`Promise`\<([`XmlElement`](#xmlelement)\<`"?xml"`\> \| [`XmlElement`](#xmlelement)\<`"html"`\>)[]\>
|
|
660
641
|
|
|
661
642
|
#### discardAndClose()
|
|
662
643
|
|
|
663
644
|
> **discardAndClose**(): `void`
|
|
664
645
|
|
|
665
|
-
Defined in:
|
|
666
|
-
[libraries/epub/index.ts:3527](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3527)
|
|
646
|
+
Defined in: [libraries/epub/index.ts:3533](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3533)
|
|
667
647
|
|
|
668
648
|
##### Returns
|
|
669
649
|
|
|
@@ -673,11 +653,10 @@ Defined in:
|
|
|
673
653
|
|
|
674
654
|
> **findAllMetadataItems**(`predicate`): `Promise`\<`object`[]\>
|
|
675
655
|
|
|
676
|
-
Defined in:
|
|
677
|
-
[libraries/epub/index.ts:959](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L959)
|
|
656
|
+
Defined in: [libraries/epub/index.ts:969](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L969)
|
|
678
657
|
|
|
679
|
-
Returns the item in the metadata element's children array
|
|
680
|
-
provided predicate.
|
|
658
|
+
Returns the item in the metadata element's children array
|
|
659
|
+
that matches the provided predicate.
|
|
681
660
|
|
|
682
661
|
##### Parameters
|
|
683
662
|
|
|
@@ -691,33 +670,12 @@ provided predicate.
|
|
|
691
670
|
|
|
692
671
|
#### findMetadataItem()
|
|
693
672
|
|
|
694
|
-
> **findMetadataItem**(`predicate`): `Promise
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
> `` `l${string}` `` \| `` `m${string}` `` \| `` `n${string}` `` \|
|
|
701
|
-
> `` `o${string}` `` \| `` `p${string}` `` \| `` `q${string}` `` \|
|
|
702
|
-
> `` `s${string}` `` \| `` `t${string}` `` \| `` `u${string}` `` \|
|
|
703
|
-
> `` `v${string}` `` \| `` `w${string}` `` \| `` `x${string}` `` \|
|
|
704
|
-
> `` `y${string}` `` \| `` `z${string}` `` \| `` `R${string}` `` \|
|
|
705
|
-
> `` `A${string}` `` \| `` `B${string}` `` \| `` `C${string}` `` \|
|
|
706
|
-
> `` `D${string}` `` \| `` `E${string}` `` \| `` `F${string}` `` \|
|
|
707
|
-
> `` `G${string}` `` \| `` `H${string}` `` \| `` `I${string}` `` \|
|
|
708
|
-
> `` `J${string}` `` \| `` `K${string}` `` \| `` `L${string}` `` \|
|
|
709
|
-
> `` `M${string}` `` \| `` `N${string}` `` \| `` `O${string}` `` \|
|
|
710
|
-
> `` `P${string}` `` \| `` `Q${string}` `` \| `` `S${string}` `` \|
|
|
711
|
-
> `` `T${string}` `` \| `` `U${string}` `` \| `` `V${string}` `` \|
|
|
712
|
-
> `` `W${string}` `` \| `` `X${string}` `` \| `` `Y${string}` `` \|
|
|
713
|
-
> `` `Z${string}` `` \| `` `?${string}` ``; `value`: `undefined` \| `string`;
|
|
714
|
-
> \}\>
|
|
715
|
-
|
|
716
|
-
Defined in:
|
|
717
|
-
[libraries/epub/index.ts:950](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L950)
|
|
718
|
-
|
|
719
|
-
Returns the item in the metadata element's children array that matches the
|
|
720
|
-
provided predicate.
|
|
673
|
+
> **findMetadataItem**(`predicate`): `Promise`\<\{ `id`: `string` \| `undefined`; `properties`: \{[`k`: `string`]: `string`; \}; `type`: `` `r${string}` `` \| `` `a${string}` `` \| `` `b${string}` `` \| `` `c${string}` `` \| `` `d${string}` `` \| `` `e${string}` `` \| `` `f${string}` `` \| `` `g${string}` `` \| `` `h${string}` `` \| `` `i${string}` `` \| `` `j${string}` `` \| `` `k${string}` `` \| `` `l${string}` `` \| `` `m${string}` `` \| `` `n${string}` `` \| `` `o${string}` `` \| `` `p${string}` `` \| `` `q${string}` `` \| `` `s${string}` `` \| `` `t${string}` `` \| `` `u${string}` `` \| `` `v${string}` `` \| `` `w${string}` `` \| `` `x${string}` `` \| `` `y${string}` `` \| `` `z${string}` `` \| `` `R${string}` `` \| `` `A${string}` `` \| `` `B${string}` `` \| `` `C${string}` `` \| `` `D${string}` `` \| `` `E${string}` `` \| `` `F${string}` `` \| `` `G${string}` `` \| `` `H${string}` `` \| `` `I${string}` `` \| `` `J${string}` `` \| `` `K${string}` `` \| `` `L${string}` `` \| `` `M${string}` `` \| `` `N${string}` `` \| `` `O${string}` `` \| `` `P${string}` `` \| `` `Q${string}` `` \| `` `S${string}` `` \| `` `T${string}` `` \| `` `U${string}` `` \| `` `V${string}` `` \| `` `W${string}` `` \| `` `X${string}` `` \| `` `Y${string}` `` \| `` `Z${string}` `` \| `` `?${string}` ``; `value`: `string` \| `undefined`; \} \| `null`\>
|
|
674
|
+
|
|
675
|
+
Defined in: [libraries/epub/index.ts:960](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L960)
|
|
676
|
+
|
|
677
|
+
Returns the item in the metadata element's children array
|
|
678
|
+
that matches the provided predicate.
|
|
721
679
|
|
|
722
680
|
##### Parameters
|
|
723
681
|
|
|
@@ -727,37 +685,18 @@ provided predicate.
|
|
|
727
685
|
|
|
728
686
|
##### Returns
|
|
729
687
|
|
|
730
|
-
`Promise
|
|
731
|
-
`string`]: `string`; \}; `type`: `` `r${string}` `` \| `` `a${string}` `` \|
|
|
732
|
-
`` `b${string}` `` \| `` `c${string}` `` \| `` `d${string}` `` \|
|
|
733
|
-
`` `e${string}` `` \| `` `f${string}` `` \| `` `g${string}` `` \|
|
|
734
|
-
`` `h${string}` `` \| `` `i${string}` `` \| `` `j${string}` `` \|
|
|
735
|
-
`` `k${string}` `` \| `` `l${string}` `` \| `` `m${string}` `` \|
|
|
736
|
-
`` `n${string}` `` \| `` `o${string}` `` \| `` `p${string}` `` \|
|
|
737
|
-
`` `q${string}` `` \| `` `s${string}` `` \| `` `t${string}` `` \|
|
|
738
|
-
`` `u${string}` `` \| `` `v${string}` `` \| `` `w${string}` `` \|
|
|
739
|
-
`` `x${string}` `` \| `` `y${string}` `` \| `` `z${string}` `` \|
|
|
740
|
-
`` `R${string}` `` \| `` `A${string}` `` \| `` `B${string}` `` \|
|
|
741
|
-
`` `C${string}` `` \| `` `D${string}` `` \| `` `E${string}` `` \|
|
|
742
|
-
`` `F${string}` `` \| `` `G${string}` `` \| `` `H${string}` `` \|
|
|
743
|
-
`` `I${string}` `` \| `` `J${string}` `` \| `` `K${string}` `` \|
|
|
744
|
-
`` `L${string}` `` \| `` `M${string}` `` \| `` `N${string}` `` \|
|
|
745
|
-
`` `O${string}` `` \| `` `P${string}` `` \| `` `Q${string}` `` \|
|
|
746
|
-
`` `S${string}` `` \| `` `T${string}` `` \| `` `U${string}` `` \|
|
|
747
|
-
`` `V${string}` `` \| `` `W${string}` `` \| `` `X${string}` `` \|
|
|
748
|
-
`` `Y${string}` `` \| `` `Z${string}` `` \| `` `?${string}` ``; `value`:
|
|
749
|
-
`undefined` \| `string`; \}\>
|
|
688
|
+
`Promise`\<\{ `id`: `string` \| `undefined`; `properties`: \{[`k`: `string`]: `string`; \}; `type`: `` `r${string}` `` \| `` `a${string}` `` \| `` `b${string}` `` \| `` `c${string}` `` \| `` `d${string}` `` \| `` `e${string}` `` \| `` `f${string}` `` \| `` `g${string}` `` \| `` `h${string}` `` \| `` `i${string}` `` \| `` `j${string}` `` \| `` `k${string}` `` \| `` `l${string}` `` \| `` `m${string}` `` \| `` `n${string}` `` \| `` `o${string}` `` \| `` `p${string}` `` \| `` `q${string}` `` \| `` `s${string}` `` \| `` `t${string}` `` \| `` `u${string}` `` \| `` `v${string}` `` \| `` `w${string}` `` \| `` `x${string}` `` \| `` `y${string}` `` \| `` `z${string}` `` \| `` `R${string}` `` \| `` `A${string}` `` \| `` `B${string}` `` \| `` `C${string}` `` \| `` `D${string}` `` \| `` `E${string}` `` \| `` `F${string}` `` \| `` `G${string}` `` \| `` `H${string}` `` \| `` `I${string}` `` \| `` `J${string}` `` \| `` `K${string}` `` \| `` `L${string}` `` \| `` `M${string}` `` \| `` `N${string}` `` \| `` `O${string}` `` \| `` `P${string}` `` \| `` `Q${string}` `` \| `` `S${string}` `` \| `` `T${string}` `` \| `` `U${string}` `` \| `` `V${string}` `` \| `` `W${string}` `` \| `` `X${string}` `` \| `` `Y${string}` `` \| `` `Z${string}` `` \| `` `?${string}` ``; `value`: `string` \| `undefined`; \} \| `null`\>
|
|
750
689
|
|
|
751
690
|
#### getBaseDirection()
|
|
752
691
|
|
|
753
692
|
> **getBaseDirection**(): `Promise`\<`"auto"` \| `"rtl"` \| `"ltr"`\>
|
|
754
693
|
|
|
755
|
-
Defined in:
|
|
756
|
-
[libraries/epub/index.ts:1706](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1706)
|
|
694
|
+
Defined in: [libraries/epub/index.ts:1716](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1716)
|
|
757
695
|
|
|
758
696
|
Retrieve the base direction from the package element.
|
|
759
697
|
|
|
760
|
-
If there is no `dir` attribute on the package element,
|
|
698
|
+
If there is no `dir` attribute on the package element,
|
|
699
|
+
returns 'auto'.
|
|
761
700
|
|
|
762
701
|
##### Returns
|
|
763
702
|
|
|
@@ -771,8 +710,7 @@ https://www.w3.org/TR/epub-33/#attrdef-dir
|
|
|
771
710
|
|
|
772
711
|
> **getCollections**(): `Promise`\<[`Collection`](#collection)[]\>
|
|
773
712
|
|
|
774
|
-
Defined in:
|
|
775
|
-
[libraries/epub/index.ts:2183](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2183)
|
|
713
|
+
Defined in: [libraries/epub/index.ts:2193](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2193)
|
|
776
714
|
|
|
777
715
|
Retrieve the list of collections.
|
|
778
716
|
|
|
@@ -784,12 +722,12 @@ Retrieve the list of collections.
|
|
|
784
722
|
|
|
785
723
|
> **getContributors**(): `Promise`\<[`DcCreator`](#dccreator)[]\>
|
|
786
724
|
|
|
787
|
-
Defined in:
|
|
788
|
-
[libraries/epub/index.ts:2400](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2400)
|
|
725
|
+
Defined in: [libraries/epub/index.ts:2410](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2410)
|
|
789
726
|
|
|
790
727
|
Retrieve the list of contributors.
|
|
791
728
|
|
|
792
|
-
This is a convenience method for
|
|
729
|
+
This is a convenience method for
|
|
730
|
+
`epub.getCreators('contributor')`.
|
|
793
731
|
|
|
794
732
|
##### Returns
|
|
795
733
|
|
|
@@ -801,19 +739,19 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccontributor
|
|
|
801
739
|
|
|
802
740
|
#### getCoverImage()
|
|
803
741
|
|
|
804
|
-
> **getCoverImage**(): `Promise`\<`
|
|
742
|
+
> **getCoverImage**(): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\> \| `null`\>
|
|
805
743
|
|
|
806
|
-
Defined in:
|
|
807
|
-
[libraries/epub/index.ts:1602](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1602)
|
|
744
|
+
Defined in: [libraries/epub/index.ts:1612](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1612)
|
|
808
745
|
|
|
809
746
|
Retrieve the cover image data as a byte array.
|
|
810
747
|
|
|
811
|
-
This does not include, for example, the cover image's
|
|
812
|
-
retrieve the image manifest
|
|
748
|
+
This does not include, for example, the cover image's
|
|
749
|
+
filename or mime type. To retrieve the image manifest
|
|
750
|
+
item, use epub.getCoverImageItem().
|
|
813
751
|
|
|
814
752
|
##### Returns
|
|
815
753
|
|
|
816
|
-
`Promise`\<`
|
|
754
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\> \| `null`\>
|
|
817
755
|
|
|
818
756
|
##### Link
|
|
819
757
|
|
|
@@ -821,20 +759,20 @@ https://www.w3.org/TR/epub-33/#sec-cover-image
|
|
|
821
759
|
|
|
822
760
|
#### getCoverImageItem()
|
|
823
761
|
|
|
824
|
-
> **getCoverImageItem**(): `Promise
|
|
825
|
-
> [`ManifestItem`](#manifestitem)\>
|
|
762
|
+
> **getCoverImageItem**(): `Promise`\<[`ManifestItem`](#manifestitem) \| `null`\>
|
|
826
763
|
|
|
827
|
-
Defined in:
|
|
828
|
-
[libraries/epub/index.ts:1583](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1583)
|
|
764
|
+
Defined in: [libraries/epub/index.ts:1593](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1593)
|
|
829
765
|
|
|
830
766
|
Retrieve the cover image manifest item.
|
|
831
767
|
|
|
832
|
-
This does not return the actual image data. To
|
|
833
|
-
this item's id to
|
|
768
|
+
This does not return the actual image data. To
|
|
769
|
+
retrieve the image data, pass this item's id to
|
|
770
|
+
epub.readItemContents, or use epub.getCoverImage()
|
|
771
|
+
instead.
|
|
834
772
|
|
|
835
773
|
##### Returns
|
|
836
774
|
|
|
837
|
-
`Promise
|
|
775
|
+
`Promise`\<[`ManifestItem`](#manifestitem) \| `null`\>
|
|
838
776
|
|
|
839
777
|
##### Link
|
|
840
778
|
|
|
@@ -844,8 +782,7 @@ https://www.w3.org/TR/epub-33/#sec-cover-image
|
|
|
844
782
|
|
|
845
783
|
> **getCreators**(`type`): `Promise`\<[`DcCreator`](#dccreator)[]\>
|
|
846
784
|
|
|
847
|
-
Defined in:
|
|
848
|
-
[libraries/epub/index.ts:2336](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2336)
|
|
785
|
+
Defined in: [libraries/epub/index.ts:2346](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2346)
|
|
849
786
|
|
|
850
787
|
Retrieve the list of creators.
|
|
851
788
|
|
|
@@ -865,31 +802,31 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
865
802
|
|
|
866
803
|
#### getDescription()
|
|
867
804
|
|
|
868
|
-
> **getDescription**(): `Promise`\<`
|
|
805
|
+
> **getDescription**(): `Promise`\<`string` \| `null`\>
|
|
869
806
|
|
|
870
|
-
Defined in:
|
|
871
|
-
[libraries/epub/index.ts:2034](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2034)
|
|
807
|
+
Defined in: [libraries/epub/index.ts:2044](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2044)
|
|
872
808
|
|
|
873
|
-
Retrieve the Epub's description as specified in its
|
|
809
|
+
Retrieve the Epub's description as specified in its
|
|
810
|
+
package document metadata.
|
|
874
811
|
|
|
875
|
-
If no description metadata is specified, returns null.
|
|
876
|
-
as a string. Descriptions may
|
|
812
|
+
If no description metadata is specified, returns null.
|
|
813
|
+
Returns the description as a string. Descriptions may
|
|
814
|
+
include HTML markup.
|
|
877
815
|
|
|
878
816
|
##### Returns
|
|
879
817
|
|
|
880
|
-
`Promise`\<`
|
|
818
|
+
`Promise`\<`string` \| `null`\>
|
|
881
819
|
|
|
882
820
|
#### getGuideEntries()
|
|
883
821
|
|
|
884
822
|
> **getGuideEntries**(): `Promise`\<`GuideItem`[]\>
|
|
885
823
|
|
|
886
|
-
Defined in:
|
|
887
|
-
[libraries/epub/index.ts:3504](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3504)
|
|
824
|
+
Defined in: [libraries/epub/index.ts:3510](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3510)
|
|
888
825
|
|
|
889
826
|
Retrieve the guide entries from the package document.
|
|
890
827
|
|
|
891
|
-
The guide element is deprecated in EPUB 3 in favor of
|
|
892
|
-
many publications still include it.
|
|
828
|
+
The guide element is deprecated in EPUB 3 in favor of
|
|
829
|
+
the landmarks nav, but many publications still include it.
|
|
893
830
|
|
|
894
831
|
##### Returns
|
|
895
832
|
|
|
@@ -897,19 +834,18 @@ many publications still include it.
|
|
|
897
834
|
|
|
898
835
|
#### ~~getIdentifier()~~
|
|
899
836
|
|
|
900
|
-
> **getIdentifier**(): `Promise`\<`
|
|
837
|
+
> **getIdentifier**(): `Promise`\<`string` \| `null`\>
|
|
901
838
|
|
|
902
|
-
Defined in:
|
|
903
|
-
[libraries/epub/index.ts:1057](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1057)
|
|
839
|
+
Defined in: [libraries/epub/index.ts:1067](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1067)
|
|
904
840
|
|
|
905
|
-
Retrieve the first identifier from the dc:identifier element
|
|
906
|
-
metadata.
|
|
841
|
+
Retrieve the first identifier from the dc:identifier element
|
|
842
|
+
in the EPUB metadata.
|
|
907
843
|
|
|
908
844
|
If there is no dc:identifier element, returns null.
|
|
909
845
|
|
|
910
846
|
##### Returns
|
|
911
847
|
|
|
912
|
-
`Promise`\<`
|
|
848
|
+
`Promise`\<`string` \| `null`\>
|
|
913
849
|
|
|
914
850
|
##### Link
|
|
915
851
|
|
|
@@ -917,21 +853,20 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
|
917
853
|
|
|
918
854
|
##### Deprecated
|
|
919
855
|
|
|
920
|
-
Use [getUniqueIdentifier](#getuniqueidentifier) instead to get the unique
|
|
921
|
-
|
|
856
|
+
Use [getUniqueIdentifier](#getuniqueidentifier) instead to get the unique identifier,
|
|
857
|
+
or [getIdentifiers](#getidentifiers) to get all identifiers.
|
|
922
858
|
|
|
923
859
|
#### getIdentifiers()
|
|
924
860
|
|
|
925
861
|
> **getIdentifiers**(): `Promise`\<[`EpubIdentifier`](#epubidentifier)[]\>
|
|
926
862
|
|
|
927
|
-
Defined in:
|
|
928
|
-
[libraries/epub/index.ts:1232](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1232)
|
|
863
|
+
Defined in: [libraries/epub/index.ts:1242](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1242)
|
|
929
864
|
|
|
930
865
|
Retrieve every `dc:identifier` entry, returned as found.
|
|
931
866
|
|
|
932
|
-
Values are not interpreted. Any refining `identifier-type` meta (spec
|
|
933
|
-
legacy `opf:scheme` attribute is surfaced on the entry, but no
|
|
934
|
-
value itself is attempted. To read `dc:source` entries, use
|
|
867
|
+
Values are not interpreted. Any refining `identifier-type` meta (spec
|
|
868
|
+
D.3.8) or legacy `opf:scheme` attribute is surfaced on the entry, but no
|
|
869
|
+
parsing of the value itself is attempted. To read `dc:source` entries, use
|
|
935
870
|
[getSources](#getsources).
|
|
936
871
|
|
|
937
872
|
##### Returns
|
|
@@ -946,11 +881,10 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
|
946
881
|
|
|
947
882
|
> **getItemArchiveLength**(`id`): `Promise`\<`number`\>
|
|
948
883
|
|
|
949
|
-
Defined in:
|
|
950
|
-
[libraries/epub/index.ts:735](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L735)
|
|
884
|
+
Defined in: [libraries/epub/index.ts:745](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L745)
|
|
951
885
|
|
|
952
|
-
Length of the underlying archive entry for a manifest item, in bytes
|
|
953
|
-
to compute the readium page count which is for COMPRESSED content
|
|
886
|
+
Length of the underlying archive entry for a manifest item, in bytes
|
|
887
|
+
Necessary to compute the readium page count which is for COMPRESSED content
|
|
954
888
|
|
|
955
889
|
##### Parameters
|
|
956
890
|
|
|
@@ -968,13 +902,12 @@ to compute the readium page count which is for COMPRESSED content
|
|
|
968
902
|
|
|
969
903
|
#### getLandmarks()
|
|
970
904
|
|
|
971
|
-
> **getLandmarks**(`__namedParameters`): `Promise
|
|
972
|
-
> [`Navigation`](#navigation)\>
|
|
905
|
+
> **getLandmarks**(`__namedParameters`): `Promise`\<[`Navigation`](#navigation) \| `null`\>
|
|
973
906
|
|
|
974
|
-
Defined in:
|
|
975
|
-
[libraries/epub/index.ts:2801](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2801)
|
|
907
|
+
Defined in: [libraries/epub/index.ts:2811](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2811)
|
|
976
908
|
|
|
977
|
-
Returns the structured landmarks navigation document
|
|
909
|
+
Returns the structured landmarks navigation document
|
|
910
|
+
as a Navigation object
|
|
978
911
|
|
|
979
912
|
##### Parameters
|
|
980
913
|
|
|
@@ -985,7 +918,7 @@ Returns the structured landmarks navigation document as a Navigation object
|
|
|
985
918
|
|
|
986
919
|
##### Returns
|
|
987
920
|
|
|
988
|
-
`Promise
|
|
921
|
+
`Promise`\<[`Navigation`](#navigation) \| `null`\>
|
|
989
922
|
|
|
990
923
|
##### Link
|
|
991
924
|
|
|
@@ -993,19 +926,19 @@ https://www.w3.org/TR/epub-33/#sec-nav-landmarks
|
|
|
993
926
|
|
|
994
927
|
#### getLanguage()
|
|
995
928
|
|
|
996
|
-
> **getLanguage**(): `Promise`\<`
|
|
929
|
+
> **getLanguage**(): `Promise`\<`Locale` \| `null`\>
|
|
997
930
|
|
|
998
|
-
Defined in:
|
|
999
|
-
[libraries/epub/index.ts:1871](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1871)
|
|
931
|
+
Defined in: [libraries/epub/index.ts:1881](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1881)
|
|
1000
932
|
|
|
1001
|
-
Retrieve the Epub's language as specified in its
|
|
933
|
+
Retrieve the Epub's language as specified in its
|
|
934
|
+
package document metadata.
|
|
1002
935
|
|
|
1003
|
-
If no language metadata is specified, returns null.
|
|
1004
|
-
Intl.Locale instance.
|
|
936
|
+
If no language metadata is specified, returns null.
|
|
937
|
+
Returns the language as an Intl.Locale instance.
|
|
1005
938
|
|
|
1006
939
|
##### Returns
|
|
1007
940
|
|
|
1008
|
-
`Promise`\<`
|
|
941
|
+
`Promise`\<`Locale` \| `null`\>
|
|
1009
942
|
|
|
1010
943
|
##### Link
|
|
1011
944
|
|
|
@@ -1015,10 +948,10 @@ https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
|
|
|
1015
948
|
|
|
1016
949
|
> **getLayout**(): `Promise`\<`"pre-paginated"` \| `"reflowable"`\>
|
|
1017
950
|
|
|
1018
|
-
Defined in:
|
|
1019
|
-
[libraries/epub/index.ts:1687](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1687)
|
|
951
|
+
Defined in: [libraries/epub/index.ts:1697](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1697)
|
|
1020
952
|
|
|
1021
|
-
Retrieve the layout from the rendition:layout meta element
|
|
953
|
+
Retrieve the layout from the rendition:layout meta element
|
|
954
|
+
in the EPUB metadata.
|
|
1022
955
|
|
|
1023
956
|
If there is no meta element, returns 'reflowable'.
|
|
1024
957
|
|
|
@@ -1032,16 +965,14 @@ https://www.w3.org/TR/epub-33/#layout
|
|
|
1032
965
|
|
|
1033
966
|
#### getManifest()
|
|
1034
967
|
|
|
1035
|
-
> **getManifest**(): `Promise`\<`Record`\<`string`,
|
|
1036
|
-
> [`ManifestItem`](#manifestitem)\>\>
|
|
968
|
+
> **getManifest**(): `Promise`\<`Record`\<`string`, [`ManifestItem`](#manifestitem)\>\>
|
|
1037
969
|
|
|
1038
|
-
Defined in:
|
|
1039
|
-
[libraries/epub/index.ts:875](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L875)
|
|
970
|
+
Defined in: [libraries/epub/index.ts:885](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L885)
|
|
1040
971
|
|
|
1041
972
|
Retrieve the manifest for the Epub.
|
|
1042
973
|
|
|
1043
|
-
This is represented as a map from each manifest items'
|
|
1044
|
-
properties.
|
|
974
|
+
This is represented as a map from each manifest items'
|
|
975
|
+
id to the rest of its properties.
|
|
1045
976
|
|
|
1046
977
|
##### Returns
|
|
1047
978
|
|
|
@@ -1055,16 +986,15 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
1055
986
|
|
|
1056
987
|
> **getMetadata**(): `Promise`\<[`EpubMetadata`](#epubmetadata)\>
|
|
1057
988
|
|
|
1058
|
-
Defined in:
|
|
1059
|
-
[libraries/epub/index.ts:1026](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1026)
|
|
989
|
+
Defined in: [libraries/epub/index.ts:1036](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1036)
|
|
1060
990
|
|
|
1061
991
|
Retrieve the metadata entries for the Epub.
|
|
1062
992
|
|
|
1063
|
-
This is represented as an array of metadata entries,
|
|
1064
|
-
presented in the Epub package document.
|
|
993
|
+
This is represented as an array of metadata entries,
|
|
994
|
+
in the order that they're presented in the Epub package document.
|
|
1065
995
|
|
|
1066
|
-
For more useful semantic representations of metadata, use
|
|
1067
|
-
as `getTitle()` and `getAuthors()`.
|
|
996
|
+
For more useful semantic representations of metadata, use
|
|
997
|
+
specific methods such as `getTitle()` and `getAuthors()`.
|
|
1068
998
|
|
|
1069
999
|
##### Returns
|
|
1070
1000
|
|
|
@@ -1076,19 +1006,18 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
1076
1006
|
|
|
1077
1007
|
#### getModifiedDate()
|
|
1078
1008
|
|
|
1079
|
-
> **getModifiedDate**(): `Promise`\<`
|
|
1009
|
+
> **getModifiedDate**(): `Promise`\<`Date` \| `null`\>
|
|
1080
1010
|
|
|
1081
|
-
Defined in:
|
|
1082
|
-
[libraries/epub/index.ts:1670](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1670)
|
|
1011
|
+
Defined in: [libraries/epub/index.ts:1680](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1680)
|
|
1083
1012
|
|
|
1084
|
-
Retrieve the modified date from the dcterms:modified metadata
|
|
1085
|
-
metadata as a Date object.
|
|
1013
|
+
Retrieve the modified date from the dcterms:modified metadata
|
|
1014
|
+
in the EPUB metadata as a Date object.
|
|
1086
1015
|
|
|
1087
1016
|
If there is no meta element with dcterms:modified, returns null.
|
|
1088
1017
|
|
|
1089
1018
|
##### Returns
|
|
1090
1019
|
|
|
1091
|
-
`Promise`\<`
|
|
1020
|
+
`Promise`\<`Date` \| `null`\>
|
|
1092
1021
|
|
|
1093
1022
|
##### Link
|
|
1094
1023
|
|
|
@@ -1098,14 +1027,14 @@ https://www.w3.org/TR/epub-33/#sec-metadata-last-modified
|
|
|
1098
1027
|
|
|
1099
1028
|
> **getNcxTableOfContents**(): `Promise`\<[`NavigationList`](#navigationlist)\>
|
|
1100
1029
|
|
|
1101
|
-
Defined in:
|
|
1102
|
-
[libraries/epub/index.ts:3410](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3410)
|
|
1030
|
+
Defined in: [libraries/epub/index.ts:3416](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3416)
|
|
1103
1031
|
|
|
1104
|
-
Parse the NCX table of contents, if one exists, and return
|
|
1105
|
-
nodes.
|
|
1032
|
+
Parse the NCX table of contents, if one exists, and return
|
|
1033
|
+
a tree of TocEntry nodes.
|
|
1106
1034
|
|
|
1107
|
-
Useful for both EPUB 2 publications (where the NCX is the
|
|
1108
|
-
and EPUB 3 publications that retain an
|
|
1035
|
+
Useful for both EPUB 2 publications (where the NCX is the
|
|
1036
|
+
primary navigation) and EPUB 3 publications that retain an
|
|
1037
|
+
NCX for backwards compatibility.
|
|
1109
1038
|
|
|
1110
1039
|
##### Returns
|
|
1111
1040
|
|
|
@@ -1113,11 +1042,9 @@ and EPUB 3 publications that retain an NCX for backwards compatibility.
|
|
|
1113
1042
|
|
|
1114
1043
|
#### getPackageElement()
|
|
1115
1044
|
|
|
1116
|
-
> **getPackageElement**():
|
|
1117
|
-
> `Promise`\<[`XmlElement`](#xmlelement)\<`"package"`\>\>
|
|
1045
|
+
> **getPackageElement**(): `Promise`\<[`XmlElement`](#xmlelement)\<`"package"`\>\>
|
|
1118
1046
|
|
|
1119
|
-
Defined in:
|
|
1120
|
-
[libraries/epub/index.ts:810](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L810)
|
|
1047
|
+
Defined in: [libraries/epub/index.ts:820](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L820)
|
|
1121
1048
|
|
|
1122
1049
|
##### Returns
|
|
1123
1050
|
|
|
@@ -1125,14 +1052,12 @@ Defined in:
|
|
|
1125
1052
|
|
|
1126
1053
|
#### getPackageVocabularyPrefixes()
|
|
1127
1054
|
|
|
1128
|
-
> **getPackageVocabularyPrefixes**(): `Promise`\<`Record`\<`string`,
|
|
1129
|
-
> `string`\>\>
|
|
1055
|
+
> **getPackageVocabularyPrefixes**(): `Promise`\<`Record`\<`string`, `string`\>\>
|
|
1130
1056
|
|
|
1131
|
-
Defined in:
|
|
1132
|
-
[libraries/epub/index.ts:2051](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2051)
|
|
1057
|
+
Defined in: [libraries/epub/index.ts:2061](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2061)
|
|
1133
1058
|
|
|
1134
|
-
Return the set of custom vocabulary prefixes set on this publication's
|
|
1135
|
-
package element.
|
|
1059
|
+
Return the set of custom vocabulary prefixes set on this publication's
|
|
1060
|
+
root package element.
|
|
1136
1061
|
|
|
1137
1062
|
Returns a map from prefix to URI
|
|
1138
1063
|
|
|
@@ -1146,21 +1071,20 @@ https://www.w3.org/TR/epub-33/#sec-prefix-attr
|
|
|
1146
1071
|
|
|
1147
1072
|
#### getPageBreakSource()
|
|
1148
1073
|
|
|
1149
|
-
> **getPageBreakSource**(): `Promise
|
|
1074
|
+
> **getPageBreakSource**(): `Promise`\<[`EpubSource`](#epubsource) \| `null`\>
|
|
1150
1075
|
|
|
1151
|
-
Defined in:
|
|
1152
|
-
[libraries/epub/index.ts:1269](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1269)
|
|
1076
|
+
Defined in: [libraries/epub/index.ts:1279](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1279)
|
|
1153
1077
|
|
|
1154
1078
|
Retrieve the `pageBreakSource` property (EPUB 3.4, spec D.2.9), the
|
|
1155
1079
|
publication-level source for the source of its page break markers.
|
|
1156
1080
|
|
|
1157
|
-
This property replaces the refining `source-of="pagination"` meta (spec
|
|
1158
|
-
see EpubSource.sourceOf. If no `pageBreakSource` property is found,
|
|
1159
|
-
to finding a `dc:source` with a `source-of="pagination"` refinement.
|
|
1081
|
+
This property replaces the refining `source-of="pagination"` meta (spec
|
|
1082
|
+
D.3.11), see EpubSource.sourceOf. If no `pageBreakSource` property is found,
|
|
1083
|
+
we fall back to finding a `dc:source` with a `source-of="pagination"` refinement.
|
|
1160
1084
|
|
|
1161
1085
|
##### Returns
|
|
1162
1086
|
|
|
1163
|
-
`Promise
|
|
1087
|
+
`Promise`\<[`EpubSource`](#epubsource) \| `null`\>
|
|
1164
1088
|
|
|
1165
1089
|
##### Link
|
|
1166
1090
|
|
|
@@ -1168,13 +1092,12 @@ https://www.w3.org/TR/epub/#pageBreakSource
|
|
|
1168
1092
|
|
|
1169
1093
|
#### getPageList()
|
|
1170
1094
|
|
|
1171
|
-
> **getPageList**(`__namedParameters`): `Promise
|
|
1172
|
-
> [`Navigation`](#navigation)\>
|
|
1095
|
+
> **getPageList**(`__namedParameters`): `Promise`\<[`Navigation`](#navigation) \| `null`\>
|
|
1173
1096
|
|
|
1174
|
-
Defined in:
|
|
1175
|
-
[libraries/epub/index.ts:2813](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2813)
|
|
1097
|
+
Defined in: [libraries/epub/index.ts:2823](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2823)
|
|
1176
1098
|
|
|
1177
|
-
Returns the structured page list navigation document
|
|
1099
|
+
Returns the structured page list navigation document
|
|
1100
|
+
as a Navigation object
|
|
1178
1101
|
|
|
1179
1102
|
##### Parameters
|
|
1180
1103
|
|
|
@@ -1185,7 +1108,7 @@ Returns the structured page list navigation document as a Navigation object
|
|
|
1185
1108
|
|
|
1186
1109
|
##### Returns
|
|
1187
1110
|
|
|
1188
|
-
`Promise
|
|
1111
|
+
`Promise`\<[`Navigation`](#navigation) \| `null`\>
|
|
1189
1112
|
|
|
1190
1113
|
##### Link
|
|
1191
1114
|
|
|
@@ -1193,19 +1116,18 @@ https://www.w3.org/TR/epub-33/#sec-nav-landmarks
|
|
|
1193
1116
|
|
|
1194
1117
|
#### getPublicationDate()
|
|
1195
1118
|
|
|
1196
|
-
> **getPublicationDate**(): `Promise`\<`
|
|
1119
|
+
> **getPublicationDate**(): `Promise`\<`Date` \| `null`\>
|
|
1197
1120
|
|
|
1198
|
-
Defined in:
|
|
1199
|
-
[libraries/epub/index.ts:1639](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1639)
|
|
1121
|
+
Defined in: [libraries/epub/index.ts:1649](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1649)
|
|
1200
1122
|
|
|
1201
|
-
Retrieve the publication date from the dc:date element
|
|
1202
|
-
Date object.
|
|
1123
|
+
Retrieve the publication date from the dc:date element
|
|
1124
|
+
in the EPUB metadata as a Date object.
|
|
1203
1125
|
|
|
1204
1126
|
If there is no dc:date element, returns null.
|
|
1205
1127
|
|
|
1206
1128
|
##### Returns
|
|
1207
1129
|
|
|
1208
|
-
`Promise`\<`
|
|
1130
|
+
`Promise`\<`Date` \| `null`\>
|
|
1209
1131
|
|
|
1210
1132
|
##### Link
|
|
1211
1133
|
|
|
@@ -1215,8 +1137,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcdate
|
|
|
1215
1137
|
|
|
1216
1138
|
> **getRootfile**(): `Promise`\<`string`\>
|
|
1217
1139
|
|
|
1218
|
-
Defined in:
|
|
1219
|
-
[libraries/epub/index.ts:746](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L746)
|
|
1140
|
+
Defined in: [libraries/epub/index.ts:756](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L756)
|
|
1220
1141
|
|
|
1221
1142
|
##### Returns
|
|
1222
1143
|
|
|
@@ -1226,13 +1147,12 @@ Defined in:
|
|
|
1226
1147
|
|
|
1227
1148
|
> **getSources**(): `Promise`\<[`EpubSource`](#epubsource)[]\>
|
|
1228
1149
|
|
|
1229
|
-
Defined in:
|
|
1230
|
-
[libraries/epub/index.ts:1246](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1246)
|
|
1150
|
+
Defined in: [libraries/epub/index.ts:1256](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1256)
|
|
1231
1151
|
|
|
1232
1152
|
Retrieve every `dc:source` entry, returned as found.
|
|
1233
1153
|
|
|
1234
|
-
Like [getIdentifiers](#getidentifiers), values are not interpreted. In addition
|
|
1235
|
-
|
|
1154
|
+
Like [getIdentifiers](#getidentifiers), values are not interpreted. In addition to a
|
|
1155
|
+
refining `identifier-type`, a refining `source-of` meta (spec D.3.11) is
|
|
1236
1156
|
surfaced as `sourceOf`.
|
|
1237
1157
|
|
|
1238
1158
|
##### Returns
|
|
@@ -1247,13 +1167,12 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsource
|
|
|
1247
1167
|
|
|
1248
1168
|
> **getSpineItems**(): `Promise`\<[`ManifestItem`](#manifestitem)[]\>
|
|
1249
1169
|
|
|
1250
|
-
Defined in:
|
|
1251
|
-
[libraries/epub/index.ts:2603](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2603)
|
|
1170
|
+
Defined in: [libraries/epub/index.ts:2613](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2613)
|
|
1252
1171
|
|
|
1253
1172
|
Retrieve the manifest items that make up the Epub's spine.
|
|
1254
1173
|
|
|
1255
|
-
The spine specifies the order that the contents of the Epub
|
|
1256
|
-
to users by default.
|
|
1174
|
+
The spine specifies the order that the contents of the Epub
|
|
1175
|
+
should be displayed to users by default.
|
|
1257
1176
|
|
|
1258
1177
|
##### Returns
|
|
1259
1178
|
|
|
@@ -1267,13 +1186,13 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
|
1267
1186
|
|
|
1268
1187
|
> **getSubjects**(): `Promise`\<(`string` \| [`DcSubject`](#dcsubject))[]\>
|
|
1269
1188
|
|
|
1270
|
-
Defined in:
|
|
1271
|
-
[libraries/epub/index.ts:1826](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1826)
|
|
1189
|
+
Defined in: [libraries/epub/index.ts:1836](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1836)
|
|
1272
1190
|
|
|
1273
1191
|
Retrieve the list of subjects for this EPUB.
|
|
1274
1192
|
|
|
1275
|
-
Subjects without associated authority and term metadata
|
|
1276
|
-
|
|
1193
|
+
Subjects without associated authority and term metadata
|
|
1194
|
+
will be returned as strings. Otherwise, they will
|
|
1195
|
+
be represented as DcSubject objects, with a value,
|
|
1277
1196
|
authority, and term.
|
|
1278
1197
|
|
|
1279
1198
|
##### Returns
|
|
@@ -1286,16 +1205,15 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
|
|
|
1286
1205
|
|
|
1287
1206
|
#### getSubtitle()
|
|
1288
1207
|
|
|
1289
|
-
> **getSubtitle**(): `Promise`\<`
|
|
1208
|
+
> **getSubtitle**(): `Promise`\<`string` \| `null`\>
|
|
1290
1209
|
|
|
1291
|
-
Defined in:
|
|
1292
|
-
[libraries/epub/index.ts:1941](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1941)
|
|
1210
|
+
Defined in: [libraries/epub/index.ts:1951](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1951)
|
|
1293
1211
|
|
|
1294
1212
|
Retrieve the subtitle of the Epub, if it exists.
|
|
1295
1213
|
|
|
1296
1214
|
##### Returns
|
|
1297
1215
|
|
|
1298
|
-
`Promise`\<`
|
|
1216
|
+
`Promise`\<`string` \| `null`\>
|
|
1299
1217
|
|
|
1300
1218
|
##### Link
|
|
1301
1219
|
|
|
@@ -1303,14 +1221,12 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
1303
1221
|
|
|
1304
1222
|
#### getTableOfContents()
|
|
1305
1223
|
|
|
1306
|
-
> **getTableOfContents**(`__namedParameters`): `Promise
|
|
1307
|
-
> [`Navigation`](#navigation)\>
|
|
1224
|
+
> **getTableOfContents**(`__namedParameters`): `Promise`\<[`Navigation`](#navigation) \| `null`\>
|
|
1308
1225
|
|
|
1309
|
-
Defined in:
|
|
1310
|
-
[libraries/epub/index.ts:2784](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2784)
|
|
1226
|
+
Defined in: [libraries/epub/index.ts:2794](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2794)
|
|
1311
1227
|
|
|
1312
|
-
Returns the structured table of contents navigation document
|
|
1313
|
-
object.
|
|
1228
|
+
Returns the structured table of contents navigation document
|
|
1229
|
+
as a Navigation object.
|
|
1314
1230
|
|
|
1315
1231
|
##### Parameters
|
|
1316
1232
|
|
|
@@ -1321,7 +1237,7 @@ object.
|
|
|
1321
1237
|
|
|
1322
1238
|
##### Returns
|
|
1323
1239
|
|
|
1324
|
-
`Promise
|
|
1240
|
+
`Promise`\<[`Navigation`](#navigation) \| `null`\>
|
|
1325
1241
|
|
|
1326
1242
|
##### Link
|
|
1327
1243
|
|
|
@@ -1329,10 +1245,9 @@ https://www.w3.org/TR/epub-33/#sec-nav-toc
|
|
|
1329
1245
|
|
|
1330
1246
|
#### getTitle()
|
|
1331
1247
|
|
|
1332
|
-
> **getTitle**(`expanded`): `Promise`\<`
|
|
1248
|
+
> **getTitle**(`expanded`): `Promise`\<`string` \| `null`\>
|
|
1333
1249
|
|
|
1334
|
-
Defined in:
|
|
1335
|
-
[libraries/epub/index.ts:1917](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1917)
|
|
1250
|
+
Defined in: [libraries/epub/index.ts:1927](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1927)
|
|
1336
1251
|
|
|
1337
1252
|
Retrieve the title of the Epub.
|
|
1338
1253
|
|
|
@@ -1344,7 +1259,7 @@ Retrieve the title of the Epub.
|
|
|
1344
1259
|
|
|
1345
1260
|
##### Returns
|
|
1346
1261
|
|
|
1347
|
-
`Promise`\<`
|
|
1262
|
+
`Promise`\<`string` \| `null`\>
|
|
1348
1263
|
|
|
1349
1264
|
##### Link
|
|
1350
1265
|
|
|
@@ -1354,8 +1269,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
1354
1269
|
|
|
1355
1270
|
> **getTitles**(): `Promise`\<`object`[]\>
|
|
1356
1271
|
|
|
1357
|
-
Defined in:
|
|
1358
|
-
[libraries/epub/index.ts:1953](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1953)
|
|
1272
|
+
Defined in: [libraries/epub/index.ts:1963](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1963)
|
|
1359
1273
|
|
|
1360
1274
|
Retrieve all title entries of the Epub.
|
|
1361
1275
|
|
|
@@ -1369,18 +1283,18 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
1369
1283
|
|
|
1370
1284
|
#### getType()
|
|
1371
1285
|
|
|
1372
|
-
> **getType**(): `Promise
|
|
1286
|
+
> **getType**(): `Promise`\<[`MetadataEntry`](#metadataentry) \| `null`\>
|
|
1373
1287
|
|
|
1374
|
-
Defined in:
|
|
1375
|
-
[libraries/epub/index.ts:1739](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1739)
|
|
1288
|
+
Defined in: [libraries/epub/index.ts:1749](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1749)
|
|
1376
1289
|
|
|
1377
|
-
Retrieve the publication type from the dc:type element
|
|
1290
|
+
Retrieve the publication type from the dc:type element
|
|
1291
|
+
in the EPUB metadata.
|
|
1378
1292
|
|
|
1379
1293
|
If there is no dc:type element, returns null.
|
|
1380
1294
|
|
|
1381
1295
|
##### Returns
|
|
1382
1296
|
|
|
1383
|
-
`Promise
|
|
1297
|
+
`Promise`\<[`MetadataEntry`](#metadataentry) \| `null`\>
|
|
1384
1298
|
|
|
1385
1299
|
##### Link
|
|
1386
1300
|
|
|
@@ -1388,18 +1302,18 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctype
|
|
|
1388
1302
|
|
|
1389
1303
|
#### getUniqueIdentifier()
|
|
1390
1304
|
|
|
1391
|
-
> **getUniqueIdentifier**(): `Promise`\<`
|
|
1305
|
+
> **getUniqueIdentifier**(): `Promise`\<`string` \| `null`\>
|
|
1392
1306
|
|
|
1393
|
-
Defined in:
|
|
1394
|
-
[libraries/epub/index.ts:1089](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1089)
|
|
1307
|
+
Defined in: [libraries/epub/index.ts:1099](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1099)
|
|
1395
1308
|
|
|
1396
|
-
Retrieve the identifier with the unique identifier id
|
|
1309
|
+
Retrieve the identifier with the unique identifier id
|
|
1310
|
+
in the EPUB metadata.
|
|
1397
1311
|
|
|
1398
1312
|
If there is no unique identifier id, returns the first dc:identifier element.
|
|
1399
1313
|
|
|
1400
1314
|
##### Returns
|
|
1401
1315
|
|
|
1402
|
-
`Promise`\<`
|
|
1316
|
+
`Promise`\<`string` \| `null`\>
|
|
1403
1317
|
|
|
1404
1318
|
##### Link
|
|
1405
1319
|
|
|
@@ -1407,17 +1321,16 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
|
1407
1321
|
|
|
1408
1322
|
#### getUniqueIdentifierId()
|
|
1409
1323
|
|
|
1410
|
-
> **getUniqueIdentifierId**(): `Promise`\<`
|
|
1324
|
+
> **getUniqueIdentifierId**(): `Promise`\<`string` \| `null`\>
|
|
1411
1325
|
|
|
1412
|
-
Defined in:
|
|
1413
|
-
[libraries/epub/index.ts:1170](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1170)
|
|
1326
|
+
Defined in: [libraries/epub/index.ts:1180](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1180)
|
|
1414
1327
|
|
|
1415
1328
|
Retrieve the id of the publication's unique identifier, as declared by the
|
|
1416
1329
|
package element's `unique-identifier` attribute.
|
|
1417
1330
|
|
|
1418
1331
|
##### Returns
|
|
1419
1332
|
|
|
1420
|
-
`Promise`\<`
|
|
1333
|
+
`Promise`\<`string` \| `null`\>
|
|
1421
1334
|
|
|
1422
1335
|
##### Link
|
|
1423
1336
|
|
|
@@ -1427,8 +1340,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
|
1427
1340
|
|
|
1428
1341
|
> **getVersion**(): `Promise`\<`string`\>
|
|
1429
1342
|
|
|
1430
|
-
Defined in:
|
|
1431
|
-
[libraries/epub/index.ts:3397](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3397)
|
|
1343
|
+
Defined in: [libraries/epub/index.ts:3403](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3403)
|
|
1432
1344
|
|
|
1433
1345
|
Returns the EPUB version declared on the package element.
|
|
1434
1346
|
|
|
@@ -1440,16 +1352,14 @@ Returns the EPUB version declared on the package element.
|
|
|
1440
1352
|
|
|
1441
1353
|
##### Call Signature
|
|
1442
1354
|
|
|
1443
|
-
> **readFileContents**(`href`, `relativeTo?`):
|
|
1444
|
-
> `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
1355
|
+
> **readFileContents**(`href`, `relativeTo?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
1445
1356
|
|
|
1446
|
-
Defined in:
|
|
1447
|
-
[libraries/epub/index.ts:2920](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2920)
|
|
1357
|
+
Defined in: [libraries/epub/index.ts:2930](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2930)
|
|
1448
1358
|
|
|
1449
1359
|
Retrieve the contents of a file, given its href.
|
|
1450
1360
|
|
|
1451
|
-
Optionally takes the href that this href should be resolved relative to,
|
|
1452
|
-
encoding parameter.
|
|
1361
|
+
Optionally takes the href that this href should be resolved relative to,
|
|
1362
|
+
and an encoding parameter.
|
|
1453
1363
|
|
|
1454
1364
|
###### Parameters
|
|
1455
1365
|
|
|
@@ -1466,20 +1376,19 @@ encoding parameter.
|
|
|
1466
1376
|
|
|
1467
1377
|
> **readFileContents**(`href`, `relativeTo`, `encoding`): `Promise`\<`string`\>
|
|
1468
1378
|
|
|
1469
|
-
Defined in:
|
|
1470
|
-
[libraries/epub/index.ts:2921](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2921)
|
|
1379
|
+
Defined in: [libraries/epub/index.ts:2931](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2931)
|
|
1471
1380
|
|
|
1472
1381
|
Retrieve the contents of a file, given its href.
|
|
1473
1382
|
|
|
1474
|
-
Optionally takes the href that this href should be resolved relative to,
|
|
1475
|
-
encoding parameter.
|
|
1383
|
+
Optionally takes the href that this href should be resolved relative to,
|
|
1384
|
+
and an encoding parameter.
|
|
1476
1385
|
|
|
1477
1386
|
###### Parameters
|
|
1478
1387
|
|
|
1479
1388
|
| Parameter | Type | Description |
|
|
1480
1389
|
| ------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1481
1390
|
| `href` | `string` | The href of the file to retrieve |
|
|
1482
|
-
| `relativeTo` | `
|
|
1391
|
+
| `relativeTo` | `string` \| `undefined` | - |
|
|
1483
1392
|
| `encoding` | `"utf-8"` | Optional - Must be the string "utf-8". If provided, the function will encode the data into a unicode string. Otherwise, the data will be returned as a byte array. |
|
|
1484
1393
|
|
|
1485
1394
|
###### Returns
|
|
@@ -1492,8 +1401,7 @@ encoding parameter.
|
|
|
1492
1401
|
|
|
1493
1402
|
> **readItemContents**(`id`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
1494
1403
|
|
|
1495
|
-
Defined in:
|
|
1496
|
-
[libraries/epub/index.ts:2953](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2953)
|
|
1404
|
+
Defined in: [libraries/epub/index.ts:2963](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2963)
|
|
1497
1405
|
|
|
1498
1406
|
Retrieve the contents of a manifest item, given its id.
|
|
1499
1407
|
|
|
@@ -1515,8 +1423,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
1515
1423
|
|
|
1516
1424
|
> **readItemContents**(`id`, `encoding`): `Promise`\<`string`\>
|
|
1517
1425
|
|
|
1518
|
-
Defined in:
|
|
1519
|
-
[libraries/epub/index.ts:2954](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2954)
|
|
1426
|
+
Defined in: [libraries/epub/index.ts:2964](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2964)
|
|
1520
1427
|
|
|
1521
1428
|
Retrieve the contents of a manifest item, given its id.
|
|
1522
1429
|
|
|
@@ -1541,8 +1448,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
1541
1448
|
|
|
1542
1449
|
> **readXhtmlItemContents**(`id`, `as?`): `Promise`\<[`ParsedXml`](#parsedxml)\>
|
|
1543
1450
|
|
|
1544
|
-
Defined in:
|
|
1545
|
-
[libraries/epub/index.ts:3016](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3016)
|
|
1451
|
+
Defined in: [libraries/epub/index.ts:3026](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3026)
|
|
1546
1452
|
|
|
1547
1453
|
Retrieves the contents of an XHTML item, given its manifest id.
|
|
1548
1454
|
|
|
@@ -1565,8 +1471,7 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
|
1565
1471
|
|
|
1566
1472
|
> **readXhtmlItemContents**(`id`, `as`): `Promise`\<`string`\>
|
|
1567
1473
|
|
|
1568
|
-
Defined in:
|
|
1569
|
-
[libraries/epub/index.ts:3017](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3017)
|
|
1474
|
+
Defined in: [libraries/epub/index.ts:3027](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3027)
|
|
1570
1475
|
|
|
1571
1476
|
Retrieves the contents of an XHTML item, given its manifest id.
|
|
1572
1477
|
|
|
@@ -1589,13 +1494,12 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
|
1589
1494
|
|
|
1590
1495
|
> **removeCollection**(`index`): `Promise`\<`void`\>
|
|
1591
1496
|
|
|
1592
|
-
Defined in:
|
|
1593
|
-
[libraries/epub/index.ts:2292](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2292)
|
|
1497
|
+
Defined in: [libraries/epub/index.ts:2302](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2302)
|
|
1594
1498
|
|
|
1595
1499
|
Remove a collection from the EPUB metadata.
|
|
1596
1500
|
|
|
1597
|
-
Removes the collection at the provided index. This index
|
|
1598
|
-
returned by `epub.getCollections()`.
|
|
1501
|
+
Removes the collection at the provided index. This index
|
|
1502
|
+
refers to the array returned by `epub.getCollections()`.
|
|
1599
1503
|
|
|
1600
1504
|
##### Parameters
|
|
1601
1505
|
|
|
@@ -1611,15 +1515,15 @@ returned by `epub.getCollections()`.
|
|
|
1611
1515
|
|
|
1612
1516
|
> **removeContributor**(`index`): `Promise`\<`void`\>
|
|
1613
1517
|
|
|
1614
|
-
Defined in:
|
|
1615
|
-
[libraries/epub/index.ts:2552](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2552)
|
|
1518
|
+
Defined in: [libraries/epub/index.ts:2562](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2562)
|
|
1616
1519
|
|
|
1617
1520
|
Remove a contributor from the EPUB metadata.
|
|
1618
1521
|
|
|
1619
|
-
Removes the contributor at the provided index. This index
|
|
1620
|
-
returned by `epub.getContributors()`.
|
|
1522
|
+
Removes the contributor at the provided index. This index
|
|
1523
|
+
refers to the array returned by `epub.getContributors()`.
|
|
1621
1524
|
|
|
1622
|
-
This is a convenience method for
|
|
1525
|
+
This is a convenience method for
|
|
1526
|
+
`epub.removeCreator(index, 'contributor')`.
|
|
1623
1527
|
|
|
1624
1528
|
##### Parameters
|
|
1625
1529
|
|
|
@@ -1639,13 +1543,12 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
1639
1543
|
|
|
1640
1544
|
> **removeCreator**(`index`, `type`): `Promise`\<`void`\>
|
|
1641
1545
|
|
|
1642
|
-
Defined in:
|
|
1643
|
-
[libraries/epub/index.ts:2500](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2500)
|
|
1546
|
+
Defined in: [libraries/epub/index.ts:2510](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2510)
|
|
1644
1547
|
|
|
1645
1548
|
Remove a creator from the EPUB metadata.
|
|
1646
1549
|
|
|
1647
|
-
Removes the creator at the provided index. This index
|
|
1648
|
-
returned by `epub.getCreators()`.
|
|
1550
|
+
Removes the creator at the provided index. This index
|
|
1551
|
+
refers to the array returned by `epub.getCreators()`.
|
|
1649
1552
|
|
|
1650
1553
|
##### Parameters
|
|
1651
1554
|
|
|
@@ -1666,8 +1569,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
1666
1569
|
|
|
1667
1570
|
> **removeManifestItem**(`id`): `Promise`\<`void`\>
|
|
1668
1571
|
|
|
1669
|
-
Defined in:
|
|
1670
|
-
[libraries/epub/index.ts:3121](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3121)
|
|
1572
|
+
Defined in: [libraries/epub/index.ts:3127](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3127)
|
|
1671
1573
|
|
|
1672
1574
|
##### Parameters
|
|
1673
1575
|
|
|
@@ -1683,13 +1585,13 @@ Defined in:
|
|
|
1683
1585
|
|
|
1684
1586
|
> **removeMetadata**(`predicate`): `Promise`\<`void`\>
|
|
1685
1587
|
|
|
1686
|
-
Defined in:
|
|
1687
|
-
[libraries/epub/index.ts:3369](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3369)
|
|
1588
|
+
Defined in: [libraries/epub/index.ts:3375](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3375)
|
|
1688
1589
|
|
|
1689
1590
|
Remove one or more metadata entries.
|
|
1690
1591
|
|
|
1691
|
-
The `predicate` argument will be used to determine which entries
|
|
1692
|
-
all metadata entries that match the
|
|
1592
|
+
The `predicate` argument will be used to determine which entries
|
|
1593
|
+
to remove. The all metadata entries that match the
|
|
1594
|
+
predicate will be removed.
|
|
1693
1595
|
|
|
1694
1596
|
##### Parameters
|
|
1695
1597
|
|
|
@@ -1709,8 +1611,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
1709
1611
|
|
|
1710
1612
|
> **removeSpineItem**(`index`): `Promise`\<`void`\>
|
|
1711
1613
|
|
|
1712
|
-
Defined in:
|
|
1713
|
-
[libraries/epub/index.ts:2658](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2658)
|
|
1614
|
+
Defined in: [libraries/epub/index.ts:2668](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2668)
|
|
1714
1615
|
|
|
1715
1616
|
Remove the spine item at the specified index.
|
|
1716
1617
|
|
|
@@ -1732,13 +1633,12 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
|
1732
1633
|
|
|
1733
1634
|
> **removeSubject**(`index`): `Promise`\<`void`\>
|
|
1734
1635
|
|
|
1735
|
-
Defined in:
|
|
1736
|
-
[libraries/epub/index.ts:1789](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1789)
|
|
1636
|
+
Defined in: [libraries/epub/index.ts:1799](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1799)
|
|
1737
1637
|
|
|
1738
1638
|
Remove a subject from the EPUB metadata.
|
|
1739
1639
|
|
|
1740
|
-
Removes the subject at the provided index. This index
|
|
1741
|
-
returned by `epub.getSubjects()`.
|
|
1640
|
+
Removes the subject at the provided index. This index
|
|
1641
|
+
refers to the array returned by `epub.getSubjects()`.
|
|
1742
1642
|
|
|
1743
1643
|
##### Parameters
|
|
1744
1644
|
|
|
@@ -1758,13 +1658,13 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
1758
1658
|
|
|
1759
1659
|
> **replaceMetadata**(`predicate`, `entry`): `Promise`\<`void`\>
|
|
1760
1660
|
|
|
1761
|
-
Defined in:
|
|
1762
|
-
[libraries/epub/index.ts:3324](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3324)
|
|
1661
|
+
Defined in: [libraries/epub/index.ts:3330](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3330)
|
|
1763
1662
|
|
|
1764
1663
|
Replace a metadata entry with a new one.
|
|
1765
1664
|
|
|
1766
|
-
The `predicate` argument will be used to determine which entry
|
|
1767
|
-
first metadata entry that matches the
|
|
1665
|
+
The `predicate` argument will be used to determine which entry
|
|
1666
|
+
to replace. The first metadata entry that matches the
|
|
1667
|
+
predicate will be replaced.
|
|
1768
1668
|
|
|
1769
1669
|
##### Parameters
|
|
1770
1670
|
|
|
@@ -1783,16 +1683,15 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
1783
1683
|
|
|
1784
1684
|
#### resolveHref()
|
|
1785
1685
|
|
|
1786
|
-
> **resolveHref**(`href`, `relativeTo?`, `__namedParameters?`):
|
|
1787
|
-
> `Promise`\<`string`\>
|
|
1686
|
+
> **resolveHref**(`href`, `relativeTo?`, `__namedParameters?`): `Promise`\<`string`\>
|
|
1788
1687
|
|
|
1789
|
-
Defined in:
|
|
1790
|
-
[libraries/epub/index.ts:2876](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2876)
|
|
1688
|
+
Defined in: [libraries/epub/index.ts:2886](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2886)
|
|
1791
1689
|
|
|
1792
|
-
Returns a path-relative-scheme-less URL, relative to the
|
|
1690
|
+
Returns a path-relative-scheme-less URL, relative to the
|
|
1691
|
+
container root.
|
|
1793
1692
|
|
|
1794
|
-
An href that points outside the publication, such as an external link in
|
|
1795
|
-
navigation document, is handed back unchanged.
|
|
1693
|
+
An href that points outside the publication, such as an external link in
|
|
1694
|
+
a navigation document, is handed back unchanged.
|
|
1796
1695
|
|
|
1797
1696
|
##### Parameters
|
|
1798
1697
|
|
|
@@ -1811,13 +1710,14 @@ navigation document, is handed back unchanged.
|
|
|
1811
1710
|
|
|
1812
1711
|
> **saveAndClose**(): `Promise`\<`void`\>
|
|
1813
1712
|
|
|
1814
|
-
Defined in:
|
|
1815
|
-
[libraries/epub/index.ts:3542](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3542)
|
|
1713
|
+
Defined in: [libraries/epub/index.ts:3548](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3548)
|
|
1816
1714
|
|
|
1817
|
-
Write the current contents of the Epub to a new
|
|
1715
|
+
Write the current contents of the Epub to a new
|
|
1716
|
+
EPUB archive on disk.
|
|
1818
1717
|
|
|
1819
|
-
When this method is called, the "dcterms:modified"
|
|
1820
|
-
updated to the current UTC
|
|
1718
|
+
When this method is called, the "dcterms:modified"
|
|
1719
|
+
meta tag is automatically updated to the current UTC
|
|
1720
|
+
timestamp.
|
|
1821
1721
|
|
|
1822
1722
|
##### Returns
|
|
1823
1723
|
|
|
@@ -1827,13 +1727,13 @@ updated to the current UTC timestamp.
|
|
|
1827
1727
|
|
|
1828
1728
|
> **setCoverImage**(`href`, `data`): `Promise`\<`void`\>
|
|
1829
1729
|
|
|
1830
|
-
Defined in:
|
|
1831
|
-
[libraries/epub/index.ts:1616](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1616)
|
|
1730
|
+
Defined in: [libraries/epub/index.ts:1626](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1626)
|
|
1832
1731
|
|
|
1833
1732
|
Set the cover image for the EPUB.
|
|
1834
1733
|
|
|
1835
|
-
Adds a manifest item with the `cover-image` property, per
|
|
1836
|
-
then writes the provided image data to
|
|
1734
|
+
Adds a manifest item with the `cover-image` property, per
|
|
1735
|
+
the EPUB 3 spec, and then writes the provided image data to
|
|
1736
|
+
the provided href within the publication.
|
|
1837
1737
|
|
|
1838
1738
|
##### Parameters
|
|
1839
1739
|
|
|
@@ -1850,14 +1750,13 @@ then writes the provided image data to the provided href within the publication.
|
|
|
1850
1750
|
|
|
1851
1751
|
> **setDescription**(`description`): `Promise`\<`void`\>
|
|
1852
1752
|
|
|
1853
|
-
Defined in:
|
|
1854
|
-
[libraries/epub/index.ts:2018](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2018)
|
|
1753
|
+
Defined in: [libraries/epub/index.ts:2028](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2028)
|
|
1855
1754
|
|
|
1856
1755
|
Update the Epub's description metadata entry.
|
|
1857
1756
|
|
|
1858
|
-
Updates the existing dc:description element if one exists.
|
|
1859
|
-
new element. Any non-ASCII symbols,
|
|
1860
|
-
encoded as HTML entities.
|
|
1757
|
+
Updates the existing dc:description element if one exists.
|
|
1758
|
+
Otherwise creates a new element. Any non-ASCII symbols,
|
|
1759
|
+
`&`, `<`, `>`, `"`, `'`, and ```` will be encoded as HTML entities.
|
|
1861
1760
|
|
|
1862
1761
|
##### Parameters
|
|
1863
1762
|
|
|
@@ -1873,13 +1772,12 @@ encoded as HTML entities.
|
|
|
1873
1772
|
|
|
1874
1773
|
> **setIdentifier**(`identifier`): `Promise`\<`void`\>
|
|
1875
1774
|
|
|
1876
|
-
Defined in:
|
|
1877
|
-
[libraries/epub/index.ts:1073](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1073)
|
|
1775
|
+
Defined in: [libraries/epub/index.ts:1083](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1083)
|
|
1878
1776
|
|
|
1879
1777
|
Set the dc:identifier metadata element with the provided string.
|
|
1880
1778
|
|
|
1881
|
-
Updates the existing dc:identifier element if one exists.
|
|
1882
|
-
new element
|
|
1779
|
+
Updates the existing dc:identifier element if one exists.
|
|
1780
|
+
Otherwise creates a new element
|
|
1883
1781
|
|
|
1884
1782
|
##### Parameters
|
|
1885
1783
|
|
|
@@ -1903,8 +1801,7 @@ Use [setUniqueIdentifier](#setuniqueidentifier) instead.
|
|
|
1903
1801
|
|
|
1904
1802
|
> **setIdentifiers**(`identifiers`): `Promise`\<`void`\>
|
|
1905
1803
|
|
|
1906
|
-
Defined in:
|
|
1907
|
-
[libraries/epub/index.ts:1338](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1338)
|
|
1804
|
+
Defined in: [libraries/epub/index.ts:1348](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1348)
|
|
1908
1805
|
|
|
1909
1806
|
Replace the publication's `dc:identifier` entries.
|
|
1910
1807
|
|
|
@@ -1918,10 +1815,10 @@ Identifiers are placed in the order they are provided.
|
|
|
1918
1815
|
|
|
1919
1816
|
`dc:source` entries are not touched, use [setSources](#setsources) for those.
|
|
1920
1817
|
|
|
1921
|
-
When an entry has an `identifierType`, it is written in the refining form
|
|
1922
|
-
`meta` with `property="identifier-type"`, carrying the `scheme`
|
|
1923
|
-
provided). An entry with only a `scheme` is written using
|
|
1924
|
-
`opf:scheme` attribute.
|
|
1818
|
+
When an entry has an `identifierType`, it is written in the refining form
|
|
1819
|
+
(a `meta` with `property="identifier-type"`, carrying the `scheme`
|
|
1820
|
+
attribute when provided). An entry with only a `scheme` is written using
|
|
1821
|
+
the legacy `opf:scheme` attribute.
|
|
1925
1822
|
|
|
1926
1823
|
##### Parameters
|
|
1927
1824
|
|
|
@@ -1941,13 +1838,12 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
|
1941
1838
|
|
|
1942
1839
|
> **setLanguage**(`locale`): `Promise`\<`void`\>
|
|
1943
1840
|
|
|
1944
|
-
Defined in:
|
|
1945
|
-
[libraries/epub/index.ts:1900](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1900)
|
|
1841
|
+
Defined in: [libraries/epub/index.ts:1910](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1910)
|
|
1946
1842
|
|
|
1947
1843
|
Update the Epub's language metadata entry.
|
|
1948
1844
|
|
|
1949
|
-
Updates the existing dc:language element if one exists.
|
|
1950
|
-
element
|
|
1845
|
+
Updates the existing dc:language element if one exists.
|
|
1846
|
+
Otherwise creates a new element
|
|
1951
1847
|
|
|
1952
1848
|
##### Parameters
|
|
1953
1849
|
|
|
@@ -1967,8 +1863,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
|
|
|
1967
1863
|
|
|
1968
1864
|
> **setPackageVocabularyPrefix**(`prefix`, `uri`): `Promise`\<`void`\>
|
|
1969
1865
|
|
|
1970
|
-
Defined in:
|
|
1971
|
-
[libraries/epub/index.ts:2069](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2069)
|
|
1866
|
+
Defined in: [libraries/epub/index.ts:2079](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2079)
|
|
1972
1867
|
|
|
1973
1868
|
Set a custom vocabulary prefix on the root package element.
|
|
1974
1869
|
|
|
@@ -1991,8 +1886,7 @@ https://www.w3.org/TR/epub-33/#sec-prefix-attr
|
|
|
1991
1886
|
|
|
1992
1887
|
> **setPageBreakSource**(`value`): `Promise`\<`void`\>
|
|
1993
1888
|
|
|
1994
|
-
Defined in:
|
|
1995
|
-
[libraries/epub/index.ts:1305](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1305)
|
|
1889
|
+
Defined in: [libraries/epub/index.ts:1315](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1315)
|
|
1996
1890
|
|
|
1997
1891
|
Set the `pageBreakSource` property (EPUB 3.4, spec D.2.9), or remove it when
|
|
1998
1892
|
passed null. Replaces an existing `pageBreakSource` meta if present.
|
|
@@ -2003,7 +1897,7 @@ Pass `none` to indicate the pagination is unique to this publication.
|
|
|
2003
1897
|
|
|
2004
1898
|
| Parameter | Type |
|
|
2005
1899
|
| --------- | ------------------ |
|
|
2006
|
-
| `value` | `
|
|
1900
|
+
| `value` | `string` \| `null` |
|
|
2007
1901
|
|
|
2008
1902
|
##### Returns
|
|
2009
1903
|
|
|
@@ -2017,13 +1911,12 @@ https://www.w3.org/TR/epub/#pageBreakSource
|
|
|
2017
1911
|
|
|
2018
1912
|
> **setPublicationDate**(`date`): `Promise`\<`void`\>
|
|
2019
1913
|
|
|
2020
|
-
Defined in:
|
|
2021
|
-
[libraries/epub/index.ts:1654](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1654)
|
|
1914
|
+
Defined in: [libraries/epub/index.ts:1664](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1664)
|
|
2022
1915
|
|
|
2023
1916
|
Set the dc:date metadata element with the provided date.
|
|
2024
1917
|
|
|
2025
|
-
Updates the existing dc:date element if one exists.
|
|
2026
|
-
element
|
|
1918
|
+
Updates the existing dc:date element if one exists.
|
|
1919
|
+
Otherwise creates a new element
|
|
2027
1920
|
|
|
2028
1921
|
##### Parameters
|
|
2029
1922
|
|
|
@@ -2043,19 +1936,18 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcdate
|
|
|
2043
1936
|
|
|
2044
1937
|
> **setSources**(`sources`): `Promise`\<`void`\>
|
|
2045
1938
|
|
|
2046
|
-
Defined in:
|
|
2047
|
-
[libraries/epub/index.ts:1456](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1456)
|
|
1939
|
+
Defined in: [libraries/epub/index.ts:1466](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1466)
|
|
2048
1940
|
|
|
2049
1941
|
Replace the publication's `dc:source` entries.
|
|
2050
1942
|
|
|
2051
1943
|
This replaces ALL existing `dc:source` elements (and their refining
|
|
2052
|
-
`identifier-type` / `source-of` metas). `dc:identifier` entries are not
|
|
2053
|
-
use [setIdentifiers](#setidentifiers) for those. Pass an empty array to
|
|
2054
|
-
all sources.
|
|
1944
|
+
`identifier-type` / `source-of` metas). `dc:identifier` entries are not
|
|
1945
|
+
touched; use [setIdentifiers](#setidentifiers) for those. Pass an empty array to
|
|
1946
|
+
remove all sources.
|
|
2055
1947
|
|
|
2056
|
-
When an entry has an `identifierType`, it is written in the refining form.
|
|
2057
|
-
`sourceOf` value is written as a refining `source-of` meta (spec D.3.11).
|
|
2058
|
-
entry with only a `scheme` uses the legacy `opf:scheme` attribute.
|
|
1948
|
+
When an entry has an `identifierType`, it is written in the refining form.
|
|
1949
|
+
A `sourceOf` value is written as a refining `source-of` meta (spec D.3.11).
|
|
1950
|
+
An entry with only a `scheme` uses the legacy `opf:scheme` attribute.
|
|
2059
1951
|
|
|
2060
1952
|
##### Parameters
|
|
2061
1953
|
|
|
@@ -2075,13 +1967,12 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsource
|
|
|
2075
1967
|
|
|
2076
1968
|
> **setTitle**(`title`): `Promise`\<`void`\>
|
|
2077
1969
|
|
|
2078
|
-
Defined in:
|
|
2079
|
-
[libraries/epub/index.ts:2093](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2093)
|
|
1970
|
+
Defined in: [libraries/epub/index.ts:2103](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2103)
|
|
2080
1971
|
|
|
2081
1972
|
Set the title of the Epub.
|
|
2082
1973
|
|
|
2083
|
-
This will replace all existing dc:title elements with
|
|
2084
|
-
given title-type "main".
|
|
1974
|
+
This will replace all existing dc:title elements with
|
|
1975
|
+
this title. It will be given title-type "main".
|
|
2085
1976
|
|
|
2086
1977
|
To set specific titles and their types, use epub.setTitles().
|
|
2087
1978
|
|
|
@@ -2103,8 +1994,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
2103
1994
|
|
|
2104
1995
|
> **setTitles**(`entries`): `Promise`\<`void`\>
|
|
2105
1996
|
|
|
2106
|
-
Defined in:
|
|
2107
|
-
[libraries/epub/index.ts:2121](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2121)
|
|
1997
|
+
Defined in: [libraries/epub/index.ts:2131](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2131)
|
|
2108
1998
|
|
|
2109
1999
|
##### Parameters
|
|
2110
2000
|
|
|
@@ -2120,13 +2010,12 @@ Defined in:
|
|
|
2120
2010
|
|
|
2121
2011
|
> **setType**(`type`): `Promise`\<`void`\>
|
|
2122
2012
|
|
|
2123
|
-
Defined in:
|
|
2124
|
-
[libraries/epub/index.ts:1723](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1723)
|
|
2013
|
+
Defined in: [libraries/epub/index.ts:1733](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1733)
|
|
2125
2014
|
|
|
2126
2015
|
Set the dc:type metadata element.
|
|
2127
2016
|
|
|
2128
|
-
Updates the existing dc:type element if one exists.
|
|
2129
|
-
element.
|
|
2017
|
+
Updates the existing dc:type element if one exists.
|
|
2018
|
+
Otherwise creates a new element.
|
|
2130
2019
|
|
|
2131
2020
|
##### Parameters
|
|
2132
2021
|
|
|
@@ -2146,17 +2035,14 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctype
|
|
|
2146
2035
|
|
|
2147
2036
|
> **setUniqueIdentifier**(`identifier`): `Promise`\<`void`\>
|
|
2148
2037
|
|
|
2149
|
-
Defined in:
|
|
2150
|
-
[libraries/epub/index.ts:1114](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1114)
|
|
2038
|
+
Defined in: [libraries/epub/index.ts:1124](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1124)
|
|
2151
2039
|
|
|
2152
2040
|
Set the unique identifier id for the EPUB.
|
|
2153
2041
|
|
|
2154
|
-
Updates the existing dc:identifier element referenced by the unique identifier
|
|
2155
|
-
|
|
2156
|
-
and sets the unique identifier id to the new element's id.
|
|
2042
|
+
Updates the existing dc:identifier element referenced by the unique identifier id if one exists.
|
|
2043
|
+
Otherwise creates a new element with the provided identifier, and sets the unique identifier id to the new element's id.
|
|
2157
2044
|
|
|
2158
|
-
Note: you likely shouldn't change the unique identifier id unless you are
|
|
2159
|
-
producing a new EPUB.
|
|
2045
|
+
Note: you likely shouldn't change the unique identifier id unless you are producing a new EPUB.
|
|
2160
2046
|
|
|
2161
2047
|
##### Parameters
|
|
2162
2048
|
|
|
@@ -2176,13 +2062,12 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
|
2176
2062
|
|
|
2177
2063
|
> **updateManifestItem**(`id`, `newItem`): `Promise`\<`void`\>
|
|
2178
2064
|
|
|
2179
|
-
Defined in:
|
|
2180
|
-
[libraries/epub/index.ts:3236](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3236)
|
|
2065
|
+
Defined in: [libraries/epub/index.ts:3242](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3242)
|
|
2181
2066
|
|
|
2182
2067
|
Update the manifest entry for an existing item.
|
|
2183
2068
|
|
|
2184
|
-
To update the contents of an entry, use `epub.writeItemContents()`
|
|
2185
|
-
`epub.writeXhtmlItemContents()`
|
|
2069
|
+
To update the contents of an entry, use `epub.writeItemContents()`
|
|
2070
|
+
or `epub.writeXhtmlItemContents()`
|
|
2186
2071
|
|
|
2187
2072
|
##### Parameters
|
|
2188
2073
|
|
|
@@ -2203,15 +2088,14 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
2203
2088
|
|
|
2204
2089
|
> **withPackage**(`producer`): `Promise`\<`void`\>
|
|
2205
2090
|
|
|
2206
|
-
Defined in:
|
|
2207
|
-
[libraries/epub/index.ts:836](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L836)
|
|
2091
|
+
Defined in: [libraries/epub/index.ts:846](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L846)
|
|
2208
2092
|
|
|
2209
2093
|
Safely modify the package document, without race conditions.
|
|
2210
2094
|
|
|
2211
|
-
Since the reading the package document is an async process,
|
|
2212
|
-
simultaneously dispatched function calls that all
|
|
2213
|
-
clobber each other's changes. This
|
|
2214
|
-
update runs exclusively.
|
|
2095
|
+
Since the reading the package document is an async process,
|
|
2096
|
+
multiple simultaneously dispatched function calls that all
|
|
2097
|
+
attempt to modify it can clobber each other's changes. This
|
|
2098
|
+
method uses a mutex to ensure that each update runs exclusively.
|
|
2215
2099
|
|
|
2216
2100
|
##### Parameters
|
|
2217
2101
|
|
|
@@ -2229,13 +2113,13 @@ update runs exclusively.
|
|
|
2229
2113
|
|
|
2230
2114
|
> **writeItemContents**(`id`, `contents`): `Promise`\<`void`\>
|
|
2231
2115
|
|
|
2232
|
-
Defined in:
|
|
2233
|
-
[libraries/epub/index.ts:3073](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3073)
|
|
2116
|
+
Defined in: [libraries/epub/index.ts:3083](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3083)
|
|
2234
2117
|
|
|
2235
|
-
Write new contents for an existing manifest item,
|
|
2118
|
+
Write new contents for an existing manifest item,
|
|
2119
|
+
specified by its id.
|
|
2236
2120
|
|
|
2237
|
-
The id must reference an existing manifest item. If
|
|
2238
|
-
`epub.addManifestItem()` instead.
|
|
2121
|
+
The id must reference an existing manifest item. If
|
|
2122
|
+
creating a new item, use `epub.addManifestItem()` instead.
|
|
2239
2123
|
|
|
2240
2124
|
###### Parameters
|
|
2241
2125
|
|
|
@@ -2256,13 +2140,13 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
2256
2140
|
|
|
2257
2141
|
> **writeItemContents**(`id`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
2258
2142
|
|
|
2259
|
-
Defined in:
|
|
2260
|
-
[libraries/epub/index.ts:3074](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3074)
|
|
2143
|
+
Defined in: [libraries/epub/index.ts:3084](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3084)
|
|
2261
2144
|
|
|
2262
|
-
Write new contents for an existing manifest item,
|
|
2145
|
+
Write new contents for an existing manifest item,
|
|
2146
|
+
specified by its id.
|
|
2263
2147
|
|
|
2264
|
-
The id must reference an existing manifest item. If
|
|
2265
|
-
`epub.addManifestItem()` instead.
|
|
2148
|
+
The id must reference an existing manifest item. If
|
|
2149
|
+
creating a new item, use `epub.addManifestItem()` instead.
|
|
2266
2150
|
|
|
2267
2151
|
###### Parameters
|
|
2268
2152
|
|
|
@@ -2284,13 +2168,13 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
2284
2168
|
|
|
2285
2169
|
> **writeXhtmlItemContents**(`id`, `contents`): `Promise`\<`void`\>
|
|
2286
2170
|
|
|
2287
|
-
Defined in:
|
|
2288
|
-
[libraries/epub/index.ts:3113](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3113)
|
|
2171
|
+
Defined in: [libraries/epub/index.ts:3123](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3123)
|
|
2289
2172
|
|
|
2290
|
-
Write new contents for an existing XHTML item,
|
|
2173
|
+
Write new contents for an existing XHTML item,
|
|
2174
|
+
specified by its id.
|
|
2291
2175
|
|
|
2292
|
-
The id must reference an existing manifest item. If
|
|
2293
|
-
`epub.addManifestItem()` instead.
|
|
2176
|
+
The id must reference an existing manifest item. If
|
|
2177
|
+
creating a new item, use `epub.addManifestItem()` instead.
|
|
2294
2178
|
|
|
2295
2179
|
##### Parameters
|
|
2296
2180
|
|
|
@@ -2311,11 +2195,10 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
|
2311
2195
|
|
|
2312
2196
|
> `static` **addLinkToXhtmlHead**(`xml`, `link`): `void`
|
|
2313
2197
|
|
|
2314
|
-
Defined in:
|
|
2315
|
-
[libraries/epub/index.ts:424](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L424)
|
|
2198
|
+
Defined in: [libraries/epub/index.ts:434](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L434)
|
|
2316
2199
|
|
|
2317
|
-
Given an XML structure representing a complete XHTML document,
|
|
2318
|
-
element to the `head` of the document.
|
|
2200
|
+
Given an XML structure representing a complete XHTML document,
|
|
2201
|
+
add a `link` element to the `head` of the document.
|
|
2319
2202
|
|
|
2320
2203
|
This method modifies the provided XML structure.
|
|
2321
2204
|
|
|
@@ -2337,8 +2220,7 @@ This method modifies the provided XML structure.
|
|
|
2337
2220
|
|
|
2338
2221
|
> `static` **assertEpub3**(`epub`): `Promise`\<`void`\>
|
|
2339
2222
|
|
|
2340
|
-
Defined in:
|
|
2341
|
-
[libraries/epub/index.ts:699](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L699)
|
|
2223
|
+
Defined in: [libraries/epub/index.ts:709](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L709)
|
|
2342
2224
|
|
|
2343
2225
|
##### Parameters
|
|
2344
2226
|
|
|
@@ -2352,14 +2234,13 @@ Defined in:
|
|
|
2352
2234
|
|
|
2353
2235
|
#### create()
|
|
2354
2236
|
|
|
2355
|
-
> `static` **create**(`path`, `dublinCore`, `additionalMetadata`):
|
|
2356
|
-
> `Promise`\<[`Epub`](#epub)\>
|
|
2237
|
+
> `static` **create**(`path`, `dublinCore`, `additionalMetadata`): `Promise`\<[`Epub`](#epub)\>
|
|
2357
2238
|
|
|
2358
|
-
Defined in:
|
|
2359
|
-
[libraries/epub/index.ts:647](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L647)
|
|
2239
|
+
Defined in: [libraries/epub/index.ts:657](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L657)
|
|
2360
2240
|
|
|
2361
|
-
Construct a new EPUB on a writable backend, optionally seeded
|
|
2362
|
-
metadata. Equivalent to
|
|
2241
|
+
Construct a new EPUB on a writable backend, optionally seeded
|
|
2242
|
+
with the provided metadata. Equivalent to
|
|
2243
|
+
`Epub.using(TmpFsAdapter).create(...)`.
|
|
2363
2244
|
|
|
2364
2245
|
##### Parameters
|
|
2365
2246
|
|
|
@@ -2375,11 +2256,9 @@ metadata. Equivalent to `Epub.using(TmpFsAdapter).create(...)`.
|
|
|
2375
2256
|
|
|
2376
2257
|
#### createXmlElement()
|
|
2377
2258
|
|
|
2378
|
-
> `static` **createXmlElement**\<`Name`\>(`name`, `properties`, `children`):
|
|
2379
|
-
> [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2259
|
+
> `static` **createXmlElement**\<`Name`\>(`name`, `properties`, `children`): [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2380
2260
|
|
|
2381
|
-
Defined in:
|
|
2382
|
-
[libraries/epub/index.ts:459](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L459)
|
|
2261
|
+
Defined in: [libraries/epub/index.ts:469](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L469)
|
|
2383
2262
|
|
|
2384
2263
|
##### Type Parameters
|
|
2385
2264
|
|
|
@@ -2403,8 +2282,7 @@ Defined in:
|
|
|
2403
2282
|
|
|
2404
2283
|
> `static` **createXmlTextNode**(`text`): [`XmlTextNode`](#xmltextnode)
|
|
2405
2284
|
|
|
2406
|
-
Defined in:
|
|
2407
|
-
[libraries/epub/index.ts:472](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L472)
|
|
2285
|
+
Defined in: [libraries/epub/index.ts:482](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L482)
|
|
2408
2286
|
|
|
2409
2287
|
##### Parameters
|
|
2410
2288
|
|
|
@@ -2418,14 +2296,12 @@ Defined in:
|
|
|
2418
2296
|
|
|
2419
2297
|
#### findXmlChildByName()
|
|
2420
2298
|
|
|
2421
|
-
> `static` **findXmlChildByName**\<`Name`\>(`name`, `xml`, `filter?`):
|
|
2422
|
-
> `undefined` \| [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2299
|
+
> `static` **findXmlChildByName**\<`Name`\>(`name`, `xml`, `filter?`): [`XmlElement`](#xmlelement)\<`Name`\> \| `undefined`
|
|
2423
2300
|
|
|
2424
|
-
Defined in:
|
|
2425
|
-
[libraries/epub/index.ts:545](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L545)
|
|
2301
|
+
Defined in: [libraries/epub/index.ts:555](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L555)
|
|
2426
2302
|
|
|
2427
|
-
Given an XML structure, find the first child matching
|
|
2428
|
-
optional filter.
|
|
2303
|
+
Given an XML structure, find the first child matching
|
|
2304
|
+
the provided name and optional filter.
|
|
2429
2305
|
|
|
2430
2306
|
##### Type Parameters
|
|
2431
2307
|
|
|
@@ -2443,21 +2319,19 @@ optional filter.
|
|
|
2443
2319
|
|
|
2444
2320
|
##### Returns
|
|
2445
2321
|
|
|
2446
|
-
|
|
2322
|
+
[`XmlElement`](#xmlelement)\<`Name`\> \| `undefined`
|
|
2447
2323
|
|
|
2448
2324
|
#### findXmlDescendantByName()
|
|
2449
2325
|
|
|
2450
|
-
> `static` **findXmlDescendantByName**\<`Name`\>(`name`, `xml`, `filter?`):
|
|
2451
|
-
> `undefined` \| [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2326
|
+
> `static` **findXmlDescendantByName**\<`Name`\>(`name`, `xml`, `filter?`): [`XmlElement`](#xmlelement)\<`Name`\> \| `undefined`
|
|
2452
2327
|
|
|
2453
|
-
Defined in:
|
|
2454
|
-
[libraries/epub/index.ts:563](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L563)
|
|
2328
|
+
Defined in: [libraries/epub/index.ts:573](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L573)
|
|
2455
2329
|
|
|
2456
|
-
Given an XML structure, find the first descendant matching
|
|
2457
|
-
optional filter.
|
|
2330
|
+
Given an XML structure, find the first descendant matching
|
|
2331
|
+
the provided name and optional filter.
|
|
2458
2332
|
|
|
2459
|
-
Will perform a breadth first search for the element, returning
|
|
2460
|
-
element in the tree matching the name and filter.
|
|
2333
|
+
Will perform a breadth first search for the element, returning
|
|
2334
|
+
the highest element in the tree matching the name and filter.
|
|
2461
2335
|
|
|
2462
2336
|
##### Type Parameters
|
|
2463
2337
|
|
|
@@ -2475,17 +2349,16 @@ element in the tree matching the name and filter.
|
|
|
2475
2349
|
|
|
2476
2350
|
##### Returns
|
|
2477
2351
|
|
|
2478
|
-
|
|
2352
|
+
[`XmlElement`](#xmlelement)\<`Name`\> \| `undefined`
|
|
2479
2353
|
|
|
2480
2354
|
#### formatSmilDuration()
|
|
2481
2355
|
|
|
2482
2356
|
> `static` **formatSmilDuration**(`duration`): `string`
|
|
2483
2357
|
|
|
2484
|
-
Defined in:
|
|
2485
|
-
[libraries/epub/index.ts:407](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L407)
|
|
2358
|
+
Defined in: [libraries/epub/index.ts:417](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L417)
|
|
2486
2359
|
|
|
2487
|
-
Format a duration, provided as a number of seconds, as
|
|
2488
|
-
used for Media Overlays.
|
|
2360
|
+
Format a duration, provided as a number of seconds, as
|
|
2361
|
+
a SMIL clock value, to be used for Media Overlays.
|
|
2489
2362
|
|
|
2490
2363
|
##### Parameters
|
|
2491
2364
|
|
|
@@ -2507,11 +2380,10 @@ https://www.w3.org/TR/epub-33/#sec-duration
|
|
|
2507
2380
|
|
|
2508
2381
|
> `static` **from**(`pathOrData`): `Promise`\<[`Epub`](#epub)\>
|
|
2509
2382
|
|
|
2510
|
-
Defined in:
|
|
2511
|
-
[libraries/epub/index.ts:683](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L683)
|
|
2383
|
+
Defined in: [libraries/epub/index.ts:693](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L693)
|
|
2512
2384
|
|
|
2513
|
-
Open an existing EPUB publication, extracting it to a temp directory
|
|
2514
|
-
can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
2385
|
+
Open an existing EPUB publication, extracting it to a temp directory
|
|
2386
|
+
so writes can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
2515
2387
|
|
|
2516
2388
|
Pass `{ readonly: true }` to gate mutations at runtime.
|
|
2517
2389
|
|
|
@@ -2534,14 +2406,12 @@ when the archive is not a valid EPUB 3
|
|
|
2534
2406
|
|
|
2535
2407
|
##### Call Signature
|
|
2536
2408
|
|
|
2537
|
-
> `static` **from**(`pathOrData`, `options`):
|
|
2538
|
-
> `Promise`\<[`EpubReader`](#epubreader)\>
|
|
2409
|
+
> `static` **from**(`pathOrData`, `options`): `Promise`\<[`EpubReader`](#epubreader)\>
|
|
2539
2410
|
|
|
2540
|
-
Defined in:
|
|
2541
|
-
[libraries/epub/index.ts:684](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L684)
|
|
2411
|
+
Defined in: [libraries/epub/index.ts:694](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L694)
|
|
2542
2412
|
|
|
2543
|
-
Open an existing EPUB publication, extracting it to a temp directory
|
|
2544
|
-
can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
2413
|
+
Open an existing EPUB publication, extracting it to a temp directory
|
|
2414
|
+
so writes can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
2545
2415
|
|
|
2546
2416
|
Pass `{ readonly: true }` to gate mutations at runtime.
|
|
2547
2417
|
|
|
@@ -2565,14 +2435,12 @@ when the archive is not a valid EPUB 3
|
|
|
2565
2435
|
|
|
2566
2436
|
##### Call Signature
|
|
2567
2437
|
|
|
2568
|
-
> `static` **from**(`pathOrData`, `options?`): `Promise`\<[`Epub`](#epub) \|
|
|
2569
|
-
> [`EpubReader`](#epubreader)\>
|
|
2438
|
+
> `static` **from**(`pathOrData`, `options?`): `Promise`\<[`Epub`](#epub) \| [`EpubReader`](#epubreader)\>
|
|
2570
2439
|
|
|
2571
|
-
Defined in:
|
|
2572
|
-
[libraries/epub/index.ts:688](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L688)
|
|
2440
|
+
Defined in: [libraries/epub/index.ts:698](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L698)
|
|
2573
2441
|
|
|
2574
|
-
Open an existing EPUB publication, extracting it to a temp directory
|
|
2575
|
-
can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
2442
|
+
Open an existing EPUB publication, extracting it to a temp directory
|
|
2443
|
+
so writes can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
2576
2444
|
|
|
2577
2445
|
Pass `{ readonly: true }` to gate mutations at runtime.
|
|
2578
2446
|
|
|
@@ -2598,11 +2466,11 @@ when the archive is not a valid EPUB 3
|
|
|
2598
2466
|
|
|
2599
2467
|
> `static` **getXhtmlBody**(`xml`): [`ParsedXml`](#parsedxml)
|
|
2600
2468
|
|
|
2601
|
-
Defined in:
|
|
2602
|
-
[libraries/epub/index.ts:449](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L449)
|
|
2469
|
+
Defined in: [libraries/epub/index.ts:459](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L459)
|
|
2603
2470
|
|
|
2604
|
-
Given an XML structure representing a complete XHTML document,
|
|
2605
|
-
sub-structure representing the children of the
|
|
2471
|
+
Given an XML structure representing a complete XHTML document,
|
|
2472
|
+
return the sub-structure representing the children of the
|
|
2473
|
+
document's body element.
|
|
2606
2474
|
|
|
2607
2475
|
##### Parameters
|
|
2608
2476
|
|
|
@@ -2618,11 +2486,11 @@ sub-structure representing the children of the document's body element.
|
|
|
2618
2486
|
|
|
2619
2487
|
> `static` **getXhtmlTextContent**(`xml`): `string`
|
|
2620
2488
|
|
|
2621
|
-
Defined in:
|
|
2622
|
-
[libraries/epub/index.ts:481](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L481)
|
|
2489
|
+
Defined in: [libraries/epub/index.ts:491](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L491)
|
|
2623
2490
|
|
|
2624
|
-
Given an XML structure representing a complete XHTML document,
|
|
2625
|
-
representing the concatenation of all text nodes
|
|
2491
|
+
Given an XML structure representing a complete XHTML document,
|
|
2492
|
+
return a string representing the concatenation of all text nodes
|
|
2493
|
+
in the document.
|
|
2626
2494
|
|
|
2627
2495
|
##### Parameters
|
|
2628
2496
|
|
|
@@ -2638,8 +2506,7 @@ representing the concatenation of all text nodes in the document.
|
|
|
2638
2506
|
|
|
2639
2507
|
> `static` **getXmlAttributes**(`element`): `Record`\<`string`, `string`\>
|
|
2640
2508
|
|
|
2641
|
-
Defined in:
|
|
2642
|
-
[libraries/epub/index.ts:498](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L498)
|
|
2509
|
+
Defined in: [libraries/epub/index.ts:508](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L508)
|
|
2643
2510
|
|
|
2644
2511
|
Given an XMLElement, return its attributes.
|
|
2645
2512
|
|
|
@@ -2657,8 +2524,7 @@ Given an XMLElement, return its attributes.
|
|
|
2657
2524
|
|
|
2658
2525
|
> `static` **getXmlChildren**\<`Name`\>(`element`): [`ParsedXml`](#parsedxml)
|
|
2659
2526
|
|
|
2660
|
-
Defined in:
|
|
2661
|
-
[libraries/epub/index.ts:525](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L525)
|
|
2527
|
+
Defined in: [libraries/epub/index.ts:535](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L535)
|
|
2662
2528
|
|
|
2663
2529
|
Given an XMLElement, return a list of its children
|
|
2664
2530
|
|
|
@@ -2682,8 +2548,7 @@ Given an XMLElement, return a list of its children
|
|
|
2682
2548
|
|
|
2683
2549
|
> `static` **getXmlElementName**\<`Name`\>(`element`): `Name`
|
|
2684
2550
|
|
|
2685
|
-
Defined in:
|
|
2686
|
-
[libraries/epub/index.ts:510](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L510)
|
|
2551
|
+
Defined in: [libraries/epub/index.ts:520](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L520)
|
|
2687
2552
|
|
|
2688
2553
|
Given an XMLElement, return its tag name.
|
|
2689
2554
|
|
|
@@ -2707,10 +2572,10 @@ Given an XMLElement, return its tag name.
|
|
|
2707
2572
|
|
|
2708
2573
|
> `static` **isXmlTextNode**(`node`): `node is XmlTextNode`
|
|
2709
2574
|
|
|
2710
|
-
Defined in:
|
|
2711
|
-
[libraries/epub/index.ts:585](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L585)
|
|
2575
|
+
Defined in: [libraries/epub/index.ts:595](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L595)
|
|
2712
2576
|
|
|
2713
|
-
Given an XMLNode, determine whether it represents
|
|
2577
|
+
Given an XMLNode, determine whether it represents
|
|
2578
|
+
a text node or an XML element.
|
|
2714
2579
|
|
|
2715
2580
|
##### Parameters
|
|
2716
2581
|
|
|
@@ -2726,8 +2591,7 @@ Given an XMLNode, determine whether it represents a text node or an XML element.
|
|
|
2726
2591
|
|
|
2727
2592
|
> `static` **replaceXmlChildren**\<`Name`\>(`element`, `children`): `void`
|
|
2728
2593
|
|
|
2729
|
-
Defined in:
|
|
2730
|
-
[libraries/epub/index.ts:533](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L533)
|
|
2594
|
+
Defined in: [libraries/epub/index.ts:543](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L543)
|
|
2731
2595
|
|
|
2732
2596
|
##### Type Parameters
|
|
2733
2597
|
|
|
@@ -2750,11 +2614,11 @@ Defined in:
|
|
|
2750
2614
|
|
|
2751
2615
|
> `static` **upgrade**(`path`, `options`): `Promise`\<[`Epub`](#epub)\>
|
|
2752
2616
|
|
|
2753
|
-
Defined in:
|
|
2754
|
-
[libraries/epub/index.ts:3570](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3570)
|
|
2617
|
+
Defined in: [libraries/epub/index.ts:3576](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3576)
|
|
2755
2618
|
|
|
2756
|
-
Upgrade an EPUB 2 publication to EPUB 3 in place, returning a new,
|
|
2757
|
-
instance. Equivalent to
|
|
2619
|
+
Upgrade an EPUB 2 publication to EPUB 3 in place, returning a new,
|
|
2620
|
+
valid Epub 3 instance. Equivalent to
|
|
2621
|
+
`Epub.using(TmpFsAdapter).upgrade(...)`.
|
|
2758
2622
|
|
|
2759
2623
|
##### Parameters
|
|
2760
2624
|
|
|
@@ -2769,16 +2633,14 @@ instance. Equivalent to `Epub.using(TmpFsAdapter).upgrade(...)`.
|
|
|
2769
2633
|
|
|
2770
2634
|
#### using()
|
|
2771
2635
|
|
|
2772
|
-
> `static` **using**\<`A`\>(`adapterClass`):
|
|
2773
|
-
> [`EpubFactory`](#epubfactory)\<`A`\>
|
|
2636
|
+
> `static` **using**\<`A`\>(`adapterClass`): [`EpubFactory`](#epubfactory)\<`A`\>
|
|
2774
2637
|
|
|
2775
|
-
Defined in:
|
|
2776
|
-
[libraries/epub/index.ts:667](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L667)
|
|
2638
|
+
Defined in: [libraries/epub/index.ts:677](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L677)
|
|
2777
2639
|
|
|
2778
2640
|
Specify the storage backend to use for the EPUB
|
|
2779
2641
|
|
|
2780
|
-
The returned factory exposes `from`, `create`, and `upgrade`,
|
|
2781
|
-
through the supplied adapter.
|
|
2642
|
+
The returned factory exposes `from`, `create`, and `upgrade`,
|
|
2643
|
+
which route through the supplied adapter.
|
|
2782
2644
|
|
|
2783
2645
|
##### Type Parameters
|
|
2784
2646
|
|
|
@@ -2799,23 +2661,22 @@ through the supplied adapter.
|
|
|
2799
2661
|
##### Example
|
|
2800
2662
|
|
|
2801
2663
|
```ts
|
|
2802
|
-
using epub = await Epub.using(TmpFsAdapter).from(path)
|
|
2803
|
-
using reader = await Epub.using(MemoryAdapter).from(buffer, { cache: false })
|
|
2664
|
+
using epub = await Epub.using(TmpFsAdapter).from(path);
|
|
2665
|
+
using reader = await Epub.using(MemoryAdapter).from(buffer, { cache: false });
|
|
2804
2666
|
```
|
|
2805
2667
|
|
|
2806
2668
|
---
|
|
2807
2669
|
|
|
2808
2670
|
## EpubFactory\<A\>
|
|
2809
2671
|
|
|
2810
|
-
Defined in:
|
|
2811
|
-
[libraries/epub/index.ts:3599](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3599)
|
|
2672
|
+
Defined in: [libraries/epub/index.ts:3605](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3605)
|
|
2812
2673
|
|
|
2813
2674
|
Adapter-bound factory returned by [Epub.using](#using).
|
|
2814
2675
|
|
|
2815
|
-
Mirrors the static factory surface (`from`, `create`, `upgrade`) but routes
|
|
2816
|
-
I/O through the supplied adapter. Each method's signature degrades
|
|
2817
|
-
when the adapter doesn't support the operation: `create` and
|
|
2818
|
-
runtime if the adapter is read-only or lacks `initEmpty`.
|
|
2676
|
+
Mirrors the static factory surface (`from`, `create`, `upgrade`) but routes
|
|
2677
|
+
all I/O through the supplied adapter. Each method's signature degrades
|
|
2678
|
+
gracefully when the adapter doesn't support the operation: `create` and
|
|
2679
|
+
`upgrade` throw at runtime if the adapter is read-only or lacks `initEmpty`.
|
|
2819
2680
|
|
|
2820
2681
|
### Type Parameters
|
|
2821
2682
|
|
|
@@ -2827,11 +2688,9 @@ runtime if the adapter is read-only or lacks `initEmpty`.
|
|
|
2827
2688
|
|
|
2828
2689
|
#### Constructor
|
|
2829
2690
|
|
|
2830
|
-
> **new EpubFactory**\<`A`\>(`adapterClass`):
|
|
2831
|
-
> [`EpubFactory`](#epubfactory)\<`A`\>
|
|
2691
|
+
> **new EpubFactory**\<`A`\>(`adapterClass`): [`EpubFactory`](#epubfactory)\<`A`\>
|
|
2832
2692
|
|
|
2833
|
-
Defined in:
|
|
2834
|
-
[libraries/epub/index.ts:3600](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3600)
|
|
2693
|
+
Defined in: [libraries/epub/index.ts:3606](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3606)
|
|
2835
2694
|
|
|
2836
2695
|
##### Parameters
|
|
2837
2696
|
|
|
@@ -2849,22 +2708,19 @@ Defined in:
|
|
|
2849
2708
|
|
|
2850
2709
|
> `readonly` **adapterClass**: `A`
|
|
2851
2710
|
|
|
2852
|
-
Defined in:
|
|
2853
|
-
[libraries/epub/index.ts:3600](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3600)
|
|
2711
|
+
Defined in: [libraries/epub/index.ts:3606](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3606)
|
|
2854
2712
|
|
|
2855
2713
|
### Methods
|
|
2856
2714
|
|
|
2857
2715
|
#### create()
|
|
2858
2716
|
|
|
2859
|
-
> **create**(`path`, `__namedParameters`, `additionalMetadata`):
|
|
2860
|
-
> `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\>\>
|
|
2717
|
+
> **create**(`path`, `__namedParameters`, `additionalMetadata`): `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\>\>
|
|
2861
2718
|
|
|
2862
|
-
Defined in:
|
|
2863
|
-
[libraries/epub/index.ts:3661](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3661)
|
|
2719
|
+
Defined in: [libraries/epub/index.ts:3667](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3667)
|
|
2864
2720
|
|
|
2865
|
-
Construct a new EPUB on this factory's adapter, optionally seeded
|
|
2866
|
-
provided metadata. Requires a writable adapter that
|
|
2867
|
-
(today: [TmpFsAdapter](#tmpfsadapter)).
|
|
2721
|
+
Construct a new EPUB on this factory's adapter, optionally seeded
|
|
2722
|
+
with the provided metadata. Requires a writable adapter that
|
|
2723
|
+
implements `initEmpty` (today: [TmpFsAdapter](#tmpfsadapter)).
|
|
2868
2724
|
|
|
2869
2725
|
##### Parameters
|
|
2870
2726
|
|
|
@@ -2886,24 +2742,9 @@ when the adapter is read-only or does not implement initEmpty
|
|
|
2886
2742
|
|
|
2887
2743
|
##### Call Signature
|
|
2888
2744
|
|
|
2889
|
-
> **from**(`source`, `options`): `Promise`\<`Pick`\<[`Epub`](#epub), `"storage"`
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
> `"getMetadata"` \| `"getIdentifier"` \| `"getUniqueIdentifier"` \|
|
|
2893
|
-
> `"getUniqueIdentifierId"` \| `"getIdentifiers"` \| `"getSources"` \|
|
|
2894
|
-
> `"getPageBreakSource"` \| `"getCoverImageItem"` \| `"getCoverImage"` \|
|
|
2895
|
-
> `"getPublicationDate"` \| `"getModifiedDate"` \| `"getLayout"` \|
|
|
2896
|
-
> `"getBaseDirection"` \| `"getType"` \| `"getSubjects"` \| `"getLanguage"` \|
|
|
2897
|
-
> `"getTitle"` \| `"getSubtitle"` \| `"getTitles"` \| `"getDescription"` \|
|
|
2898
|
-
> `"getPackageVocabularyPrefixes"` \| `"getCollections"` \| `"getCreators"` \|
|
|
2899
|
-
> `"getContributors"` \| `"getSpineItems"` \| `"getTableOfContents"` \|
|
|
2900
|
-
> `"getLandmarks"` \| `"getPageList"` \| `"resolveHref"` \| `"readFileContents"`
|
|
2901
|
-
> \| `"readItemContents"` \| `"readXhtmlItemContents"` \| `"getVersion"` \|
|
|
2902
|
-
> `"getNcxTableOfContents"` \| `"getGuideEntries"` \| `"discardAndClose"`\> &
|
|
2903
|
-
> `Disposable` & `object`\>
|
|
2904
|
-
|
|
2905
|
-
Defined in:
|
|
2906
|
-
[libraries/epub/index.ts:3607](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3607)
|
|
2745
|
+
> **from**(`source`, `options`): `Promise`\<`Pick`\<[`Epub`](#epub), `"storage"` \| `"getItemArchiveLength"` \| `"getRootfile"` \| `"getPackageElement"` \| `"getManifest"` \| `"findMetadataItem"` \| `"findAllMetadataItems"` \| `"getMetadata"` \| `"getIdentifier"` \| `"getUniqueIdentifier"` \| `"getUniqueIdentifierId"` \| `"getIdentifiers"` \| `"getSources"` \| `"getPageBreakSource"` \| `"getCoverImageItem"` \| `"getCoverImage"` \| `"getPublicationDate"` \| `"getModifiedDate"` \| `"getLayout"` \| `"getBaseDirection"` \| `"getType"` \| `"getSubjects"` \| `"getLanguage"` \| `"getTitle"` \| `"getSubtitle"` \| `"getTitles"` \| `"getDescription"` \| `"getPackageVocabularyPrefixes"` \| `"getCollections"` \| `"getCreators"` \| `"getContributors"` \| `"getSpineItems"` \| `"getTableOfContents"` \| `"getLandmarks"` \| `"getPageList"` \| `"resolveHref"` \| `"readFileContents"` \| `"readItemContents"` \| `"readXhtmlItemContents"` \| `"getVersion"` \| `"getNcxTableOfContents"` \| `"getGuideEntries"` \| `"discardAndClose"`\> & `Disposable` & `object`\>
|
|
2746
|
+
|
|
2747
|
+
Defined in: [libraries/epub/index.ts:3613](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3613)
|
|
2907
2748
|
|
|
2908
2749
|
Open an existing EPUB through this factory's adapter
|
|
2909
2750
|
|
|
@@ -2916,21 +2757,7 @@ Open an existing EPUB through this factory's adapter
|
|
|
2916
2757
|
|
|
2917
2758
|
###### Returns
|
|
2918
2759
|
|
|
2919
|
-
`Promise`\<`Pick`\<[`Epub`](#epub), `"storage"` \| `"getItemArchiveLength"` \|
|
|
2920
|
-
`"getRootfile"` \| `"getPackageElement"` \| `"getManifest"` \|
|
|
2921
|
-
`"findMetadataItem"` \| `"findAllMetadataItems"` \| `"getMetadata"` \|
|
|
2922
|
-
`"getIdentifier"` \| `"getUniqueIdentifier"` \| `"getUniqueIdentifierId"` \|
|
|
2923
|
-
`"getIdentifiers"` \| `"getSources"` \| `"getPageBreakSource"` \|
|
|
2924
|
-
`"getCoverImageItem"` \| `"getCoverImage"` \| `"getPublicationDate"` \|
|
|
2925
|
-
`"getModifiedDate"` \| `"getLayout"` \| `"getBaseDirection"` \| `"getType"` \|
|
|
2926
|
-
`"getSubjects"` \| `"getLanguage"` \| `"getTitle"` \| `"getSubtitle"` \|
|
|
2927
|
-
`"getTitles"` \| `"getDescription"` \| `"getPackageVocabularyPrefixes"` \|
|
|
2928
|
-
`"getCollections"` \| `"getCreators"` \| `"getContributors"` \|
|
|
2929
|
-
`"getSpineItems"` \| `"getTableOfContents"` \| `"getLandmarks"` \|
|
|
2930
|
-
`"getPageList"` \| `"resolveHref"` \| `"readFileContents"` \|
|
|
2931
|
-
`"readItemContents"` \| `"readXhtmlItemContents"` \| `"getVersion"` \|
|
|
2932
|
-
`"getNcxTableOfContents"` \| `"getGuideEntries"` \| `"discardAndClose"`\> &
|
|
2933
|
-
`Disposable` & `object`\>
|
|
2760
|
+
`Promise`\<`Pick`\<[`Epub`](#epub), `"storage"` \| `"getItemArchiveLength"` \| `"getRootfile"` \| `"getPackageElement"` \| `"getManifest"` \| `"findMetadataItem"` \| `"findAllMetadataItems"` \| `"getMetadata"` \| `"getIdentifier"` \| `"getUniqueIdentifier"` \| `"getUniqueIdentifierId"` \| `"getIdentifiers"` \| `"getSources"` \| `"getPageBreakSource"` \| `"getCoverImageItem"` \| `"getCoverImage"` \| `"getPublicationDate"` \| `"getModifiedDate"` \| `"getLayout"` \| `"getBaseDirection"` \| `"getType"` \| `"getSubjects"` \| `"getLanguage"` \| `"getTitle"` \| `"getSubtitle"` \| `"getTitles"` \| `"getDescription"` \| `"getPackageVocabularyPrefixes"` \| `"getCollections"` \| `"getCreators"` \| `"getContributors"` \| `"getSpineItems"` \| `"getTableOfContents"` \| `"getLandmarks"` \| `"getPageList"` \| `"resolveHref"` \| `"readFileContents"` \| `"readItemContents"` \| `"readXhtmlItemContents"` \| `"getVersion"` \| `"getNcxTableOfContents"` \| `"getGuideEntries"` \| `"discardAndClose"`\> & `Disposable` & `object`\>
|
|
2934
2761
|
|
|
2935
2762
|
###### Throws
|
|
2936
2763
|
|
|
@@ -2938,11 +2765,9 @@ when the archive is not a valid EPUB 3
|
|
|
2938
2765
|
|
|
2939
2766
|
##### Call Signature
|
|
2940
2767
|
|
|
2941
|
-
> **from**(`source`, `options?`):
|
|
2942
|
-
> `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\> & `object`\>
|
|
2768
|
+
> **from**(`source`, `options?`): `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\> & `object`\>
|
|
2943
2769
|
|
|
2944
|
-
Defined in:
|
|
2945
|
-
[libraries/epub/index.ts:3611](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3611)
|
|
2770
|
+
Defined in: [libraries/epub/index.ts:3617](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3617)
|
|
2946
2771
|
|
|
2947
2772
|
Open an existing EPUB through this factory's adapter
|
|
2948
2773
|
|
|
@@ -2963,14 +2788,12 @@ when the archive is not a valid EPUB 3
|
|
|
2963
2788
|
|
|
2964
2789
|
#### upgrade()
|
|
2965
2790
|
|
|
2966
|
-
> **upgrade**(`path`, `options`):
|
|
2967
|
-
> `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\>\>
|
|
2791
|
+
> **upgrade**(`path`, `options`): `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\>\>
|
|
2968
2792
|
|
|
2969
|
-
Defined in:
|
|
2970
|
-
[libraries/epub/index.ts:3768](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3768)
|
|
2793
|
+
Defined in: [libraries/epub/index.ts:3774](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3774)
|
|
2971
2794
|
|
|
2972
|
-
Upgrade an EPUB 2 publication to EPUB 3 in place using this
|
|
2973
|
-
returning a new, valid Epub 3 instance.
|
|
2795
|
+
Upgrade an EPUB 2 publication to EPUB 3 in place using this
|
|
2796
|
+
factory's adapter, returning a new, valid Epub 3 instance.
|
|
2974
2797
|
|
|
2975
2798
|
Performs the following transformations:
|
|
2976
2799
|
|
|
@@ -2980,13 +2803,11 @@ Performs the following transformations:
|
|
|
2980
2803
|
- removes the NCX file and the guide element (configurable)
|
|
2981
2804
|
- fixes common font MIME types
|
|
2982
2805
|
- bumps the package version to 3.0
|
|
2983
|
-
- goes over each xhtml item and rewrites it using XMLParser to make sure the
|
|
2984
|
-
output is valid XHTML
|
|
2806
|
+
- goes over each xhtml item and rewrites it using XMLParser to make sure the output is valid XHTML
|
|
2985
2807
|
|
|
2986
|
-
Requires a writable adapter. When
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
`source` is a real fs path.
|
|
2808
|
+
Requires a writable adapter. When [Upgrade.Epub2UpgradeOptions.outputPath](#outputpath)
|
|
2809
|
+
is set, the source file is copied to that path on disk first; this
|
|
2810
|
+
only makes sense for adapters whose `source` is a real fs path.
|
|
2990
2811
|
|
|
2991
2812
|
##### Parameters
|
|
2992
2813
|
|
|
@@ -3007,8 +2828,7 @@ when the adapter is read-only
|
|
|
3007
2828
|
|
|
3008
2829
|
## EpubReadOnlyError
|
|
3009
2830
|
|
|
3010
|
-
Defined in:
|
|
3011
|
-
[libraries/epub/index.ts:233](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L233)
|
|
2831
|
+
Defined in: [libraries/epub/index.ts:234](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L234)
|
|
3012
2832
|
|
|
3013
2833
|
### Extends
|
|
3014
2834
|
|
|
@@ -3018,10 +2838,9 @@ Defined in:
|
|
|
3018
2838
|
|
|
3019
2839
|
#### Constructor
|
|
3020
2840
|
|
|
3021
|
-
> **new EpubReadOnlyError**(`message?`):
|
|
3022
|
-
> [`EpubReadOnlyError`](#epubreadonlyerror)
|
|
2841
|
+
> **new EpubReadOnlyError**(`message?`): [`EpubReadOnlyError`](#epubreadonlyerror)
|
|
3023
2842
|
|
|
3024
|
-
Defined in: node_modules
|
|
2843
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080
|
|
3025
2844
|
|
|
3026
2845
|
##### Parameters
|
|
3027
2846
|
|
|
@@ -3039,10 +2858,9 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
|
|
|
3039
2858
|
|
|
3040
2859
|
#### Constructor
|
|
3041
2860
|
|
|
3042
|
-
> **new EpubReadOnlyError**(`message?`, `options?`):
|
|
3043
|
-
> [`EpubReadOnlyError`](#epubreadonlyerror)
|
|
2861
|
+
> **new EpubReadOnlyError**(`message?`, `options?`): [`EpubReadOnlyError`](#epubreadonlyerror)
|
|
3044
2862
|
|
|
3045
|
-
Defined in: node_modules
|
|
2863
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080
|
|
3046
2864
|
|
|
3047
2865
|
##### Parameters
|
|
3048
2866
|
|
|
@@ -3065,7 +2883,7 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
|
|
|
3065
2883
|
|
|
3066
2884
|
> `optional` **cause**: `unknown`
|
|
3067
2885
|
|
|
3068
|
-
Defined in: node_modules
|
|
2886
|
+
Defined in: node_modules/@typescript/old/lib/lib.es2022.error.d.ts:24
|
|
3069
2887
|
|
|
3070
2888
|
##### Inherited from
|
|
3071
2889
|
|
|
@@ -3075,7 +2893,7 @@ Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
|
|
|
3075
2893
|
|
|
3076
2894
|
> **message**: `string`
|
|
3077
2895
|
|
|
3078
|
-
Defined in: node_modules
|
|
2896
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1075
|
|
3079
2897
|
|
|
3080
2898
|
##### Inherited from
|
|
3081
2899
|
|
|
@@ -3085,7 +2903,7 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
|
|
|
3085
2903
|
|
|
3086
2904
|
> **name**: `string`
|
|
3087
2905
|
|
|
3088
|
-
Defined in: node_modules
|
|
2906
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1074
|
|
3089
2907
|
|
|
3090
2908
|
##### Inherited from
|
|
3091
2909
|
|
|
@@ -3095,7 +2913,7 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
|
|
|
3095
2913
|
|
|
3096
2914
|
> `optional` **stack**: `string`
|
|
3097
2915
|
|
|
3098
|
-
Defined in: node_modules
|
|
2916
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1076
|
|
3099
2917
|
|
|
3100
2918
|
##### Inherited from
|
|
3101
2919
|
|
|
@@ -3114,8 +2932,8 @@ collected by a stack trace (whether generated by `new Error().stack` or
|
|
|
3114
2932
|
The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
3115
2933
|
will affect any stack trace captured _after_ the value has been changed.
|
|
3116
2934
|
|
|
3117
|
-
If set to a non-number value, or set to a negative number, stack traces will
|
|
3118
|
-
capture any frames.
|
|
2935
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
|
2936
|
+
not capture any frames.
|
|
3119
2937
|
|
|
3120
2938
|
##### Inherited from
|
|
3121
2939
|
|
|
@@ -3129,14 +2947,14 @@ capture any frames.
|
|
|
3129
2947
|
|
|
3130
2948
|
Defined in: node_modules/@types/node/globals.d.ts:52
|
|
3131
2949
|
|
|
3132
|
-
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
3133
|
-
string representing the location in the code at which
|
|
2950
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
2951
|
+
a string representing the location in the code at which
|
|
3134
2952
|
`Error.captureStackTrace()` was called.
|
|
3135
2953
|
|
|
3136
2954
|
```js
|
|
3137
|
-
const myObject = {}
|
|
3138
|
-
Error.captureStackTrace(myObject)
|
|
3139
|
-
myObject.stack // Similar to `new Error().stack`
|
|
2955
|
+
const myObject = {};
|
|
2956
|
+
Error.captureStackTrace(myObject);
|
|
2957
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
3140
2958
|
```
|
|
3141
2959
|
|
|
3142
2960
|
The first line of the trace will be prefixed with
|
|
@@ -3146,31 +2964,31 @@ The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
|
3146
2964
|
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
3147
2965
|
generated stack trace.
|
|
3148
2966
|
|
|
3149
|
-
The `constructorOpt` argument is useful for hiding implementation
|
|
3150
|
-
error generation from the user. For instance:
|
|
2967
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
2968
|
+
details of error generation from the user. For instance:
|
|
3151
2969
|
|
|
3152
2970
|
```js
|
|
3153
2971
|
function a() {
|
|
3154
|
-
b()
|
|
2972
|
+
b();
|
|
3155
2973
|
}
|
|
3156
2974
|
|
|
3157
2975
|
function b() {
|
|
3158
|
-
c()
|
|
2976
|
+
c();
|
|
3159
2977
|
}
|
|
3160
2978
|
|
|
3161
2979
|
function c() {
|
|
3162
2980
|
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
3163
|
-
const { stackTraceLimit } = Error
|
|
3164
|
-
Error.stackTraceLimit = 0
|
|
3165
|
-
const error = new Error()
|
|
3166
|
-
Error.stackTraceLimit = stackTraceLimit
|
|
2981
|
+
const { stackTraceLimit } = Error;
|
|
2982
|
+
Error.stackTraceLimit = 0;
|
|
2983
|
+
const error = new Error();
|
|
2984
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
3167
2985
|
|
|
3168
2986
|
// Capture the stack trace above function b
|
|
3169
|
-
Error.captureStackTrace(error, b) // Neither function c, nor b is included in the stack trace
|
|
3170
|
-
throw error
|
|
2987
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
2988
|
+
throw error;
|
|
3171
2989
|
}
|
|
3172
2990
|
|
|
3173
|
-
a()
|
|
2991
|
+
a();
|
|
3174
2992
|
```
|
|
3175
2993
|
|
|
3176
2994
|
##### Parameters
|
|
@@ -3192,7 +3010,7 @@ a()
|
|
|
3192
3010
|
|
|
3193
3011
|
> `static` **isError**(`error`): `error is Error`
|
|
3194
3012
|
|
|
3195
|
-
Defined in: node_modules
|
|
3013
|
+
Defined in: node_modules/@typescript/old/lib/lib.esnext.error.d.ts:21
|
|
3196
3014
|
|
|
3197
3015
|
Indicates whether the argument provided is a built-in Error instance or not.
|
|
3198
3016
|
|
|
@@ -3239,8 +3057,7 @@ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
|
3239
3057
|
|
|
3240
3058
|
## EpubVersionError
|
|
3241
3059
|
|
|
3242
|
-
Defined in:
|
|
3243
|
-
[libraries/epub/index.ts:232](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L232)
|
|
3060
|
+
Defined in: [libraries/epub/index.ts:233](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L233)
|
|
3244
3061
|
|
|
3245
3062
|
### Extends
|
|
3246
3063
|
|
|
@@ -3252,7 +3069,7 @@ Defined in:
|
|
|
3252
3069
|
|
|
3253
3070
|
> **new EpubVersionError**(`message?`): [`EpubVersionError`](#epubversionerror)
|
|
3254
3071
|
|
|
3255
|
-
Defined in: node_modules
|
|
3072
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080
|
|
3256
3073
|
|
|
3257
3074
|
##### Parameters
|
|
3258
3075
|
|
|
@@ -3270,10 +3087,9 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
|
|
|
3270
3087
|
|
|
3271
3088
|
#### Constructor
|
|
3272
3089
|
|
|
3273
|
-
> **new EpubVersionError**(`message?`, `options?`):
|
|
3274
|
-
> [`EpubVersionError`](#epubversionerror)
|
|
3090
|
+
> **new EpubVersionError**(`message?`, `options?`): [`EpubVersionError`](#epubversionerror)
|
|
3275
3091
|
|
|
3276
|
-
Defined in: node_modules
|
|
3092
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080
|
|
3277
3093
|
|
|
3278
3094
|
##### Parameters
|
|
3279
3095
|
|
|
@@ -3296,7 +3112,7 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
|
|
|
3296
3112
|
|
|
3297
3113
|
> `optional` **cause**: `unknown`
|
|
3298
3114
|
|
|
3299
|
-
Defined in: node_modules
|
|
3115
|
+
Defined in: node_modules/@typescript/old/lib/lib.es2022.error.d.ts:24
|
|
3300
3116
|
|
|
3301
3117
|
##### Inherited from
|
|
3302
3118
|
|
|
@@ -3306,7 +3122,7 @@ Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
|
|
|
3306
3122
|
|
|
3307
3123
|
> **message**: `string`
|
|
3308
3124
|
|
|
3309
|
-
Defined in: node_modules
|
|
3125
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1075
|
|
3310
3126
|
|
|
3311
3127
|
##### Inherited from
|
|
3312
3128
|
|
|
@@ -3316,7 +3132,7 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
|
|
|
3316
3132
|
|
|
3317
3133
|
> **name**: `string`
|
|
3318
3134
|
|
|
3319
|
-
Defined in: node_modules
|
|
3135
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1074
|
|
3320
3136
|
|
|
3321
3137
|
##### Inherited from
|
|
3322
3138
|
|
|
@@ -3326,7 +3142,7 @@ Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
|
|
|
3326
3142
|
|
|
3327
3143
|
> `optional` **stack**: `string`
|
|
3328
3144
|
|
|
3329
|
-
Defined in: node_modules
|
|
3145
|
+
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1076
|
|
3330
3146
|
|
|
3331
3147
|
##### Inherited from
|
|
3332
3148
|
|
|
@@ -3345,8 +3161,8 @@ collected by a stack trace (whether generated by `new Error().stack` or
|
|
|
3345
3161
|
The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
3346
3162
|
will affect any stack trace captured _after_ the value has been changed.
|
|
3347
3163
|
|
|
3348
|
-
If set to a non-number value, or set to a negative number, stack traces will
|
|
3349
|
-
capture any frames.
|
|
3164
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
|
3165
|
+
not capture any frames.
|
|
3350
3166
|
|
|
3351
3167
|
##### Inherited from
|
|
3352
3168
|
|
|
@@ -3360,14 +3176,14 @@ capture any frames.
|
|
|
3360
3176
|
|
|
3361
3177
|
Defined in: node_modules/@types/node/globals.d.ts:52
|
|
3362
3178
|
|
|
3363
|
-
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
3364
|
-
string representing the location in the code at which
|
|
3179
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
3180
|
+
a string representing the location in the code at which
|
|
3365
3181
|
`Error.captureStackTrace()` was called.
|
|
3366
3182
|
|
|
3367
3183
|
```js
|
|
3368
|
-
const myObject = {}
|
|
3369
|
-
Error.captureStackTrace(myObject)
|
|
3370
|
-
myObject.stack // Similar to `new Error().stack`
|
|
3184
|
+
const myObject = {};
|
|
3185
|
+
Error.captureStackTrace(myObject);
|
|
3186
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
3371
3187
|
```
|
|
3372
3188
|
|
|
3373
3189
|
The first line of the trace will be prefixed with
|
|
@@ -3377,31 +3193,31 @@ The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
|
3377
3193
|
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
3378
3194
|
generated stack trace.
|
|
3379
3195
|
|
|
3380
|
-
The `constructorOpt` argument is useful for hiding implementation
|
|
3381
|
-
error generation from the user. For instance:
|
|
3196
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
3197
|
+
details of error generation from the user. For instance:
|
|
3382
3198
|
|
|
3383
3199
|
```js
|
|
3384
3200
|
function a() {
|
|
3385
|
-
b()
|
|
3201
|
+
b();
|
|
3386
3202
|
}
|
|
3387
3203
|
|
|
3388
3204
|
function b() {
|
|
3389
|
-
c()
|
|
3205
|
+
c();
|
|
3390
3206
|
}
|
|
3391
3207
|
|
|
3392
3208
|
function c() {
|
|
3393
3209
|
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
3394
|
-
const { stackTraceLimit } = Error
|
|
3395
|
-
Error.stackTraceLimit = 0
|
|
3396
|
-
const error = new Error()
|
|
3397
|
-
Error.stackTraceLimit = stackTraceLimit
|
|
3210
|
+
const { stackTraceLimit } = Error;
|
|
3211
|
+
Error.stackTraceLimit = 0;
|
|
3212
|
+
const error = new Error();
|
|
3213
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
3398
3214
|
|
|
3399
3215
|
// Capture the stack trace above function b
|
|
3400
|
-
Error.captureStackTrace(error, b) // Neither function c, nor b is included in the stack trace
|
|
3401
|
-
throw error
|
|
3216
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
3217
|
+
throw error;
|
|
3402
3218
|
}
|
|
3403
3219
|
|
|
3404
|
-
a()
|
|
3220
|
+
a();
|
|
3405
3221
|
```
|
|
3406
3222
|
|
|
3407
3223
|
##### Parameters
|
|
@@ -3423,7 +3239,7 @@ a()
|
|
|
3423
3239
|
|
|
3424
3240
|
> `static` **isError**(`error`): `error is Error`
|
|
3425
3241
|
|
|
3426
|
-
Defined in: node_modules
|
|
3242
|
+
Defined in: node_modules/@typescript/old/lib/lib.esnext.error.d.ts:21
|
|
3427
3243
|
|
|
3428
3244
|
Indicates whether the argument provided is a built-in Error instance or not.
|
|
3429
3245
|
|
|
@@ -3470,11 +3286,9 @@ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
|
3470
3286
|
|
|
3471
3287
|
## MemoryAdapter
|
|
3472
3288
|
|
|
3473
|
-
Defined in:
|
|
3474
|
-
[libraries/epub/adapters/memory.ts:27](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L27)
|
|
3289
|
+
Defined in: [libraries/epub/adapters/memory.ts:27](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L27)
|
|
3475
3290
|
|
|
3476
|
-
Loads an EPUB archive into memory and serves all I/O off the in-memory zip
|
|
3477
|
-
handle.
|
|
3291
|
+
Loads an EPUB archive into memory and serves all I/O off the in-memory zip handle.
|
|
3478
3292
|
|
|
3479
3293
|
read only
|
|
3480
3294
|
|
|
@@ -3488,8 +3302,7 @@ read only
|
|
|
3488
3302
|
|
|
3489
3303
|
> `readonly` `static` **capabilities**: `object`
|
|
3490
3304
|
|
|
3491
|
-
Defined in:
|
|
3492
|
-
[libraries/epub/adapters/memory.ts:29](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L29)
|
|
3305
|
+
Defined in: [libraries/epub/adapters/memory.ts:29](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L29)
|
|
3493
3306
|
|
|
3494
3307
|
##### writable
|
|
3495
3308
|
|
|
@@ -3499,8 +3312,7 @@ Defined in:
|
|
|
3499
3312
|
|
|
3500
3313
|
> `readonly` `static` **kind**: `"in-memory"`
|
|
3501
3314
|
|
|
3502
|
-
Defined in:
|
|
3503
|
-
[libraries/epub/adapters/memory.ts:28](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L28)
|
|
3315
|
+
Defined in: [libraries/epub/adapters/memory.ts:28](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L28)
|
|
3504
3316
|
|
|
3505
3317
|
### Methods
|
|
3506
3318
|
|
|
@@ -3508,11 +3320,10 @@ Defined in:
|
|
|
3508
3320
|
|
|
3509
3321
|
> **archiveLength**(`entry`): `Promise`\<`number`\>
|
|
3510
3322
|
|
|
3511
|
-
Defined in:
|
|
3512
|
-
[libraries/epub/adapters/memory.ts:94](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L94)
|
|
3323
|
+
Defined in: [libraries/epub/adapters/memory.ts:94](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L94)
|
|
3513
3324
|
|
|
3514
|
-
Length of an entry in bytes, for the readium page-count heuristic
|
|
3515
|
-
compressed size when available
|
|
3325
|
+
Length of an entry in bytes, for the readium page-count heuristic
|
|
3326
|
+
which expects compressed size when available
|
|
3516
3327
|
|
|
3517
3328
|
##### Parameters
|
|
3518
3329
|
|
|
@@ -3532,8 +3343,7 @@ compressed size when available
|
|
|
3532
3343
|
|
|
3533
3344
|
> **dispose**(): `void`
|
|
3534
3345
|
|
|
3535
|
-
Defined in:
|
|
3536
|
-
[libraries/epub/adapters/memory.ts:100](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L100)
|
|
3346
|
+
Defined in: [libraries/epub/adapters/memory.ts:100](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L100)
|
|
3537
3347
|
|
|
3538
3348
|
Always called on close or error
|
|
3539
3349
|
|
|
@@ -3549,11 +3359,11 @@ Always called on close or error
|
|
|
3549
3359
|
|
|
3550
3360
|
> **exists**(`entry`): `Promise`\<`boolean`\>
|
|
3551
3361
|
|
|
3552
|
-
Defined in:
|
|
3553
|
-
[libraries/epub/adapters/memory.ts:89](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L89)
|
|
3362
|
+
Defined in: [libraries/epub/adapters/memory.ts:89](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L89)
|
|
3554
3363
|
|
|
3555
|
-
Whether the archive holds an entry under exactly this name.
|
|
3556
|
-
between different canditates for an href
|
|
3364
|
+
Whether the archive holds an entry under exactly this name.
|
|
3365
|
+
Used to choose between different canditates for an href
|
|
3366
|
+
so should be exact
|
|
3557
3367
|
|
|
3558
3368
|
##### Parameters
|
|
3559
3369
|
|
|
@@ -3575,8 +3385,7 @@ between different canditates for an href so should be exact
|
|
|
3575
3385
|
|
|
3576
3386
|
> **read**(`entry`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
3577
3387
|
|
|
3578
|
-
Defined in:
|
|
3579
|
-
[libraries/epub/adapters/memory.ts:61](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L61)
|
|
3388
|
+
Defined in: [libraries/epub/adapters/memory.ts:61](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L61)
|
|
3580
3389
|
|
|
3581
3390
|
###### Parameters
|
|
3582
3391
|
|
|
@@ -3596,8 +3405,7 @@ Defined in:
|
|
|
3596
3405
|
|
|
3597
3406
|
> **read**(`entry`, `encoding`): `Promise`\<`string`\>
|
|
3598
3407
|
|
|
3599
|
-
Defined in:
|
|
3600
|
-
[libraries/epub/adapters/memory.ts:62](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L62)
|
|
3408
|
+
Defined in: [libraries/epub/adapters/memory.ts:62](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L62)
|
|
3601
3409
|
|
|
3602
3410
|
###### Parameters
|
|
3603
3411
|
|
|
@@ -3616,11 +3424,9 @@ Defined in:
|
|
|
3616
3424
|
|
|
3617
3425
|
#### init()
|
|
3618
3426
|
|
|
3619
|
-
> `static` **init**(`source`, `opts`):
|
|
3620
|
-
> `Promise`\<[`MemoryAdapter`](#memoryadapter)\>
|
|
3427
|
+
> `static` **init**(`source`, `opts`): `Promise`\<[`MemoryAdapter`](#memoryadapter)\>
|
|
3621
3428
|
|
|
3622
|
-
Defined in:
|
|
3623
|
-
[libraries/epub/adapters/memory.ts:31](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L31)
|
|
3429
|
+
Defined in: [libraries/epub/adapters/memory.ts:31](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L31)
|
|
3624
3430
|
|
|
3625
3431
|
##### Parameters
|
|
3626
3432
|
|
|
@@ -3637,12 +3443,11 @@ Defined in:
|
|
|
3637
3443
|
|
|
3638
3444
|
## TmpFsAdapter
|
|
3639
3445
|
|
|
3640
|
-
Defined in:
|
|
3641
|
-
[libraries/epub/adapters/tmpfs.ts:53](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L53)
|
|
3446
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:53](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L53)
|
|
3642
3447
|
|
|
3643
|
-
Extracts an EPUB archive to a temp directory and serves all I/O off
|
|
3644
|
-
filesystem.
|
|
3645
|
-
[Epub](#epub).
|
|
3448
|
+
Extracts an EPUB archive to a temp directory and serves all I/O off
|
|
3449
|
+
the real filesystem.
|
|
3450
|
+
`Epub.using(TmpFsAdapter).from(...)` returns a writable [Epub](#epub).
|
|
3646
3451
|
|
|
3647
3452
|
### Implements
|
|
3648
3453
|
|
|
@@ -3654,8 +3459,7 @@ filesystem. `Epub.using(TmpFsAdapter).from(...)` returns a writable
|
|
|
3654
3459
|
|
|
3655
3460
|
> `readonly` `static` **capabilities**: `object`
|
|
3656
3461
|
|
|
3657
|
-
Defined in:
|
|
3658
|
-
[libraries/epub/adapters/tmpfs.ts:55](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L55)
|
|
3462
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:55](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L55)
|
|
3659
3463
|
|
|
3660
3464
|
##### writable
|
|
3661
3465
|
|
|
@@ -3665,8 +3469,7 @@ Defined in:
|
|
|
3665
3469
|
|
|
3666
3470
|
> `readonly` `static` **kind**: `"extracted-dir"`
|
|
3667
3471
|
|
|
3668
|
-
Defined in:
|
|
3669
|
-
[libraries/epub/adapters/tmpfs.ts:54](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L54)
|
|
3472
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:54](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L54)
|
|
3670
3473
|
|
|
3671
3474
|
### Methods
|
|
3672
3475
|
|
|
@@ -3674,11 +3477,10 @@ Defined in:
|
|
|
3674
3477
|
|
|
3675
3478
|
> **archiveLength**(`entry`): `Promise`\<`number`\>
|
|
3676
3479
|
|
|
3677
|
-
Defined in:
|
|
3678
|
-
[libraries/epub/adapters/tmpfs.ts:136](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L136)
|
|
3480
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:136](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L136)
|
|
3679
3481
|
|
|
3680
|
-
Length of an entry in bytes, for the readium page-count heuristic
|
|
3681
|
-
compressed size when available
|
|
3482
|
+
Length of an entry in bytes, for the readium page-count heuristic
|
|
3483
|
+
which expects compressed size when available
|
|
3682
3484
|
|
|
3683
3485
|
##### Parameters
|
|
3684
3486
|
|
|
@@ -3698,8 +3500,7 @@ compressed size when available
|
|
|
3698
3500
|
|
|
3699
3501
|
> **dispose**(): `void`
|
|
3700
3502
|
|
|
3701
|
-
Defined in:
|
|
3702
|
-
[libraries/epub/adapters/tmpfs.ts:213](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L213)
|
|
3503
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:213](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L213)
|
|
3703
3504
|
|
|
3704
3505
|
Always called on close or error
|
|
3705
3506
|
|
|
@@ -3715,8 +3516,7 @@ Always called on close or error
|
|
|
3715
3516
|
|
|
3716
3517
|
> **duplicate**(): `Promise`\<[`TmpFsAdapter`](#tmpfsadapter)\>
|
|
3717
3518
|
|
|
3718
|
-
Defined in:
|
|
3719
|
-
[libraries/epub/adapters/tmpfs.ts:163](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L163)
|
|
3519
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:163](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L163)
|
|
3720
3520
|
|
|
3721
3521
|
Required for Epub.copy
|
|
3722
3522
|
|
|
@@ -3732,11 +3532,11 @@ Required for Epub.copy
|
|
|
3732
3532
|
|
|
3733
3533
|
> **exists**(`entry`): `Promise`\<`boolean`\>
|
|
3734
3534
|
|
|
3735
|
-
Defined in:
|
|
3736
|
-
[libraries/epub/adapters/tmpfs.ts:127](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L127)
|
|
3535
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:127](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L127)
|
|
3737
3536
|
|
|
3738
|
-
Whether the archive holds an entry under exactly this name.
|
|
3739
|
-
between different canditates for an href
|
|
3537
|
+
Whether the archive holds an entry under exactly this name.
|
|
3538
|
+
Used to choose between different canditates for an href
|
|
3539
|
+
so should be exact
|
|
3740
3540
|
|
|
3741
3541
|
##### Parameters
|
|
3742
3542
|
|
|
@@ -3756,8 +3556,7 @@ between different canditates for an href so should be exact
|
|
|
3756
3556
|
|
|
3757
3557
|
> **list**(): `AsyncIterable`\<[`EpubListEntry`](#epublistentry)\>
|
|
3758
3558
|
|
|
3759
|
-
Defined in:
|
|
3760
|
-
[libraries/epub/adapters/tmpfs.ts:145](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L145)
|
|
3559
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:145](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L145)
|
|
3761
3560
|
|
|
3762
3561
|
Required for Epub.saveAndClose to walk the contents
|
|
3763
3562
|
|
|
@@ -3775,8 +3574,7 @@ Required for Epub.saveAndClose to walk the contents
|
|
|
3775
3574
|
|
|
3776
3575
|
> **read**(`entry`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
3777
3576
|
|
|
3778
|
-
Defined in:
|
|
3779
|
-
[libraries/epub/adapters/tmpfs.ts:105](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L105)
|
|
3577
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:105](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L105)
|
|
3780
3578
|
|
|
3781
3579
|
###### Parameters
|
|
3782
3580
|
|
|
@@ -3796,8 +3594,7 @@ Defined in:
|
|
|
3796
3594
|
|
|
3797
3595
|
> **read**(`entry`, `encoding`): `Promise`\<`string`\>
|
|
3798
3596
|
|
|
3799
|
-
Defined in:
|
|
3800
|
-
[libraries/epub/adapters/tmpfs.ts:106](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L106)
|
|
3597
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:106](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L106)
|
|
3801
3598
|
|
|
3802
3599
|
###### Parameters
|
|
3803
3600
|
|
|
@@ -3818,8 +3615,7 @@ Defined in:
|
|
|
3818
3615
|
|
|
3819
3616
|
> **remove**(`entry`): `Promise`\<`void`\>
|
|
3820
3617
|
|
|
3821
|
-
Defined in:
|
|
3822
|
-
[libraries/epub/adapters/tmpfs.ts:123](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L123)
|
|
3618
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:123](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L123)
|
|
3823
3619
|
|
|
3824
3620
|
Required for removeManifestItem / setCoverImage replacement
|
|
3825
3621
|
|
|
@@ -3841,8 +3637,7 @@ Required for removeManifestItem / setCoverImage replacement
|
|
|
3841
3637
|
|
|
3842
3638
|
> **serialize**(`targetPath`): `Promise`\<`void`\>
|
|
3843
3639
|
|
|
3844
|
-
Defined in:
|
|
3845
|
-
[libraries/epub/adapters/tmpfs.ts:174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L174)
|
|
3640
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L174)
|
|
3846
3641
|
|
|
3847
3642
|
Required for Epub.saveAndClose
|
|
3848
3643
|
|
|
@@ -3866,8 +3661,7 @@ Required for Epub.saveAndClose
|
|
|
3866
3661
|
|
|
3867
3662
|
> **write**(`entry`, `data`): `Promise`\<`void`\>
|
|
3868
3663
|
|
|
3869
|
-
Defined in:
|
|
3870
|
-
[libraries/epub/adapters/tmpfs.ts:111](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L111)
|
|
3664
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:111](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L111)
|
|
3871
3665
|
|
|
3872
3666
|
Required for any mutation method on Epub
|
|
3873
3667
|
|
|
@@ -3890,8 +3684,7 @@ Required for any mutation method on Epub
|
|
|
3890
3684
|
|
|
3891
3685
|
> **write**(`entry`, `data`, `encoding`): `Promise`\<`void`\>
|
|
3892
3686
|
|
|
3893
|
-
Defined in:
|
|
3894
|
-
[libraries/epub/adapters/tmpfs.ts:112](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L112)
|
|
3687
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:112](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L112)
|
|
3895
3688
|
|
|
3896
3689
|
###### Parameters
|
|
3897
3690
|
|
|
@@ -3913,8 +3706,7 @@ Defined in:
|
|
|
3913
3706
|
|
|
3914
3707
|
> `static` **init**(`source`): `Promise`\<[`TmpFsAdapter`](#tmpfsadapter)\>
|
|
3915
3708
|
|
|
3916
|
-
Defined in:
|
|
3917
|
-
[libraries/epub/adapters/tmpfs.ts:57](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L57)
|
|
3709
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:57](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L57)
|
|
3918
3710
|
|
|
3919
3711
|
##### Parameters
|
|
3920
3712
|
|
|
@@ -3930,8 +3722,7 @@ Defined in:
|
|
|
3930
3722
|
|
|
3931
3723
|
> `static` **initEmpty**(): `Promise`\<[`TmpFsAdapter`](#tmpfsadapter)\>
|
|
3932
3724
|
|
|
3933
|
-
Defined in:
|
|
3934
|
-
[libraries/epub/adapters/tmpfs.ts:88](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L88)
|
|
3725
|
+
Defined in: [libraries/epub/adapters/tmpfs.ts:88](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L88)
|
|
3935
3726
|
|
|
3936
3727
|
##### Returns
|
|
3937
3728
|
|
|
@@ -3941,8 +3732,7 @@ Defined in:
|
|
|
3941
3732
|
|
|
3942
3733
|
## AlternateScript
|
|
3943
3734
|
|
|
3944
|
-
Defined in:
|
|
3945
|
-
[libraries/epub/index.ts:149](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L149)
|
|
3735
|
+
Defined in: [libraries/epub/index.ts:150](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L150)
|
|
3946
3736
|
|
|
3947
3737
|
### Properties
|
|
3948
3738
|
|
|
@@ -3950,22 +3740,19 @@ Defined in:
|
|
|
3950
3740
|
|
|
3951
3741
|
> **locale**: `Locale`
|
|
3952
3742
|
|
|
3953
|
-
Defined in:
|
|
3954
|
-
[libraries/epub/index.ts:151](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L151)
|
|
3743
|
+
Defined in: [libraries/epub/index.ts:152](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L152)
|
|
3955
3744
|
|
|
3956
3745
|
#### name
|
|
3957
3746
|
|
|
3958
3747
|
> **name**: `string`
|
|
3959
3748
|
|
|
3960
|
-
Defined in:
|
|
3961
|
-
[libraries/epub/index.ts:150](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L150)
|
|
3749
|
+
Defined in: [libraries/epub/index.ts:151](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L151)
|
|
3962
3750
|
|
|
3963
3751
|
---
|
|
3964
3752
|
|
|
3965
3753
|
## Collection
|
|
3966
3754
|
|
|
3967
|
-
Defined in:
|
|
3968
|
-
[libraries/epub/index.ts:173](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L173)
|
|
3755
|
+
Defined in: [libraries/epub/index.ts:174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L174)
|
|
3969
3756
|
|
|
3970
3757
|
### Properties
|
|
3971
3758
|
|
|
@@ -3973,29 +3760,25 @@ Defined in:
|
|
|
3973
3760
|
|
|
3974
3761
|
> **name**: `string`
|
|
3975
3762
|
|
|
3976
|
-
Defined in:
|
|
3977
|
-
[libraries/epub/index.ts:174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L174)
|
|
3763
|
+
Defined in: [libraries/epub/index.ts:175](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L175)
|
|
3978
3764
|
|
|
3979
3765
|
#### position?
|
|
3980
3766
|
|
|
3981
3767
|
> `optional` **position**: `string`
|
|
3982
3768
|
|
|
3983
|
-
Defined in:
|
|
3984
|
-
[libraries/epub/index.ts:176](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L176)
|
|
3769
|
+
Defined in: [libraries/epub/index.ts:177](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L177)
|
|
3985
3770
|
|
|
3986
3771
|
#### type?
|
|
3987
3772
|
|
|
3988
3773
|
> `optional` **type**: `string`
|
|
3989
3774
|
|
|
3990
|
-
Defined in:
|
|
3991
|
-
[libraries/epub/index.ts:175](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L175)
|
|
3775
|
+
Defined in: [libraries/epub/index.ts:176](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L176)
|
|
3992
3776
|
|
|
3993
3777
|
---
|
|
3994
3778
|
|
|
3995
3779
|
## DcCreator
|
|
3996
3780
|
|
|
3997
|
-
Defined in:
|
|
3998
|
-
[libraries/epub/index.ts:154](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L154)
|
|
3781
|
+
Defined in: [libraries/epub/index.ts:155](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L155)
|
|
3999
3782
|
|
|
4000
3783
|
### Properties
|
|
4001
3784
|
|
|
@@ -4003,43 +3786,37 @@ Defined in:
|
|
|
4003
3786
|
|
|
4004
3787
|
> `optional` **alternateScripts**: [`AlternateScript`](#alternatescript)[]
|
|
4005
3788
|
|
|
4006
|
-
Defined in:
|
|
4007
|
-
[libraries/epub/index.ts:159](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L159)
|
|
3789
|
+
Defined in: [libraries/epub/index.ts:160](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L160)
|
|
4008
3790
|
|
|
4009
3791
|
#### fileAs?
|
|
4010
3792
|
|
|
4011
3793
|
> `optional` **fileAs**: `string`
|
|
4012
3794
|
|
|
4013
|
-
Defined in:
|
|
4014
|
-
[libraries/epub/index.ts:158](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L158)
|
|
3795
|
+
Defined in: [libraries/epub/index.ts:159](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L159)
|
|
4015
3796
|
|
|
4016
3797
|
#### name
|
|
4017
3798
|
|
|
4018
3799
|
> **name**: `string`
|
|
4019
3800
|
|
|
4020
|
-
Defined in:
|
|
4021
|
-
[libraries/epub/index.ts:155](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L155)
|
|
3801
|
+
Defined in: [libraries/epub/index.ts:156](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L156)
|
|
4022
3802
|
|
|
4023
3803
|
#### role?
|
|
4024
3804
|
|
|
4025
3805
|
> `optional` **role**: `string`
|
|
4026
3806
|
|
|
4027
|
-
Defined in:
|
|
4028
|
-
[libraries/epub/index.ts:156](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L156)
|
|
3807
|
+
Defined in: [libraries/epub/index.ts:157](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L157)
|
|
4029
3808
|
|
|
4030
3809
|
#### roleScheme?
|
|
4031
3810
|
|
|
4032
3811
|
> `optional` **roleScheme**: `string`
|
|
4033
3812
|
|
|
4034
|
-
Defined in:
|
|
4035
|
-
[libraries/epub/index.ts:157](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L157)
|
|
3813
|
+
Defined in: [libraries/epub/index.ts:158](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L158)
|
|
4036
3814
|
|
|
4037
3815
|
---
|
|
4038
3816
|
|
|
4039
3817
|
## DcSubject
|
|
4040
3818
|
|
|
4041
|
-
Defined in:
|
|
4042
|
-
[libraries/epub/index.ts:116](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L116)
|
|
3819
|
+
Defined in: [libraries/epub/index.ts:117](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L117)
|
|
4043
3820
|
|
|
4044
3821
|
### Properties
|
|
4045
3822
|
|
|
@@ -4047,29 +3824,25 @@ Defined in:
|
|
|
4047
3824
|
|
|
4048
3825
|
> **authority**: `string`
|
|
4049
3826
|
|
|
4050
|
-
Defined in:
|
|
4051
|
-
[libraries/epub/index.ts:118](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L118)
|
|
3827
|
+
Defined in: [libraries/epub/index.ts:119](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L119)
|
|
4052
3828
|
|
|
4053
3829
|
#### term
|
|
4054
3830
|
|
|
4055
3831
|
> **term**: `string`
|
|
4056
3832
|
|
|
4057
|
-
Defined in:
|
|
4058
|
-
[libraries/epub/index.ts:119](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L119)
|
|
3833
|
+
Defined in: [libraries/epub/index.ts:120](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L120)
|
|
4059
3834
|
|
|
4060
3835
|
#### value
|
|
4061
3836
|
|
|
4062
3837
|
> **value**: `string`
|
|
4063
3838
|
|
|
4064
|
-
Defined in:
|
|
4065
|
-
[libraries/epub/index.ts:117](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L117)
|
|
3839
|
+
Defined in: [libraries/epub/index.ts:118](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L118)
|
|
4066
3840
|
|
|
4067
3841
|
---
|
|
4068
3842
|
|
|
4069
3843
|
## DublinCore
|
|
4070
3844
|
|
|
4071
|
-
Defined in:
|
|
4072
|
-
[libraries/epub/index.ts:162](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L162)
|
|
3845
|
+
Defined in: [libraries/epub/index.ts:163](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L163)
|
|
4073
3846
|
|
|
4074
3847
|
### Properties
|
|
4075
3848
|
|
|
@@ -4077,26 +3850,841 @@ Defined in:
|
|
|
4077
3850
|
|
|
4078
3851
|
> `optional` **contributors**: [`DcCreator`](#dccreator)[]
|
|
4079
3852
|
|
|
4080
|
-
Defined in:
|
|
4081
|
-
[libraries/epub/index.ts:169](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L169)
|
|
3853
|
+
Defined in: [libraries/epub/index.ts:170](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L170)
|
|
4082
3854
|
|
|
4083
3855
|
#### creators?
|
|
4084
3856
|
|
|
4085
3857
|
> `optional` **creators**: [`DcCreator`](#dccreator)[]
|
|
4086
3858
|
|
|
4087
|
-
Defined in:
|
|
4088
|
-
[libraries/epub/index.ts:168](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L168)
|
|
3859
|
+
Defined in: [libraries/epub/index.ts:169](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L169)
|
|
4089
3860
|
|
|
4090
3861
|
#### date?
|
|
4091
3862
|
|
|
4092
3863
|
> `optional` **date**: `Date`
|
|
4093
3864
|
|
|
4094
|
-
Defined in:
|
|
4095
|
-
[libraries/epub/index.ts:166](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L166)
|
|
3865
|
+
Defined in: [libraries/epub/index.ts:167](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L167)
|
|
4096
3866
|
|
|
4097
3867
|
#### identifier
|
|
4098
3868
|
|
|
4099
3869
|
> **identifier**: `string`
|
|
4100
3870
|
|
|
4101
|
-
Defined in:
|
|
4102
|
-
|
|
3871
|
+
Defined in: [libraries/epub/index.ts:166](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L166)
|
|
3872
|
+
|
|
3873
|
+
#### language
|
|
3874
|
+
|
|
3875
|
+
> **language**: `Locale`
|
|
3876
|
+
|
|
3877
|
+
Defined in: [libraries/epub/index.ts:165](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L165)
|
|
3878
|
+
|
|
3879
|
+
#### subjects?
|
|
3880
|
+
|
|
3881
|
+
> `optional` **subjects**: (`string` \| [`DcSubject`](#dcsubject))[]
|
|
3882
|
+
|
|
3883
|
+
Defined in: [libraries/epub/index.ts:168](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L168)
|
|
3884
|
+
|
|
3885
|
+
#### title
|
|
3886
|
+
|
|
3887
|
+
> **title**: `string`
|
|
3888
|
+
|
|
3889
|
+
Defined in: [libraries/epub/index.ts:164](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L164)
|
|
3890
|
+
|
|
3891
|
+
#### type?
|
|
3892
|
+
|
|
3893
|
+
> `optional` **type**: `string`
|
|
3894
|
+
|
|
3895
|
+
Defined in: [libraries/epub/index.ts:171](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L171)
|
|
3896
|
+
|
|
3897
|
+
---
|
|
3898
|
+
|
|
3899
|
+
## Epub2UpgradeOptions
|
|
3900
|
+
|
|
3901
|
+
Defined in: [libraries/epub/upgrade.ts:69](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/upgrade.ts#L69)
|
|
3902
|
+
|
|
3903
|
+
### Properties
|
|
3904
|
+
|
|
3905
|
+
#### outputPath?
|
|
3906
|
+
|
|
3907
|
+
> `optional` **outputPath**: `string`
|
|
3908
|
+
|
|
3909
|
+
Defined in: [libraries/epub/upgrade.ts:73](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/upgrade.ts#L73)
|
|
3910
|
+
|
|
3911
|
+
The path to the output file. If provided, the input file will be copied to the output path.
|
|
3912
|
+
|
|
3913
|
+
#### removeNcx?
|
|
3914
|
+
|
|
3915
|
+
> `optional` **removeNcx**: `boolean`
|
|
3916
|
+
|
|
3917
|
+
Defined in: [libraries/epub/upgrade.ts:77](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/upgrade.ts#L77)
|
|
3918
|
+
|
|
3919
|
+
Whether to remove the NCX file, as it's technically optional in EPUB 3.
|
|
3920
|
+
|
|
3921
|
+
---
|
|
3922
|
+
|
|
3923
|
+
## EpubIdentifier
|
|
3924
|
+
|
|
3925
|
+
Defined in: [libraries/epub/index.ts:123](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L123)
|
|
3926
|
+
|
|
3927
|
+
### Properties
|
|
3928
|
+
|
|
3929
|
+
#### id?
|
|
3930
|
+
|
|
3931
|
+
> `optional` **id**: `string`
|
|
3932
|
+
|
|
3933
|
+
Defined in: [libraries/epub/index.ts:125](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L125)
|
|
3934
|
+
|
|
3935
|
+
#### identifierType?
|
|
3936
|
+
|
|
3937
|
+
> `optional` **identifierType**: `string`
|
|
3938
|
+
|
|
3939
|
+
Defined in: [libraries/epub/index.ts:127](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L127)
|
|
3940
|
+
|
|
3941
|
+
the value of a refining `identifier-type` meta, if present
|
|
3942
|
+
|
|
3943
|
+
#### scheme?
|
|
3944
|
+
|
|
3945
|
+
> `optional` **scheme**: `string`
|
|
3946
|
+
|
|
3947
|
+
Defined in: [libraries/epub/index.ts:129](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L129)
|
|
3948
|
+
|
|
3949
|
+
the `scheme` of a refining `identifier-type` meta, or a legacy `opf:scheme` attribute
|
|
3950
|
+
|
|
3951
|
+
#### value
|
|
3952
|
+
|
|
3953
|
+
> **value**: `string`
|
|
3954
|
+
|
|
3955
|
+
Defined in: [libraries/epub/index.ts:124](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L124)
|
|
3956
|
+
|
|
3957
|
+
---
|
|
3958
|
+
|
|
3959
|
+
## EpubListEntry
|
|
3960
|
+
|
|
3961
|
+
Defined in: [libraries/epub/adapters/interface.ts:17](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L17)
|
|
3962
|
+
|
|
3963
|
+
### Properties
|
|
3964
|
+
|
|
3965
|
+
#### absolutePath
|
|
3966
|
+
|
|
3967
|
+
> **absolutePath**: `string`
|
|
3968
|
+
|
|
3969
|
+
Defined in: [libraries/epub/adapters/interface.ts:19](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L19)
|
|
3970
|
+
|
|
3971
|
+
location the adapter can read the entry back from, in whatever form it stores
|
|
3972
|
+
|
|
3973
|
+
#### relativePath
|
|
3974
|
+
|
|
3975
|
+
> **relativePath**: `string`
|
|
3976
|
+
|
|
3977
|
+
Defined in: [libraries/epub/adapters/interface.ts:21](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L21)
|
|
3978
|
+
|
|
3979
|
+
the entry name, as it appears in the archive
|
|
3980
|
+
|
|
3981
|
+
---
|
|
3982
|
+
|
|
3983
|
+
## EpubSource
|
|
3984
|
+
|
|
3985
|
+
Defined in: [libraries/epub/index.ts:132](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L132)
|
|
3986
|
+
|
|
3987
|
+
### Properties
|
|
3988
|
+
|
|
3989
|
+
#### id?
|
|
3990
|
+
|
|
3991
|
+
> `optional` **id**: `string`
|
|
3992
|
+
|
|
3993
|
+
Defined in: [libraries/epub/index.ts:134](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L134)
|
|
3994
|
+
|
|
3995
|
+
#### identifierType?
|
|
3996
|
+
|
|
3997
|
+
> `optional` **identifierType**: `string`
|
|
3998
|
+
|
|
3999
|
+
Defined in: [libraries/epub/index.ts:136](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L136)
|
|
4000
|
+
|
|
4001
|
+
the value of a refining `identifier-type` meta, if present
|
|
4002
|
+
|
|
4003
|
+
#### isPageBreakSource?
|
|
4004
|
+
|
|
4005
|
+
> `optional` **isPageBreakSource**: `boolean`
|
|
4006
|
+
|
|
4007
|
+
Defined in: [libraries/epub/index.ts:147](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L147)
|
|
4008
|
+
|
|
4009
|
+
whether this source has a `source-of="pagination"` refinement
|
|
4010
|
+
or of a `<meta property="pageBreakSource">` element
|
|
4011
|
+
|
|
4012
|
+
as of EPUB 3.4 `source-of` is advised-deprecated in favour of the
|
|
4013
|
+
publication-level `pageBreakSource` property. if you want to
|
|
4014
|
+
be sure to get the source of pagination, use [Epub.getPageBreakSource](#getpagebreaksource)
|
|
4015
|
+
|
|
4016
|
+
#### scheme?
|
|
4017
|
+
|
|
4018
|
+
> `optional` **scheme**: `string`
|
|
4019
|
+
|
|
4020
|
+
Defined in: [libraries/epub/index.ts:138](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L138)
|
|
4021
|
+
|
|
4022
|
+
the `scheme` of a refining `identifier-type` meta, or a legacy `opf:scheme` attribute
|
|
4023
|
+
|
|
4024
|
+
#### value
|
|
4025
|
+
|
|
4026
|
+
> **value**: `string`
|
|
4027
|
+
|
|
4028
|
+
Defined in: [libraries/epub/index.ts:133](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L133)
|
|
4029
|
+
|
|
4030
|
+
---
|
|
4031
|
+
|
|
4032
|
+
## EpubStorageAdapter
|
|
4033
|
+
|
|
4034
|
+
Defined in: [libraries/epub/adapters/interface.ts:34](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L34)
|
|
4035
|
+
|
|
4036
|
+
Adapters only receive entry names, which is:
|
|
4037
|
+
|
|
4038
|
+
- the name a file has in the archive itself
|
|
4039
|
+
- relative to the container root, slash-separated,
|
|
4040
|
+
- already percent-decoded (eg `OEBPS/a b.xhtml`, not `OEBPS/a%20b.xhtml`)
|
|
4041
|
+
|
|
4042
|
+
Adapter decides where to store files under what name
|
|
4043
|
+
In previous versions of the EPUB lib, this was a little bit more muddled, leading to
|
|
4044
|
+
eg the TmpFsAdapter trying to read `OEBPS/a%20b.xhtml`, whereas it was stored as `OEBPS/a b.xhtml`
|
|
4045
|
+
|
|
4046
|
+
### Methods
|
|
4047
|
+
|
|
4048
|
+
#### archiveLength()
|
|
4049
|
+
|
|
4050
|
+
> **archiveLength**(`entry`): `Promise`\<`number`\>
|
|
4051
|
+
|
|
4052
|
+
Defined in: [libraries/epub/adapters/interface.ts:49](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L49)
|
|
4053
|
+
|
|
4054
|
+
Length of an entry in bytes, for the readium page-count heuristic
|
|
4055
|
+
which expects compressed size when available
|
|
4056
|
+
|
|
4057
|
+
##### Parameters
|
|
4058
|
+
|
|
4059
|
+
| Parameter | Type |
|
|
4060
|
+
| --------- | -------- |
|
|
4061
|
+
| `entry` | `string` |
|
|
4062
|
+
|
|
4063
|
+
##### Returns
|
|
4064
|
+
|
|
4065
|
+
`Promise`\<`number`\>
|
|
4066
|
+
|
|
4067
|
+
#### dispose()
|
|
4068
|
+
|
|
4069
|
+
> **dispose**(): `void` \| `Promise`\<`void`\>
|
|
4070
|
+
|
|
4071
|
+
Defined in: [libraries/epub/adapters/interface.ts:68](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L68)
|
|
4072
|
+
|
|
4073
|
+
Always called on close or error
|
|
4074
|
+
|
|
4075
|
+
##### Returns
|
|
4076
|
+
|
|
4077
|
+
`void` \| `Promise`\<`void`\>
|
|
4078
|
+
|
|
4079
|
+
#### duplicate()?
|
|
4080
|
+
|
|
4081
|
+
> `optional` **duplicate**(): `Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4082
|
+
|
|
4083
|
+
Defined in: [libraries/epub/adapters/interface.ts:62](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L62)
|
|
4084
|
+
|
|
4085
|
+
Required for Epub.copy
|
|
4086
|
+
|
|
4087
|
+
##### Returns
|
|
4088
|
+
|
|
4089
|
+
`Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4090
|
+
|
|
4091
|
+
#### exists()
|
|
4092
|
+
|
|
4093
|
+
> **exists**(`entry`): `Promise`\<`boolean`\>
|
|
4094
|
+
|
|
4095
|
+
Defined in: [libraries/epub/adapters/interface.ts:43](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L43)
|
|
4096
|
+
|
|
4097
|
+
Whether the archive holds an entry under exactly this name.
|
|
4098
|
+
Used to choose between different canditates for an href
|
|
4099
|
+
so should be exact
|
|
4100
|
+
|
|
4101
|
+
##### Parameters
|
|
4102
|
+
|
|
4103
|
+
| Parameter | Type |
|
|
4104
|
+
| --------- | -------- |
|
|
4105
|
+
| `entry` | `string` |
|
|
4106
|
+
|
|
4107
|
+
##### Returns
|
|
4108
|
+
|
|
4109
|
+
`Promise`\<`boolean`\>
|
|
4110
|
+
|
|
4111
|
+
#### list()?
|
|
4112
|
+
|
|
4113
|
+
> `optional` **list**(): `AsyncIterable`\<[`EpubListEntry`](#epublistentry)\>
|
|
4114
|
+
|
|
4115
|
+
Defined in: [libraries/epub/adapters/interface.ts:59](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L59)
|
|
4116
|
+
|
|
4117
|
+
Required for Epub.saveAndClose to walk the contents
|
|
4118
|
+
|
|
4119
|
+
##### Returns
|
|
4120
|
+
|
|
4121
|
+
`AsyncIterable`\<[`EpubListEntry`](#epublistentry)\>
|
|
4122
|
+
|
|
4123
|
+
#### read()
|
|
4124
|
+
|
|
4125
|
+
##### Call Signature
|
|
4126
|
+
|
|
4127
|
+
> **read**(`entry`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
4128
|
+
|
|
4129
|
+
Defined in: [libraries/epub/adapters/interface.ts:35](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L35)
|
|
4130
|
+
|
|
4131
|
+
###### Parameters
|
|
4132
|
+
|
|
4133
|
+
| Parameter | Type |
|
|
4134
|
+
| --------- | -------- |
|
|
4135
|
+
| `entry` | `string` |
|
|
4136
|
+
|
|
4137
|
+
###### Returns
|
|
4138
|
+
|
|
4139
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
4140
|
+
|
|
4141
|
+
##### Call Signature
|
|
4142
|
+
|
|
4143
|
+
> **read**(`entry`, `encoding`): `Promise`\<`string`\>
|
|
4144
|
+
|
|
4145
|
+
Defined in: [libraries/epub/adapters/interface.ts:36](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L36)
|
|
4146
|
+
|
|
4147
|
+
###### Parameters
|
|
4148
|
+
|
|
4149
|
+
| Parameter | Type |
|
|
4150
|
+
| ---------- | --------- |
|
|
4151
|
+
| `entry` | `string` |
|
|
4152
|
+
| `encoding` | `"utf-8"` |
|
|
4153
|
+
|
|
4154
|
+
###### Returns
|
|
4155
|
+
|
|
4156
|
+
`Promise`\<`string`\>
|
|
4157
|
+
|
|
4158
|
+
#### remove()?
|
|
4159
|
+
|
|
4160
|
+
> `optional` **remove**(`entry`): `Promise`\<`void`\>
|
|
4161
|
+
|
|
4162
|
+
Defined in: [libraries/epub/adapters/interface.ts:56](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L56)
|
|
4163
|
+
|
|
4164
|
+
Required for removeManifestItem / setCoverImage replacement
|
|
4165
|
+
|
|
4166
|
+
##### Parameters
|
|
4167
|
+
|
|
4168
|
+
| Parameter | Type |
|
|
4169
|
+
| --------- | -------- |
|
|
4170
|
+
| `entry` | `string` |
|
|
4171
|
+
|
|
4172
|
+
##### Returns
|
|
4173
|
+
|
|
4174
|
+
`Promise`\<`void`\>
|
|
4175
|
+
|
|
4176
|
+
#### serialize()?
|
|
4177
|
+
|
|
4178
|
+
> `optional` **serialize**(`targetPath`): `Promise`\<`void`\>
|
|
4179
|
+
|
|
4180
|
+
Defined in: [libraries/epub/adapters/interface.ts:65](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L65)
|
|
4181
|
+
|
|
4182
|
+
Required for Epub.saveAndClose
|
|
4183
|
+
|
|
4184
|
+
##### Parameters
|
|
4185
|
+
|
|
4186
|
+
| Parameter | Type |
|
|
4187
|
+
| ------------ | -------- |
|
|
4188
|
+
| `targetPath` | `string` |
|
|
4189
|
+
|
|
4190
|
+
##### Returns
|
|
4191
|
+
|
|
4192
|
+
`Promise`\<`void`\>
|
|
4193
|
+
|
|
4194
|
+
#### write()?
|
|
4195
|
+
|
|
4196
|
+
##### Call Signature
|
|
4197
|
+
|
|
4198
|
+
> `optional` **write**(`entry`, `data`): `Promise`\<`void`\>
|
|
4199
|
+
|
|
4200
|
+
Defined in: [libraries/epub/adapters/interface.ts:52](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L52)
|
|
4201
|
+
|
|
4202
|
+
Required for any mutation method on Epub
|
|
4203
|
+
|
|
4204
|
+
###### Parameters
|
|
4205
|
+
|
|
4206
|
+
| Parameter | Type |
|
|
4207
|
+
| --------- | ------------ |
|
|
4208
|
+
| `entry` | `string` |
|
|
4209
|
+
| `data` | `Uint8Array` |
|
|
4210
|
+
|
|
4211
|
+
###### Returns
|
|
4212
|
+
|
|
4213
|
+
`Promise`\<`void`\>
|
|
4214
|
+
|
|
4215
|
+
##### Call Signature
|
|
4216
|
+
|
|
4217
|
+
> `optional` **write**(`entry`, `data`, `encoding`): `Promise`\<`void`\>
|
|
4218
|
+
|
|
4219
|
+
Defined in: [libraries/epub/adapters/interface.ts:53](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L53)
|
|
4220
|
+
|
|
4221
|
+
###### Parameters
|
|
4222
|
+
|
|
4223
|
+
| Parameter | Type |
|
|
4224
|
+
| ---------- | --------- |
|
|
4225
|
+
| `entry` | `string` |
|
|
4226
|
+
| `data` | `string` |
|
|
4227
|
+
| `encoding` | `"utf-8"` |
|
|
4228
|
+
|
|
4229
|
+
###### Returns
|
|
4230
|
+
|
|
4231
|
+
`Promise`\<`void`\>
|
|
4232
|
+
|
|
4233
|
+
---
|
|
4234
|
+
|
|
4235
|
+
## EpubStorageAdapterClass\<Opts\>
|
|
4236
|
+
|
|
4237
|
+
Defined in: [libraries/epub/adapters/interface.ts:71](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L71)
|
|
4238
|
+
|
|
4239
|
+
### Type Parameters
|
|
4240
|
+
|
|
4241
|
+
| Type Parameter | Default type |
|
|
4242
|
+
| ------------------------- | ------------ |
|
|
4243
|
+
| `Opts` _extends_ `object` | `object` |
|
|
4244
|
+
|
|
4245
|
+
### Properties
|
|
4246
|
+
|
|
4247
|
+
#### capabilities
|
|
4248
|
+
|
|
4249
|
+
> `readonly` **capabilities**: [`EpubStorageCapabilities`](#epubstoragecapabilities)
|
|
4250
|
+
|
|
4251
|
+
Defined in: [libraries/epub/adapters/interface.ts:73](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L73)
|
|
4252
|
+
|
|
4253
|
+
#### kind
|
|
4254
|
+
|
|
4255
|
+
> `readonly` **kind**: [`EpubStorageKind`](#epubstoragekind)
|
|
4256
|
+
|
|
4257
|
+
Defined in: [libraries/epub/adapters/interface.ts:72](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L72)
|
|
4258
|
+
|
|
4259
|
+
### Methods
|
|
4260
|
+
|
|
4261
|
+
#### init()
|
|
4262
|
+
|
|
4263
|
+
> **init**(`source`, `opts?`): `Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4264
|
+
|
|
4265
|
+
Defined in: [libraries/epub/adapters/interface.ts:79](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L79)
|
|
4266
|
+
|
|
4267
|
+
Open an archive from a path or buffer.
|
|
4268
|
+
Will throw if the archive is not a valid EPUB 3
|
|
4269
|
+
|
|
4270
|
+
##### Parameters
|
|
4271
|
+
|
|
4272
|
+
| Parameter | Type |
|
|
4273
|
+
| --------- | --------------------------------------------- |
|
|
4274
|
+
| `source` | `string` \| `Uint8Array`\<`ArrayBufferLike`\> |
|
|
4275
|
+
| `opts?` | `Opts` |
|
|
4276
|
+
|
|
4277
|
+
##### Returns
|
|
4278
|
+
|
|
4279
|
+
`Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4280
|
+
|
|
4281
|
+
#### initEmpty()?
|
|
4282
|
+
|
|
4283
|
+
> `optional` **initEmpty**(`opts?`): `Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4284
|
+
|
|
4285
|
+
Defined in: [libraries/epub/adapters/interface.ts:85](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L85)
|
|
4286
|
+
|
|
4287
|
+
Initialize an empty extract root for [Epub.create](#create).
|
|
4288
|
+
Only necessary for adapters that can write
|
|
4289
|
+
|
|
4290
|
+
##### Parameters
|
|
4291
|
+
|
|
4292
|
+
| Parameter | Type |
|
|
4293
|
+
| --------- | ------ |
|
|
4294
|
+
| `opts?` | `Opts` |
|
|
4295
|
+
|
|
4296
|
+
##### Returns
|
|
4297
|
+
|
|
4298
|
+
`Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4299
|
+
|
|
4300
|
+
---
|
|
4301
|
+
|
|
4302
|
+
## EpubStorageCapabilities
|
|
4303
|
+
|
|
4304
|
+
Defined in: [libraries/epub/adapters/interface.ts:12](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L12)
|
|
4305
|
+
|
|
4306
|
+
### Properties
|
|
4307
|
+
|
|
4308
|
+
#### writable
|
|
4309
|
+
|
|
4310
|
+
> `readonly` **writable**: `boolean`
|
|
4311
|
+
|
|
4312
|
+
Defined in: [libraries/epub/adapters/interface.ts:14](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L14)
|
|
4313
|
+
|
|
4314
|
+
when false, the Epub class refuses every mutation method at runtime
|
|
4315
|
+
|
|
4316
|
+
---
|
|
4317
|
+
|
|
4318
|
+
## FromOptions
|
|
4319
|
+
|
|
4320
|
+
Defined in: [libraries/epub/index.ts:201](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L201)
|
|
4321
|
+
|
|
4322
|
+
### Properties
|
|
4323
|
+
|
|
4324
|
+
#### readonly?
|
|
4325
|
+
|
|
4326
|
+
> `optional` **readonly**: `boolean`
|
|
4327
|
+
|
|
4328
|
+
Defined in: [libraries/epub/index.ts:206](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L206)
|
|
4329
|
+
|
|
4330
|
+
when true, mutation methods throw [EpubReadOnlyError](#epubreadonlyerror) at runtime
|
|
4331
|
+
|
|
4332
|
+
##### Default
|
|
4333
|
+
|
|
4334
|
+
```ts
|
|
4335
|
+
false;
|
|
4336
|
+
```
|
|
4337
|
+
|
|
4338
|
+
---
|
|
4339
|
+
|
|
4340
|
+
## Landmark
|
|
4341
|
+
|
|
4342
|
+
Defined in: [libraries/epub/upgrade.ts:63](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/upgrade.ts#L63)
|
|
4343
|
+
|
|
4344
|
+
### Properties
|
|
4345
|
+
|
|
4346
|
+
#### href
|
|
4347
|
+
|
|
4348
|
+
> **href**: `string`
|
|
4349
|
+
|
|
4350
|
+
Defined in: [libraries/epub/upgrade.ts:64](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/upgrade.ts#L64)
|
|
4351
|
+
|
|
4352
|
+
#### title
|
|
4353
|
+
|
|
4354
|
+
> **title**: `string`
|
|
4355
|
+
|
|
4356
|
+
Defined in: [libraries/epub/upgrade.ts:65](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/upgrade.ts#L65)
|
|
4357
|
+
|
|
4358
|
+
#### type
|
|
4359
|
+
|
|
4360
|
+
> **type**: `string`
|
|
4361
|
+
|
|
4362
|
+
Defined in: [libraries/epub/upgrade.ts:66](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/upgrade.ts#L66)
|
|
4363
|
+
|
|
4364
|
+
---
|
|
4365
|
+
|
|
4366
|
+
## MemoryAdapterOptions
|
|
4367
|
+
|
|
4368
|
+
Defined in: [libraries/epub/adapters/memory.ts:10](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L10)
|
|
4369
|
+
|
|
4370
|
+
### Properties
|
|
4371
|
+
|
|
4372
|
+
#### cache?
|
|
4373
|
+
|
|
4374
|
+
> `optional` **cache**: `boolean`
|
|
4375
|
+
|
|
4376
|
+
Defined in: [libraries/epub/adapters/memory.ts:17](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L17)
|
|
4377
|
+
|
|
4378
|
+
per-entry decompressed buffer cache
|
|
4379
|
+
turn it off when opening many EPUBs and reading each entry at most once
|
|
4380
|
+
keeps resident size bounded by the entry index, not the decompressed payload sum
|
|
4381
|
+
|
|
4382
|
+
##### Default
|
|
4383
|
+
|
|
4384
|
+
```ts
|
|
4385
|
+
true;
|
|
4386
|
+
```
|
|
4387
|
+
|
|
4388
|
+
#### signal?
|
|
4389
|
+
|
|
4390
|
+
> `optional` **signal**: `AbortSignal`
|
|
4391
|
+
|
|
4392
|
+
Defined in: [libraries/epub/adapters/memory.ts:18](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L18)
|
|
4393
|
+
|
|
4394
|
+
---
|
|
4395
|
+
|
|
4396
|
+
## Navigation
|
|
4397
|
+
|
|
4398
|
+
Defined in: [libraries/epub/index.ts:188](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L188)
|
|
4399
|
+
|
|
4400
|
+
### Properties
|
|
4401
|
+
|
|
4402
|
+
#### children
|
|
4403
|
+
|
|
4404
|
+
> **children**: [`NavigationList`](#navigationlist)
|
|
4405
|
+
|
|
4406
|
+
Defined in: [libraries/epub/index.ts:190](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L190)
|
|
4407
|
+
|
|
4408
|
+
#### title?
|
|
4409
|
+
|
|
4410
|
+
> `optional` **title**: `string`
|
|
4411
|
+
|
|
4412
|
+
Defined in: [libraries/epub/index.ts:189](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L189)
|
|
4413
|
+
|
|
4414
|
+
---
|
|
4415
|
+
|
|
4416
|
+
## NavigationItem
|
|
4417
|
+
|
|
4418
|
+
Defined in: [libraries/epub/index.ts:180](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L180)
|
|
4419
|
+
|
|
4420
|
+
### Properties
|
|
4421
|
+
|
|
4422
|
+
#### children?
|
|
4423
|
+
|
|
4424
|
+
> `optional` **children**: [`NavigationList`](#navigationlist)
|
|
4425
|
+
|
|
4426
|
+
Defined in: [libraries/epub/index.ts:183](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L183)
|
|
4427
|
+
|
|
4428
|
+
#### href?
|
|
4429
|
+
|
|
4430
|
+
> `optional` **href**: `string`
|
|
4431
|
+
|
|
4432
|
+
Defined in: [libraries/epub/index.ts:182](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L182)
|
|
4433
|
+
|
|
4434
|
+
#### title
|
|
4435
|
+
|
|
4436
|
+
> **title**: `string`
|
|
4437
|
+
|
|
4438
|
+
Defined in: [libraries/epub/index.ts:181](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L181)
|
|
4439
|
+
|
|
4440
|
+
---
|
|
4441
|
+
|
|
4442
|
+
## AdapterOptions\<A\>
|
|
4443
|
+
|
|
4444
|
+
> **AdapterOptions**\<`A`\> = `A` _extends_ [`EpubStorageAdapterClass`](#epubstorageadapterclass)\<infer Opts\> ? `Opts` : `object`
|
|
4445
|
+
|
|
4446
|
+
Defined in: [libraries/epub/adapters/interface.ts:88](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L88)
|
|
4447
|
+
|
|
4448
|
+
### Type Parameters
|
|
4449
|
+
|
|
4450
|
+
| Type Parameter |
|
|
4451
|
+
| -------------- |
|
|
4452
|
+
| `A` |
|
|
4453
|
+
|
|
4454
|
+
---
|
|
4455
|
+
|
|
4456
|
+
## ElementName
|
|
4457
|
+
|
|
4458
|
+
> **ElementName** = \`$\{Letter \| Uppercase\<Letter\> \| QuestionMark\}$\{string\}\`
|
|
4459
|
+
|
|
4460
|
+
Defined in: [libraries/epub/index.ts:78](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L78)
|
|
4461
|
+
|
|
4462
|
+
A valid name for an XML element (must start with a letter)
|
|
4463
|
+
|
|
4464
|
+
---
|
|
4465
|
+
|
|
4466
|
+
## EpubInstanceFor\<A\>
|
|
4467
|
+
|
|
4468
|
+
> **EpubInstanceFor**\<`A`\> = `A`\[`"capabilities"`\]\[`"writable"`\] _extends_ `true` ? [`Epub`](#epub) : [`EpubReader`](#epubreader)
|
|
4469
|
+
|
|
4470
|
+
Defined in: [libraries/epub/index.ts:3594](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3594)
|
|
4471
|
+
|
|
4472
|
+
Resolves to [Epub](#epub) for writable adapters, [EpubReader](#epubreader) for read-only ones.
|
|
4473
|
+
|
|
4474
|
+
The conditional pivots on `capabilities.writable`, which must be a literal
|
|
4475
|
+
`true`/`false` on the adapter class (use `as const`) for inference to work.
|
|
4476
|
+
|
|
4477
|
+
### Type Parameters
|
|
4478
|
+
|
|
4479
|
+
| Type Parameter |
|
|
4480
|
+
| ------------------------------------------------------------------- |
|
|
4481
|
+
| `A` _extends_ [`EpubStorageAdapterClass`](#epubstorageadapterclass) |
|
|
4482
|
+
|
|
4483
|
+
---
|
|
4484
|
+
|
|
4485
|
+
## EpubMetadata
|
|
4486
|
+
|
|
4487
|
+
> **EpubMetadata** = [`MetadataEntry`](#metadataentry)[]
|
|
4488
|
+
|
|
4489
|
+
Defined in: [libraries/epub/index.ts:115](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L115)
|
|
4490
|
+
|
|
4491
|
+
---
|
|
4492
|
+
|
|
4493
|
+
## EpubReader
|
|
4494
|
+
|
|
4495
|
+
> **EpubReader** = `Pick`\<[`Epub`](#epub), `"storage"` \| `"findMetadataItem"` \| `"findAllMetadataItems"` \| `"resolveHref"` \| `"readFileContents"` \| `"readItemContents"` \| `"readXhtmlItemContents"` \| `"discardAndClose"` \| `Extract`\<keyof [`Epub`](#epub), `` `get${string}` ``\>\> & `Disposable`
|
|
4496
|
+
|
|
4497
|
+
Defined in: [libraries/epub/index.ts:213](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L213)
|
|
4498
|
+
|
|
4499
|
+
Read-only view of an EPUB
|
|
4500
|
+
Returned by Epub.using(MemoryAdapter).from(...) and by Epub.from(path, { readonly: true })
|
|
4501
|
+
|
|
4502
|
+
---
|
|
4503
|
+
|
|
4504
|
+
## EpubStorageKind
|
|
4505
|
+
|
|
4506
|
+
> **EpubStorageKind** = `"tmp-dir"` \| `"in-memory"` \| `string` & `object`
|
|
4507
|
+
|
|
4508
|
+
Defined in: [libraries/epub/adapters/interface.ts:10](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/interface.ts#L10)
|
|
4509
|
+
|
|
4510
|
+
Pluggable storage backend for an Epub instance
|
|
4511
|
+
|
|
4512
|
+
Built-in adapters:
|
|
4513
|
+
|
|
4514
|
+
- [TmpFsAdapter](#tmpfsadapter) extracts the archive to a tmp directory and
|
|
4515
|
+
supports the full read/write/save/upgrade
|
|
4516
|
+
- [MemoryAdapter](#memoryadapter) keeps an in-memory zip handle and supports
|
|
4517
|
+
reads only
|
|
4518
|
+
|
|
4519
|
+
---
|
|
4520
|
+
|
|
4521
|
+
## InMemoryEpubReader
|
|
4522
|
+
|
|
4523
|
+
> **InMemoryEpubReader** = [`EpubReader`](#epubreader) & `object`
|
|
4524
|
+
|
|
4525
|
+
Defined in: [libraries/epub/index.ts:231](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L231)
|
|
4526
|
+
|
|
4527
|
+
Readonly Epub-instance backed by an in-memory zip handle
|
|
4528
|
+
Returned by `Epub.using(MemoryAdapter).from(...)`
|
|
4529
|
+
|
|
4530
|
+
### Type Declaration
|
|
4531
|
+
|
|
4532
|
+
#### storage
|
|
4533
|
+
|
|
4534
|
+
> `readonly` **storage**: `"in-memory"`
|
|
4535
|
+
|
|
4536
|
+
---
|
|
4537
|
+
|
|
4538
|
+
## ManifestItem
|
|
4539
|
+
|
|
4540
|
+
> **ManifestItem** = `object`
|
|
4541
|
+
|
|
4542
|
+
Defined in: [libraries/epub/index.ts:99](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L99)
|
|
4543
|
+
|
|
4544
|
+
### Properties
|
|
4545
|
+
|
|
4546
|
+
#### fallback?
|
|
4547
|
+
|
|
4548
|
+
> `optional` **fallback**: `string`
|
|
4549
|
+
|
|
4550
|
+
Defined in: [libraries/epub/index.ts:103](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L103)
|
|
4551
|
+
|
|
4552
|
+
#### href
|
|
4553
|
+
|
|
4554
|
+
> **href**: `string`
|
|
4555
|
+
|
|
4556
|
+
Defined in: [libraries/epub/index.ts:101](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L101)
|
|
4557
|
+
|
|
4558
|
+
#### id
|
|
4559
|
+
|
|
4560
|
+
> **id**: `string`
|
|
4561
|
+
|
|
4562
|
+
Defined in: [libraries/epub/index.ts:100](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L100)
|
|
4563
|
+
|
|
4564
|
+
#### mediaOverlay?
|
|
4565
|
+
|
|
4566
|
+
> `optional` **mediaOverlay**: `string`
|
|
4567
|
+
|
|
4568
|
+
Defined in: [libraries/epub/index.ts:104](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L104)
|
|
4569
|
+
|
|
4570
|
+
#### mediaType?
|
|
4571
|
+
|
|
4572
|
+
> `optional` **mediaType**: `string`
|
|
4573
|
+
|
|
4574
|
+
Defined in: [libraries/epub/index.ts:102](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L102)
|
|
4575
|
+
|
|
4576
|
+
#### properties?
|
|
4577
|
+
|
|
4578
|
+
> `optional` **properties**: `string`[]
|
|
4579
|
+
|
|
4580
|
+
Defined in: [libraries/epub/index.ts:105](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L105)
|
|
4581
|
+
|
|
4582
|
+
---
|
|
4583
|
+
|
|
4584
|
+
## MetadataEntry
|
|
4585
|
+
|
|
4586
|
+
> **MetadataEntry** = `object`
|
|
4587
|
+
|
|
4588
|
+
Defined in: [libraries/epub/index.ts:108](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L108)
|
|
4589
|
+
|
|
4590
|
+
### Properties
|
|
4591
|
+
|
|
4592
|
+
#### id?
|
|
4593
|
+
|
|
4594
|
+
> `optional` **id**: `string`
|
|
4595
|
+
|
|
4596
|
+
Defined in: [libraries/epub/index.ts:109](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L109)
|
|
4597
|
+
|
|
4598
|
+
#### properties
|
|
4599
|
+
|
|
4600
|
+
> **properties**: `Record`\<`string`, `string`\>
|
|
4601
|
+
|
|
4602
|
+
Defined in: [libraries/epub/index.ts:111](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L111)
|
|
4603
|
+
|
|
4604
|
+
#### type
|
|
4605
|
+
|
|
4606
|
+
> **type**: [`ElementName`](#elementname)
|
|
4607
|
+
|
|
4608
|
+
Defined in: [libraries/epub/index.ts:110](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L110)
|
|
4609
|
+
|
|
4610
|
+
#### value
|
|
4611
|
+
|
|
4612
|
+
> **value**: `string` \| `undefined`
|
|
4613
|
+
|
|
4614
|
+
Defined in: [libraries/epub/index.ts:112](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L112)
|
|
4615
|
+
|
|
4616
|
+
---
|
|
4617
|
+
|
|
4618
|
+
## NavigationList
|
|
4619
|
+
|
|
4620
|
+
> **NavigationList** = [`NavigationItem`](#navigationitem)[]
|
|
4621
|
+
|
|
4622
|
+
Defined in: [libraries/epub/index.ts:186](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L186)
|
|
4623
|
+
|
|
4624
|
+
---
|
|
4625
|
+
|
|
4626
|
+
## PackageElement
|
|
4627
|
+
|
|
4628
|
+
> **PackageElement** = [`XmlElement`](#xmlelement)\<`"package"`\>
|
|
4629
|
+
|
|
4630
|
+
Defined in: [libraries/epub/index.ts:199](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L199)
|
|
4631
|
+
|
|
4632
|
+
---
|
|
4633
|
+
|
|
4634
|
+
## ParsedXml
|
|
4635
|
+
|
|
4636
|
+
> **ParsedXml** = [`XmlNode`](#xmlnode)[]
|
|
4637
|
+
|
|
4638
|
+
Defined in: [libraries/epub/index.ts:97](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L97)
|
|
4639
|
+
|
|
4640
|
+
An XML structure
|
|
4641
|
+
|
|
4642
|
+
---
|
|
4643
|
+
|
|
4644
|
+
## XmlElement\<Name\>
|
|
4645
|
+
|
|
4646
|
+
> **XmlElement**\<`Name`\> = `object` & `{ [key in Name]: ParsedXml }`
|
|
4647
|
+
|
|
4648
|
+
Defined in: [libraries/epub/index.ts:84](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L84)
|
|
4649
|
+
|
|
4650
|
+
An XML element
|
|
4651
|
+
|
|
4652
|
+
### Type Declaration
|
|
4653
|
+
|
|
4654
|
+
#### :@?
|
|
4655
|
+
|
|
4656
|
+
> `optional` **:@**: `Record`\<`` `${PropertyPrefix}${string}` ``, `string`\>
|
|
4657
|
+
|
|
4658
|
+
### Type Parameters
|
|
4659
|
+
|
|
4660
|
+
| Type Parameter | Default type |
|
|
4661
|
+
| ---------------------------------------------- | ----------------------------- |
|
|
4662
|
+
| `Name` _extends_ [`ElementName`](#elementname) | [`ElementName`](#elementname) |
|
|
4663
|
+
|
|
4664
|
+
---
|
|
4665
|
+
|
|
4666
|
+
## XmlNode
|
|
4667
|
+
|
|
4668
|
+
> **XmlNode** = [`XmlElement`](#xmlelement) \| [`XmlTextNode`](#xmltextnode)
|
|
4669
|
+
|
|
4670
|
+
Defined in: [libraries/epub/index.ts:94](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L94)
|
|
4671
|
+
|
|
4672
|
+
A valid XML node. May be either an element or a text node.
|
|
4673
|
+
|
|
4674
|
+
---
|
|
4675
|
+
|
|
4676
|
+
## XmlTextNode
|
|
4677
|
+
|
|
4678
|
+
> **XmlTextNode** = `object`
|
|
4679
|
+
|
|
4680
|
+
Defined in: [libraries/epub/index.ts:91](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L91)
|
|
4681
|
+
|
|
4682
|
+
A text node in an XML document
|
|
4683
|
+
|
|
4684
|
+
### Properties
|
|
4685
|
+
|
|
4686
|
+
#### #text
|
|
4687
|
+
|
|
4688
|
+
> **#text**: `string`
|
|
4689
|
+
|
|
4690
|
+
Defined in: [libraries/epub/index.ts:91](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L91)
|