@storyteller-platform/epub 0.3.1 → 0.4.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 +190 -463
- package/dist/index.cjs +35 -13
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +36 -14
- package/package.json +9 -13
- package/dist/node.cjs +0 -65
- package/dist/node.d.cts +0 -24
- package/dist/node.d.ts +0 -24
- package/dist/node.js +0 -43
package/README.md
CHANGED
|
@@ -220,91 +220,112 @@ To get started with developing in the Storyteller monorepo, check out the
|
|
|
220
220
|
## Epub
|
|
221
221
|
|
|
222
222
|
Defined in:
|
|
223
|
-
[epub/
|
|
223
|
+
[epub/index.ts:164](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L164)
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
A single EPUB instance.
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
The entire EPUB contents will be read into memory.
|
|
228
|
+
|
|
229
|
+
Example usage:
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
import {
|
|
233
|
+
Epub,
|
|
234
|
+
getBody,
|
|
235
|
+
findByName,
|
|
236
|
+
textContent,
|
|
237
|
+
} from "@storyteller-platform/epub"
|
|
238
|
+
|
|
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)
|
|
244
|
+
|
|
245
|
+
const body = getBody(chptOneXml)
|
|
246
|
+
const h1 = Epub.findXmlChildByName("h1", body)
|
|
247
|
+
const headingText = textContent(h1)
|
|
248
|
+
|
|
249
|
+
await epub.setTitle(headingText)
|
|
250
|
+
await epub.writeToFile("./path/to/updated.epub")
|
|
251
|
+
await epub.close()
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Link
|
|
255
|
+
|
|
256
|
+
https://www.w3.org/TR/epub-33/
|
|
228
257
|
|
|
229
258
|
### Constructors
|
|
230
259
|
|
|
231
260
|
#### Constructor
|
|
232
261
|
|
|
233
|
-
> `protected` **new Epub**(`zipFs`): [`Epub`](#epub)
|
|
262
|
+
> `protected` **new Epub**(`zipFs`, `zipPath`, `inputPath`): [`Epub`](#epub)
|
|
234
263
|
|
|
235
264
|
Defined in:
|
|
236
|
-
[epub/index.ts:
|
|
265
|
+
[epub/index.ts:368](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L368)
|
|
237
266
|
|
|
238
267
|
##### Parameters
|
|
239
268
|
|
|
240
|
-
| Parameter
|
|
241
|
-
|
|
|
242
|
-
| `zipFs`
|
|
269
|
+
| Parameter | Type |
|
|
270
|
+
| ----------- | ----------------------- |
|
|
271
|
+
| `zipFs` | `ZipFS` |
|
|
272
|
+
| `zipPath` | `NativePath` |
|
|
273
|
+
| `inputPath` | `undefined` \| `string` |
|
|
243
274
|
|
|
244
275
|
##### Returns
|
|
245
276
|
|
|
246
277
|
[`Epub`](#epub)
|
|
247
278
|
|
|
248
|
-
|
|
279
|
+
### Properties
|
|
249
280
|
|
|
250
|
-
|
|
281
|
+
#### inputPath
|
|
251
282
|
|
|
252
|
-
|
|
283
|
+
> `protected` **inputPath**: `undefined` \| `string`
|
|
284
|
+
|
|
285
|
+
Defined in:
|
|
286
|
+
[epub/index.ts:371](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L371)
|
|
253
287
|
|
|
254
288
|
#### zipFs
|
|
255
289
|
|
|
256
290
|
> `protected` **zipFs**: `ZipFS`
|
|
257
291
|
|
|
258
292
|
Defined in:
|
|
259
|
-
[epub/index.ts:
|
|
293
|
+
[epub/index.ts:369](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L369)
|
|
260
294
|
|
|
261
|
-
|
|
295
|
+
#### zipPath
|
|
262
296
|
|
|
263
|
-
`
|
|
297
|
+
> `protected` **zipPath**: `NativePath`
|
|
298
|
+
|
|
299
|
+
Defined in:
|
|
300
|
+
[epub/index.ts:370](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L370)
|
|
264
301
|
|
|
265
302
|
#### xhtmlBuilder
|
|
266
303
|
|
|
267
304
|
> `static` **xhtmlBuilder**: `XMLBuilder`
|
|
268
305
|
|
|
269
306
|
Defined in:
|
|
270
|
-
[epub/index.ts:
|
|
271
|
-
|
|
272
|
-
##### Inherited from
|
|
273
|
-
|
|
274
|
-
`BaseEpub.xhtmlBuilder`
|
|
307
|
+
[epub/index.ts:204](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L204)
|
|
275
308
|
|
|
276
309
|
#### xhtmlParser
|
|
277
310
|
|
|
278
311
|
> `static` **xhtmlParser**: `XMLParser`
|
|
279
312
|
|
|
280
313
|
Defined in:
|
|
281
|
-
[epub/index.ts:
|
|
282
|
-
|
|
283
|
-
##### Inherited from
|
|
284
|
-
|
|
285
|
-
`BaseEpub.xhtmlParser`
|
|
314
|
+
[epub/index.ts:172](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L172)
|
|
286
315
|
|
|
287
316
|
#### xmlBuilder
|
|
288
317
|
|
|
289
318
|
> `static` **xmlBuilder**: `XMLBuilder`
|
|
290
319
|
|
|
291
320
|
Defined in:
|
|
292
|
-
[epub/index.ts:
|
|
293
|
-
|
|
294
|
-
##### Inherited from
|
|
295
|
-
|
|
296
|
-
`BaseEpub.xmlBuilder`
|
|
321
|
+
[epub/index.ts:197](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L197)
|
|
297
322
|
|
|
298
323
|
#### xmlParser
|
|
299
324
|
|
|
300
325
|
> `static` **xmlParser**: `XMLParser`
|
|
301
326
|
|
|
302
327
|
Defined in:
|
|
303
|
-
[epub/index.ts:
|
|
304
|
-
|
|
305
|
-
##### Inherited from
|
|
306
|
-
|
|
307
|
-
`BaseEpub.xmlParser`
|
|
328
|
+
[epub/index.ts:165](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L165)
|
|
308
329
|
|
|
309
330
|
### Methods
|
|
310
331
|
|
|
@@ -313,22 +334,18 @@ Defined in:
|
|
|
313
334
|
> **\[dispose\]**(): `void`
|
|
314
335
|
|
|
315
336
|
Defined in:
|
|
316
|
-
[epub/index.ts:
|
|
337
|
+
[epub/index.ts:2445](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2445)
|
|
317
338
|
|
|
318
339
|
##### Returns
|
|
319
340
|
|
|
320
341
|
`void`
|
|
321
342
|
|
|
322
|
-
##### Inherited from
|
|
323
|
-
|
|
324
|
-
`BaseEpub.[dispose]`
|
|
325
|
-
|
|
326
343
|
#### addCollection()
|
|
327
344
|
|
|
328
345
|
> **addCollection**(`collection`, `index?`): `Promise`\<`void`\>
|
|
329
346
|
|
|
330
347
|
Defined in:
|
|
331
|
-
[epub/index.ts:
|
|
348
|
+
[epub/index.ts:1494](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1494)
|
|
332
349
|
|
|
333
350
|
Add a collection to the EPUB metadata.
|
|
334
351
|
|
|
@@ -346,16 +363,12 @@ collections. Otherwise, it will be added to the end of the list.
|
|
|
346
363
|
|
|
347
364
|
`Promise`\<`void`\>
|
|
348
365
|
|
|
349
|
-
##### Inherited from
|
|
350
|
-
|
|
351
|
-
`BaseEpub.addCollection`
|
|
352
|
-
|
|
353
366
|
#### addContributor()
|
|
354
367
|
|
|
355
368
|
> **addContributor**(`contributor`, `index?`): `Promise`\<`void`\>
|
|
356
369
|
|
|
357
370
|
Defined in:
|
|
358
|
-
[epub/index.ts:
|
|
371
|
+
[epub/index.ts:1836](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1836)
|
|
359
372
|
|
|
360
373
|
Add a contributor to the EPUB metadata.
|
|
361
374
|
|
|
@@ -380,16 +393,12 @@ This is a convenience method for
|
|
|
380
393
|
|
|
381
394
|
https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
382
395
|
|
|
383
|
-
##### Inherited from
|
|
384
|
-
|
|
385
|
-
`BaseEpub.addContributor`
|
|
386
|
-
|
|
387
396
|
#### addCreator()
|
|
388
397
|
|
|
389
398
|
> **addCreator**(`creator`, `index?`, `type?`): `Promise`\<`void`\>
|
|
390
399
|
|
|
391
400
|
Defined in:
|
|
392
|
-
[epub/index.ts:
|
|
401
|
+
[epub/index.ts:1681](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1681)
|
|
393
402
|
|
|
394
403
|
Add a creator to the EPUB metadata.
|
|
395
404
|
|
|
@@ -412,10 +421,6 @@ creators. Otherwise, it will be added to the end of the list.
|
|
|
412
421
|
|
|
413
422
|
https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
414
423
|
|
|
415
|
-
##### Inherited from
|
|
416
|
-
|
|
417
|
-
`BaseEpub.addCreator`
|
|
418
|
-
|
|
419
424
|
#### addManifestItem()
|
|
420
425
|
|
|
421
426
|
##### Call Signature
|
|
@@ -423,7 +428,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
423
428
|
> **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
424
429
|
|
|
425
430
|
Defined in:
|
|
426
|
-
[epub/index.ts:
|
|
431
|
+
[epub/index.ts:2163](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2163)
|
|
427
432
|
|
|
428
433
|
Create a new manifest item and write its contents to a new entry.
|
|
429
434
|
|
|
@@ -447,16 +452,12 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
447
452
|
|
|
448
453
|
https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
449
454
|
|
|
450
|
-
###### Inherited from
|
|
451
|
-
|
|
452
|
-
`BaseEpub.addManifestItem`
|
|
453
|
-
|
|
454
455
|
##### Call Signature
|
|
455
456
|
|
|
456
457
|
> **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
457
458
|
|
|
458
459
|
Defined in:
|
|
459
|
-
[epub/index.ts:
|
|
460
|
+
[epub/index.ts:2168](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2168)
|
|
460
461
|
|
|
461
462
|
Create a new manifest item and write its contents to a new entry.
|
|
462
463
|
|
|
@@ -480,16 +481,12 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
480
481
|
|
|
481
482
|
https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
482
483
|
|
|
483
|
-
###### Inherited from
|
|
484
|
-
|
|
485
|
-
`BaseEpub.addManifestItem`
|
|
486
|
-
|
|
487
484
|
##### Call Signature
|
|
488
485
|
|
|
489
486
|
> **addManifestItem**(`item`, `contents`): `Promise`\<`void`\>
|
|
490
487
|
|
|
491
488
|
Defined in:
|
|
492
|
-
[epub/index.ts:
|
|
489
|
+
[epub/index.ts:2173](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2173)
|
|
493
490
|
|
|
494
491
|
Create a new manifest item and write its contents to a new entry.
|
|
495
492
|
|
|
@@ -512,16 +509,12 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
512
509
|
|
|
513
510
|
https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
514
511
|
|
|
515
|
-
###### Inherited from
|
|
516
|
-
|
|
517
|
-
`BaseEpub.addManifestItem`
|
|
518
|
-
|
|
519
512
|
#### addMetadata()
|
|
520
513
|
|
|
521
514
|
> **addMetadata**(`entry`): `Promise`\<`void`\>
|
|
522
515
|
|
|
523
516
|
Defined in:
|
|
524
|
-
[epub/index.ts:
|
|
517
|
+
[epub/index.ts:2285](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2285)
|
|
525
518
|
|
|
526
519
|
Add a new metadata entry to the Epub.
|
|
527
520
|
|
|
@@ -543,16 +536,12 @@ useful semantic representations of metadata, use specific methods such as
|
|
|
543
536
|
|
|
544
537
|
https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
545
538
|
|
|
546
|
-
##### Inherited from
|
|
547
|
-
|
|
548
|
-
`BaseEpub.addMetadata`
|
|
549
|
-
|
|
550
539
|
#### addSpineItem()
|
|
551
540
|
|
|
552
541
|
> **addSpineItem**(`manifestId`, `index?`): `Promise`\<`void`\>
|
|
553
542
|
|
|
554
543
|
Defined in:
|
|
555
|
-
[epub/index.ts:
|
|
544
|
+
[epub/index.ts:1890](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1890)
|
|
556
545
|
|
|
557
546
|
Add an item to the spine of the EPUB.
|
|
558
547
|
|
|
@@ -577,16 +566,12 @@ throw an error.
|
|
|
577
566
|
|
|
578
567
|
https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
579
568
|
|
|
580
|
-
##### Inherited from
|
|
581
|
-
|
|
582
|
-
`BaseEpub.addSpineItem`
|
|
583
|
-
|
|
584
569
|
#### addSubject()
|
|
585
570
|
|
|
586
571
|
> **addSubject**(`subject`): `Promise`\<`void`\>
|
|
587
572
|
|
|
588
573
|
Defined in:
|
|
589
|
-
[epub/index.ts:
|
|
574
|
+
[epub/index.ts:1027](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1027)
|
|
590
575
|
|
|
591
576
|
Add a subject to the EPUB metadata.
|
|
592
577
|
|
|
@@ -604,10 +589,6 @@ Add a subject to the EPUB metadata.
|
|
|
604
589
|
|
|
605
590
|
https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
|
|
606
591
|
|
|
607
|
-
##### Inherited from
|
|
608
|
-
|
|
609
|
-
`BaseEpub.addSubject`
|
|
610
|
-
|
|
611
592
|
#### createXhtmlDocument()
|
|
612
593
|
|
|
613
594
|
> **createXhtmlDocument**(`body`, `head?`, `language?`):
|
|
@@ -615,7 +596,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
|
|
|
615
596
|
> [`XmlElement`](#xmlelement)\<`"?xml"`\>)[]\>
|
|
616
597
|
|
|
617
598
|
Defined in:
|
|
618
|
-
[epub/index.ts:
|
|
599
|
+
[epub/index.ts:1991](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1991)
|
|
619
600
|
|
|
620
601
|
Create a new XHTML document with the given body and head.
|
|
621
602
|
|
|
@@ -632,31 +613,23 @@ Create a new XHTML document with the given body and head.
|
|
|
632
613
|
`Promise`\<([`XmlElement`](#xmlelement)\<`"html"`\> \|
|
|
633
614
|
[`XmlElement`](#xmlelement)\<`"?xml"`\>)[]\>
|
|
634
615
|
|
|
635
|
-
##### Inherited from
|
|
636
|
-
|
|
637
|
-
`BaseEpub.createXhtmlDocument`
|
|
638
|
-
|
|
639
616
|
#### discardAndClose()
|
|
640
617
|
|
|
641
618
|
> **discardAndClose**(): `void`
|
|
642
619
|
|
|
643
620
|
Defined in:
|
|
644
|
-
[epub/index.ts:
|
|
621
|
+
[epub/index.ts:2394](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2394)
|
|
645
622
|
|
|
646
623
|
##### Returns
|
|
647
624
|
|
|
648
625
|
`void`
|
|
649
626
|
|
|
650
|
-
##### Inherited from
|
|
651
|
-
|
|
652
|
-
`BaseEpub.discardAndClose`
|
|
653
|
-
|
|
654
627
|
#### findAllMetadataItems()
|
|
655
628
|
|
|
656
629
|
> **findAllMetadataItems**(`predicate`): `Promise`\<`object`[]\>
|
|
657
630
|
|
|
658
631
|
Defined in:
|
|
659
|
-
[epub/index.ts:
|
|
632
|
+
[epub/index.ts:750](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L750)
|
|
660
633
|
|
|
661
634
|
Returns the item in the metadata element's children array that matches the
|
|
662
635
|
provided predicate.
|
|
@@ -671,10 +644,6 @@ provided predicate.
|
|
|
671
644
|
|
|
672
645
|
`Promise`\<`object`[]\>
|
|
673
646
|
|
|
674
|
-
##### Inherited from
|
|
675
|
-
|
|
676
|
-
`BaseEpub.findAllMetadataItems`
|
|
677
|
-
|
|
678
647
|
#### findMetadataItem()
|
|
679
648
|
|
|
680
649
|
> **findMetadataItem**(`predicate`): `Promise`\<`null` \| \{ `id`: `undefined`
|
|
@@ -700,7 +669,7 @@ provided predicate.
|
|
|
700
669
|
> \}\>
|
|
701
670
|
|
|
702
671
|
Defined in:
|
|
703
|
-
[epub/index.ts:
|
|
672
|
+
[epub/index.ts:741](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L741)
|
|
704
673
|
|
|
705
674
|
Returns the item in the metadata element's children array that matches the
|
|
706
675
|
provided predicate.
|
|
@@ -734,36 +703,12 @@ provided predicate.
|
|
|
734
703
|
`` `Y${string}` `` \| `` `Z${string}` `` \| `` `?${string}` ``; `value`:
|
|
735
704
|
`undefined` \| `string`; \}\>
|
|
736
705
|
|
|
737
|
-
##### Inherited from
|
|
738
|
-
|
|
739
|
-
`BaseEpub.findMetadataItem`
|
|
740
|
-
|
|
741
|
-
#### getArrayAndClose()
|
|
742
|
-
|
|
743
|
-
> **getArrayAndClose**(): `Promise`\<`Buffer`\<`ArrayBufferLike`\>\>
|
|
744
|
-
|
|
745
|
-
Defined in:
|
|
746
|
-
[epub/index.ts:2388](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2388)
|
|
747
|
-
|
|
748
|
-
Write the current contents of the Epub to a new Uint8Array.
|
|
749
|
-
|
|
750
|
-
When this method is called, the "dcterms:modified" meta tag is automatically
|
|
751
|
-
updated to the current UTC timestamp.
|
|
752
|
-
|
|
753
|
-
##### Returns
|
|
754
|
-
|
|
755
|
-
`Promise`\<`Buffer`\<`ArrayBufferLike`\>\>
|
|
756
|
-
|
|
757
|
-
##### Inherited from
|
|
758
|
-
|
|
759
|
-
`BaseEpub.getArrayAndClose`
|
|
760
|
-
|
|
761
706
|
#### getCollections()
|
|
762
707
|
|
|
763
708
|
> **getCollections**(): `Promise`\<[`Collection`](#collection)[]\>
|
|
764
709
|
|
|
765
710
|
Defined in:
|
|
766
|
-
[epub/index.ts:
|
|
711
|
+
[epub/index.ts:1454](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1454)
|
|
767
712
|
|
|
768
713
|
Retrieve the list of collections.
|
|
769
714
|
|
|
@@ -771,16 +716,12 @@ Retrieve the list of collections.
|
|
|
771
716
|
|
|
772
717
|
`Promise`\<[`Collection`](#collection)[]\>
|
|
773
718
|
|
|
774
|
-
##### Inherited from
|
|
775
|
-
|
|
776
|
-
`BaseEpub.getCollections`
|
|
777
|
-
|
|
778
719
|
#### getContributors()
|
|
779
720
|
|
|
780
721
|
> **getContributors**(): `Promise`\<[`DcCreator`](#dccreator)[]\>
|
|
781
722
|
|
|
782
723
|
Defined in:
|
|
783
|
-
[epub/index.ts:
|
|
724
|
+
[epub/index.ts:1668](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1668)
|
|
784
725
|
|
|
785
726
|
Retrieve the list of contributors.
|
|
786
727
|
|
|
@@ -794,16 +735,12 @@ This is a convenience method for `epub.getCreators('contributor')`.
|
|
|
794
735
|
|
|
795
736
|
https://www.w3.org/TR/epub-33/#sec-opf-dccontributor
|
|
796
737
|
|
|
797
|
-
##### Inherited from
|
|
798
|
-
|
|
799
|
-
`BaseEpub.getContributors`
|
|
800
|
-
|
|
801
738
|
#### getCoverImage()
|
|
802
739
|
|
|
803
740
|
> **getCoverImage**(): `Promise`\<`null` \| `Uint8Array`\<`ArrayBufferLike`\>\>
|
|
804
741
|
|
|
805
742
|
Defined in:
|
|
806
|
-
[epub/index.ts:
|
|
743
|
+
[epub/index.ts:930](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L930)
|
|
807
744
|
|
|
808
745
|
Retrieve the cover image data as a byte array.
|
|
809
746
|
|
|
@@ -818,17 +755,13 @@ retrieve the image manifest item, use epub.getCoverImageItem().
|
|
|
818
755
|
|
|
819
756
|
https://www.w3.org/TR/epub-33/#sec-cover-image
|
|
820
757
|
|
|
821
|
-
##### Inherited from
|
|
822
|
-
|
|
823
|
-
`BaseEpub.getCoverImage`
|
|
824
|
-
|
|
825
758
|
#### getCoverImageItem()
|
|
826
759
|
|
|
827
760
|
> **getCoverImageItem**(): `Promise`\<`null` \|
|
|
828
761
|
> [`ManifestItem`](#manifestitem)\>
|
|
829
762
|
|
|
830
763
|
Defined in:
|
|
831
|
-
[epub/index.ts:
|
|
764
|
+
[epub/index.ts:911](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L911)
|
|
832
765
|
|
|
833
766
|
Retrieve the cover image manifest item.
|
|
834
767
|
|
|
@@ -843,16 +776,12 @@ this item's id to epub.readItemContents, or use epub.getCoverImage() instead.
|
|
|
843
776
|
|
|
844
777
|
https://www.w3.org/TR/epub-33/#sec-cover-image
|
|
845
778
|
|
|
846
|
-
##### Inherited from
|
|
847
|
-
|
|
848
|
-
`BaseEpub.getCoverImageItem`
|
|
849
|
-
|
|
850
779
|
#### getCreators()
|
|
851
780
|
|
|
852
781
|
> **getCreators**(`type`): `Promise`\<[`DcCreator`](#dccreator)[]\>
|
|
853
782
|
|
|
854
783
|
Defined in:
|
|
855
|
-
[epub/index.ts:
|
|
784
|
+
[epub/index.ts:1607](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1607)
|
|
856
785
|
|
|
857
786
|
Retrieve the list of creators.
|
|
858
787
|
|
|
@@ -870,16 +799,12 @@ Retrieve the list of creators.
|
|
|
870
799
|
|
|
871
800
|
https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
872
801
|
|
|
873
|
-
##### Inherited from
|
|
874
|
-
|
|
875
|
-
`BaseEpub.getCreators`
|
|
876
|
-
|
|
877
802
|
#### getDescription()
|
|
878
803
|
|
|
879
804
|
> **getDescription**(): `Promise`\<`null` \| `string`\>
|
|
880
805
|
|
|
881
806
|
Defined in:
|
|
882
|
-
[epub/index.ts:
|
|
807
|
+
[epub/index.ts:1305](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1305)
|
|
883
808
|
|
|
884
809
|
Retrieve the Epub's description as specified in its package document metadata.
|
|
885
810
|
|
|
@@ -890,16 +815,12 @@ as a string. Descriptions may include HTML markup.
|
|
|
890
815
|
|
|
891
816
|
`Promise`\<`null` \| `string`\>
|
|
892
817
|
|
|
893
|
-
##### Inherited from
|
|
894
|
-
|
|
895
|
-
`BaseEpub.getDescription`
|
|
896
|
-
|
|
897
818
|
#### getIdentifier()
|
|
898
819
|
|
|
899
820
|
> **getIdentifier**(): `Promise`\<`null` \| `string`\>
|
|
900
821
|
|
|
901
822
|
Defined in:
|
|
902
|
-
[epub/index.ts:
|
|
823
|
+
[epub/index.ts:845](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L845)
|
|
903
824
|
|
|
904
825
|
Retrieve the identifier from the dc:identifier element in the EPUB metadata.
|
|
905
826
|
|
|
@@ -913,16 +834,12 @@ If there is no dc:identifier element, returns null.
|
|
|
913
834
|
|
|
914
835
|
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
915
836
|
|
|
916
|
-
##### Inherited from
|
|
917
|
-
|
|
918
|
-
`BaseEpub.getIdentifier`
|
|
919
|
-
|
|
920
837
|
#### getLanguage()
|
|
921
838
|
|
|
922
839
|
> **getLanguage**(): `Promise`\<`null` \| `Locale`\>
|
|
923
840
|
|
|
924
841
|
Defined in:
|
|
925
|
-
[epub/index.ts:
|
|
842
|
+
[epub/index.ts:1146](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1146)
|
|
926
843
|
|
|
927
844
|
Retrieve the Epub's language as specified in its package document metadata.
|
|
928
845
|
|
|
@@ -937,17 +854,13 @@ Intl.Locale instance.
|
|
|
937
854
|
|
|
938
855
|
https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
|
|
939
856
|
|
|
940
|
-
##### Inherited from
|
|
941
|
-
|
|
942
|
-
`BaseEpub.getLanguage`
|
|
943
|
-
|
|
944
857
|
#### getManifest()
|
|
945
858
|
|
|
946
859
|
> **getManifest**(): `Promise`\<`Record`\<`string`,
|
|
947
860
|
> [`ManifestItem`](#manifestitem)\>\>
|
|
948
861
|
|
|
949
862
|
Defined in:
|
|
950
|
-
[epub/index.ts:
|
|
863
|
+
[epub/index.ts:666](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L666)
|
|
951
864
|
|
|
952
865
|
Retrieve the manifest for the Epub.
|
|
953
866
|
|
|
@@ -962,16 +875,12 @@ properties.
|
|
|
962
875
|
|
|
963
876
|
https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
964
877
|
|
|
965
|
-
##### Inherited from
|
|
966
|
-
|
|
967
|
-
`BaseEpub.getManifest`
|
|
968
|
-
|
|
969
878
|
#### getMetadata()
|
|
970
879
|
|
|
971
880
|
> **getMetadata**(): `Promise`\<[`EpubMetadata`](#epubmetadata)\>
|
|
972
881
|
|
|
973
882
|
Defined in:
|
|
974
|
-
[epub/index.ts:
|
|
883
|
+
[epub/index.ts:817](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L817)
|
|
975
884
|
|
|
976
885
|
Retrieve the metadata entries for the Epub.
|
|
977
886
|
|
|
@@ -989,17 +898,13 @@ as `getTitle()` and `getAuthors()`.
|
|
|
989
898
|
|
|
990
899
|
https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
991
900
|
|
|
992
|
-
##### Inherited from
|
|
993
|
-
|
|
994
|
-
`BaseEpub.getMetadata`
|
|
995
|
-
|
|
996
901
|
#### getPackageVocabularyPrefixes()
|
|
997
902
|
|
|
998
903
|
> **getPackageVocabularyPrefixes**(): `Promise`\<`Record`\<`string`,
|
|
999
904
|
> `string`\>\>
|
|
1000
905
|
|
|
1001
906
|
Defined in:
|
|
1002
|
-
[epub/index.ts:
|
|
907
|
+
[epub/index.ts:1322](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1322)
|
|
1003
908
|
|
|
1004
909
|
Return the set of custom vocabulary prefixes set on this publication's root
|
|
1005
910
|
package element.
|
|
@@ -1014,16 +919,12 @@ Returns a map from prefix to URI
|
|
|
1014
919
|
|
|
1015
920
|
https://www.w3.org/TR/epub-33/#sec-prefix-attr
|
|
1016
921
|
|
|
1017
|
-
##### Inherited from
|
|
1018
|
-
|
|
1019
|
-
`BaseEpub.getPackageVocabularyPrefixes`
|
|
1020
|
-
|
|
1021
922
|
#### getPublicationDate()
|
|
1022
923
|
|
|
1023
924
|
> **getPublicationDate**(): `Promise`\<`null` \| `Date`\>
|
|
1024
925
|
|
|
1025
926
|
Defined in:
|
|
1026
|
-
[epub/index.ts:
|
|
927
|
+
[epub/index.ts:967](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L967)
|
|
1027
928
|
|
|
1028
929
|
Retrieve the publication date from the dc:date element in the EPUB metadata as a
|
|
1029
930
|
Date object.
|
|
@@ -1038,16 +939,12 @@ If there is no dc:date element, returns null.
|
|
|
1038
939
|
|
|
1039
940
|
https://www.w3.org/TR/epub-33/#sec-opf-dcdate
|
|
1040
941
|
|
|
1041
|
-
##### Inherited from
|
|
1042
|
-
|
|
1043
|
-
`BaseEpub.getPublicationDate`
|
|
1044
|
-
|
|
1045
942
|
#### getSpineItems()
|
|
1046
943
|
|
|
1047
944
|
> **getSpineItems**(): `Promise`\<[`ManifestItem`](#manifestitem)[]\>
|
|
1048
945
|
|
|
1049
946
|
Defined in:
|
|
1050
|
-
[epub/index.ts:
|
|
947
|
+
[epub/index.ts:1871](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1871)
|
|
1051
948
|
|
|
1052
949
|
Retrieve the manifest items that make up the Epub's spine.
|
|
1053
950
|
|
|
@@ -1062,16 +959,12 @@ to users by default.
|
|
|
1062
959
|
|
|
1063
960
|
https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
1064
961
|
|
|
1065
|
-
##### Inherited from
|
|
1066
|
-
|
|
1067
|
-
`BaseEpub.getSpineItems`
|
|
1068
|
-
|
|
1069
962
|
#### getSubjects()
|
|
1070
963
|
|
|
1071
964
|
> **getSubjects**(): `Promise`\<(`string` \| [`DcSubject`](#dcsubject))[]\>
|
|
1072
965
|
|
|
1073
966
|
Defined in:
|
|
1074
|
-
[epub/index.ts:
|
|
967
|
+
[epub/index.ts:1101](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1101)
|
|
1075
968
|
|
|
1076
969
|
Retrieve the list of subjects for this EPUB.
|
|
1077
970
|
|
|
@@ -1087,16 +980,12 @@ authority, and term.
|
|
|
1087
980
|
|
|
1088
981
|
https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
|
|
1089
982
|
|
|
1090
|
-
##### Inherited from
|
|
1091
|
-
|
|
1092
|
-
`BaseEpub.getSubjects`
|
|
1093
|
-
|
|
1094
983
|
#### getSubtitle()
|
|
1095
984
|
|
|
1096
985
|
> **getSubtitle**(): `Promise`\<`null` \| `string`\>
|
|
1097
986
|
|
|
1098
987
|
Defined in:
|
|
1099
|
-
[epub/index.ts:
|
|
988
|
+
[epub/index.ts:1212](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1212)
|
|
1100
989
|
|
|
1101
990
|
Retrieve the subtitle of the Epub, if it exists.
|
|
1102
991
|
|
|
@@ -1108,16 +997,12 @@ Retrieve the subtitle of the Epub, if it exists.
|
|
|
1108
997
|
|
|
1109
998
|
https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
1110
999
|
|
|
1111
|
-
##### Inherited from
|
|
1112
|
-
|
|
1113
|
-
`BaseEpub.getSubtitle`
|
|
1114
|
-
|
|
1115
1000
|
#### getTitle()
|
|
1116
1001
|
|
|
1117
1002
|
> **getTitle**(`expanded`): `Promise`\<`null` \| `string`\>
|
|
1118
1003
|
|
|
1119
1004
|
Defined in:
|
|
1120
|
-
[epub/index.ts:
|
|
1005
|
+
[epub/index.ts:1188](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1188)
|
|
1121
1006
|
|
|
1122
1007
|
Retrieve the title of the Epub.
|
|
1123
1008
|
|
|
@@ -1135,16 +1020,12 @@ Retrieve the title of the Epub.
|
|
|
1135
1020
|
|
|
1136
1021
|
https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
1137
1022
|
|
|
1138
|
-
##### Inherited from
|
|
1139
|
-
|
|
1140
|
-
`BaseEpub.getTitle`
|
|
1141
|
-
|
|
1142
1023
|
#### getTitles()
|
|
1143
1024
|
|
|
1144
1025
|
> **getTitles**(): `Promise`\<`object`[]\>
|
|
1145
1026
|
|
|
1146
1027
|
Defined in:
|
|
1147
|
-
[epub/index.ts:
|
|
1028
|
+
[epub/index.ts:1224](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1224)
|
|
1148
1029
|
|
|
1149
1030
|
Retrieve all title entries of the Epub.
|
|
1150
1031
|
|
|
@@ -1156,16 +1037,12 @@ Retrieve all title entries of the Epub.
|
|
|
1156
1037
|
|
|
1157
1038
|
https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
1158
1039
|
|
|
1159
|
-
##### Inherited from
|
|
1160
|
-
|
|
1161
|
-
`BaseEpub.getTitles`
|
|
1162
|
-
|
|
1163
1040
|
#### getType()
|
|
1164
1041
|
|
|
1165
1042
|
> **getType**(): `Promise`\<`null` \| [`MetadataEntry`](#metadataentry)\>
|
|
1166
1043
|
|
|
1167
1044
|
Defined in:
|
|
1168
|
-
[epub/index.ts:
|
|
1045
|
+
[epub/index.ts:1014](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1014)
|
|
1169
1046
|
|
|
1170
1047
|
Retrieve the publication type from the dc:type element in the EPUB metadata.
|
|
1171
1048
|
|
|
@@ -1179,10 +1056,6 @@ If there is no dc:type element, returns null.
|
|
|
1179
1056
|
|
|
1180
1057
|
https://www.w3.org/TR/epub-33/#sec-opf-dctype
|
|
1181
1058
|
|
|
1182
|
-
##### Inherited from
|
|
1183
|
-
|
|
1184
|
-
`BaseEpub.getType`
|
|
1185
|
-
|
|
1186
1059
|
#### readItemContents()
|
|
1187
1060
|
|
|
1188
1061
|
##### Call Signature
|
|
@@ -1190,7 +1063,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctype
|
|
|
1190
1063
|
> **readItemContents**(`id`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
1191
1064
|
|
|
1192
1065
|
Defined in:
|
|
1193
|
-
[epub/index.ts:
|
|
1066
|
+
[epub/index.ts:1963](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1963)
|
|
1194
1067
|
|
|
1195
1068
|
Retrieve the contents of a manifest item, given its id.
|
|
1196
1069
|
|
|
@@ -1208,16 +1081,12 @@ Retrieve the contents of a manifest item, given its id.
|
|
|
1208
1081
|
|
|
1209
1082
|
https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
1210
1083
|
|
|
1211
|
-
###### Inherited from
|
|
1212
|
-
|
|
1213
|
-
`BaseEpub.readItemContents`
|
|
1214
|
-
|
|
1215
1084
|
##### Call Signature
|
|
1216
1085
|
|
|
1217
1086
|
> **readItemContents**(`id`, `encoding`): `Promise`\<`string`\>
|
|
1218
1087
|
|
|
1219
1088
|
Defined in:
|
|
1220
|
-
[epub/index.ts:
|
|
1089
|
+
[epub/index.ts:1964](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1964)
|
|
1221
1090
|
|
|
1222
1091
|
Retrieve the contents of a manifest item, given its id.
|
|
1223
1092
|
|
|
@@ -1236,10 +1105,6 @@ Retrieve the contents of a manifest item, given its id.
|
|
|
1236
1105
|
|
|
1237
1106
|
https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
1238
1107
|
|
|
1239
|
-
###### Inherited from
|
|
1240
|
-
|
|
1241
|
-
`BaseEpub.readItemContents`
|
|
1242
|
-
|
|
1243
1108
|
#### readXhtmlItemContents()
|
|
1244
1109
|
|
|
1245
1110
|
##### Call Signature
|
|
@@ -1247,7 +1112,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
1247
1112
|
> **readXhtmlItemContents**(`id`, `as?`): `Promise`\<[`ParsedXml`](#parsedxml)\>
|
|
1248
1113
|
|
|
1249
1114
|
Defined in:
|
|
1250
|
-
[epub/index.ts:
|
|
1115
|
+
[epub/index.ts:2024](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2024)
|
|
1251
1116
|
|
|
1252
1117
|
Retrieves the contents of an XHTML item, given its manifest id.
|
|
1253
1118
|
|
|
@@ -1266,16 +1131,12 @@ Retrieves the contents of an XHTML item, given its manifest id.
|
|
|
1266
1131
|
|
|
1267
1132
|
https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
1268
1133
|
|
|
1269
|
-
###### Inherited from
|
|
1270
|
-
|
|
1271
|
-
`BaseEpub.readXhtmlItemContents`
|
|
1272
|
-
|
|
1273
1134
|
##### Call Signature
|
|
1274
1135
|
|
|
1275
1136
|
> **readXhtmlItemContents**(`id`, `as`): `Promise`\<`string`\>
|
|
1276
1137
|
|
|
1277
1138
|
Defined in:
|
|
1278
|
-
[epub/index.ts:
|
|
1139
|
+
[epub/index.ts:2025](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2025)
|
|
1279
1140
|
|
|
1280
1141
|
Retrieves the contents of an XHTML item, given its manifest id.
|
|
1281
1142
|
|
|
@@ -1294,16 +1155,12 @@ Retrieves the contents of an XHTML item, given its manifest id.
|
|
|
1294
1155
|
|
|
1295
1156
|
https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
1296
1157
|
|
|
1297
|
-
###### Inherited from
|
|
1298
|
-
|
|
1299
|
-
`BaseEpub.readXhtmlItemContents`
|
|
1300
|
-
|
|
1301
1158
|
#### removeCollection()
|
|
1302
1159
|
|
|
1303
1160
|
> **removeCollection**(`index`): `Promise`\<`void`\>
|
|
1304
1161
|
|
|
1305
1162
|
Defined in:
|
|
1306
|
-
[epub/index.ts:
|
|
1163
|
+
[epub/index.ts:1563](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1563)
|
|
1307
1164
|
|
|
1308
1165
|
Remove a collection from the EPUB metadata.
|
|
1309
1166
|
|
|
@@ -1320,16 +1177,12 @@ returned by `epub.getCollections()`.
|
|
|
1320
1177
|
|
|
1321
1178
|
`Promise`\<`void`\>
|
|
1322
1179
|
|
|
1323
|
-
##### Inherited from
|
|
1324
|
-
|
|
1325
|
-
`BaseEpub.removeCollection`
|
|
1326
|
-
|
|
1327
1180
|
#### removeContributor()
|
|
1328
1181
|
|
|
1329
1182
|
> **removeContributor**(`index`): `Promise`\<`void`\>
|
|
1330
1183
|
|
|
1331
1184
|
Defined in:
|
|
1332
|
-
[epub/index.ts:
|
|
1185
|
+
[epub/index.ts:1820](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1820)
|
|
1333
1186
|
|
|
1334
1187
|
Remove a contributor from the EPUB metadata.
|
|
1335
1188
|
|
|
@@ -1352,16 +1205,12 @@ This is a convenience method for `epub.removeCreator(index, 'contributor')`.
|
|
|
1352
1205
|
|
|
1353
1206
|
https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
1354
1207
|
|
|
1355
|
-
##### Inherited from
|
|
1356
|
-
|
|
1357
|
-
`BaseEpub.removeContributor`
|
|
1358
|
-
|
|
1359
1208
|
#### removeCreator()
|
|
1360
1209
|
|
|
1361
1210
|
> **removeCreator**(`index`, `type`): `Promise`\<`void`\>
|
|
1362
1211
|
|
|
1363
1212
|
Defined in:
|
|
1364
|
-
[epub/index.ts:
|
|
1213
|
+
[epub/index.ts:1768](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1768)
|
|
1365
1214
|
|
|
1366
1215
|
Remove a creator from the EPUB metadata.
|
|
1367
1216
|
|
|
@@ -1383,16 +1232,12 @@ returned by `epub.getCreators()`.
|
|
|
1383
1232
|
|
|
1384
1233
|
https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
1385
1234
|
|
|
1386
|
-
##### Inherited from
|
|
1387
|
-
|
|
1388
|
-
`BaseEpub.removeCreator`
|
|
1389
|
-
|
|
1390
1235
|
#### removeManifestItem()
|
|
1391
1236
|
|
|
1392
1237
|
> **removeManifestItem**(`id`): `Promise`\<`void`\>
|
|
1393
1238
|
|
|
1394
1239
|
Defined in:
|
|
1395
|
-
[epub/index.ts:
|
|
1240
|
+
[epub/index.ts:2120](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2120)
|
|
1396
1241
|
|
|
1397
1242
|
##### Parameters
|
|
1398
1243
|
|
|
@@ -1404,16 +1249,12 @@ Defined in:
|
|
|
1404
1249
|
|
|
1405
1250
|
`Promise`\<`void`\>
|
|
1406
1251
|
|
|
1407
|
-
##### Inherited from
|
|
1408
|
-
|
|
1409
|
-
`BaseEpub.removeManifestItem`
|
|
1410
|
-
|
|
1411
1252
|
#### removeMetadata()
|
|
1412
1253
|
|
|
1413
1254
|
> **removeMetadata**(`predicate`): `Promise`\<`void`\>
|
|
1414
1255
|
|
|
1415
1256
|
Defined in:
|
|
1416
|
-
[epub/index.ts:
|
|
1257
|
+
[epub/index.ts:2369](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2369)
|
|
1417
1258
|
|
|
1418
1259
|
Remove one or more metadata entries.
|
|
1419
1260
|
|
|
@@ -1434,16 +1275,12 @@ all metadata entries that match the predicate will be removed.
|
|
|
1434
1275
|
|
|
1435
1276
|
https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
1436
1277
|
|
|
1437
|
-
##### Inherited from
|
|
1438
|
-
|
|
1439
|
-
`BaseEpub.removeMetadata`
|
|
1440
|
-
|
|
1441
1278
|
#### removeSpineItem()
|
|
1442
1279
|
|
|
1443
1280
|
> **removeSpineItem**(`index`): `Promise`\<`void`\>
|
|
1444
1281
|
|
|
1445
1282
|
Defined in:
|
|
1446
|
-
[epub/index.ts:
|
|
1283
|
+
[epub/index.ts:1926](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1926)
|
|
1447
1284
|
|
|
1448
1285
|
Remove the spine item at the specified index.
|
|
1449
1286
|
|
|
@@ -1461,16 +1298,12 @@ Remove the spine item at the specified index.
|
|
|
1461
1298
|
|
|
1462
1299
|
https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
1463
1300
|
|
|
1464
|
-
##### Inherited from
|
|
1465
|
-
|
|
1466
|
-
`BaseEpub.removeSpineItem`
|
|
1467
|
-
|
|
1468
1301
|
#### removeSubject()
|
|
1469
1302
|
|
|
1470
1303
|
> **removeSubject**(`index`): `Promise`\<`void`\>
|
|
1471
1304
|
|
|
1472
1305
|
Defined in:
|
|
1473
|
-
[epub/index.ts:
|
|
1306
|
+
[epub/index.ts:1064](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1064)
|
|
1474
1307
|
|
|
1475
1308
|
Remove a subject from the EPUB metadata.
|
|
1476
1309
|
|
|
@@ -1491,16 +1324,12 @@ returned by `epub.getSubjects()`.
|
|
|
1491
1324
|
|
|
1492
1325
|
https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
1493
1326
|
|
|
1494
|
-
##### Inherited from
|
|
1495
|
-
|
|
1496
|
-
`BaseEpub.removeSubject`
|
|
1497
|
-
|
|
1498
1327
|
#### replaceMetadata()
|
|
1499
1328
|
|
|
1500
1329
|
> **replaceMetadata**(`predicate`, `entry`): `Promise`\<`void`\>
|
|
1501
1330
|
|
|
1502
1331
|
Defined in:
|
|
1503
|
-
[epub/index.ts:
|
|
1332
|
+
[epub/index.ts:2324](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2324)
|
|
1504
1333
|
|
|
1505
1334
|
Replace a metadata entry with a new one.
|
|
1506
1335
|
|
|
@@ -1522,28 +1351,18 @@ first metadata entry that matches the predicate will be replaced.
|
|
|
1522
1351
|
|
|
1523
1352
|
https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
1524
1353
|
|
|
1525
|
-
##### Inherited from
|
|
1526
|
-
|
|
1527
|
-
`BaseEpub.replaceMetadata`
|
|
1528
|
-
|
|
1529
1354
|
#### saveAndClose()
|
|
1530
1355
|
|
|
1531
|
-
> **saveAndClose**(
|
|
1356
|
+
> **saveAndClose**(): `Promise`\<`void`\>
|
|
1532
1357
|
|
|
1533
1358
|
Defined in:
|
|
1534
|
-
[epub/
|
|
1359
|
+
[epub/index.ts:2411](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2411)
|
|
1535
1360
|
|
|
1536
1361
|
Write the current contents of the Epub to a new EPUB archive on disk.
|
|
1537
1362
|
|
|
1538
1363
|
When this method is called, the "dcterms:modified" meta tag is automatically
|
|
1539
1364
|
updated to the current UTC timestamp.
|
|
1540
1365
|
|
|
1541
|
-
##### Parameters
|
|
1542
|
-
|
|
1543
|
-
| Parameter | Type | Description |
|
|
1544
|
-
| --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
1545
|
-
| `path` | `string` | The file path to write the new archive to. The parent directory does not need te exist -- the path will be recursively created. |
|
|
1546
|
-
|
|
1547
1366
|
##### Returns
|
|
1548
1367
|
|
|
1549
1368
|
`Promise`\<`void`\>
|
|
@@ -1553,7 +1372,7 @@ updated to the current UTC timestamp.
|
|
|
1553
1372
|
> **setCoverImage**(`href`, `data`): `Promise`\<`void`\>
|
|
1554
1373
|
|
|
1555
1374
|
Defined in:
|
|
1556
|
-
[epub/index.ts:
|
|
1375
|
+
[epub/index.ts:944](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L944)
|
|
1557
1376
|
|
|
1558
1377
|
Set the cover image for the EPUB.
|
|
1559
1378
|
|
|
@@ -1571,16 +1390,12 @@ then writes the provided image data to the provided href within the publication.
|
|
|
1571
1390
|
|
|
1572
1391
|
`Promise`\<`void`\>
|
|
1573
1392
|
|
|
1574
|
-
##### Inherited from
|
|
1575
|
-
|
|
1576
|
-
`BaseEpub.setCoverImage`
|
|
1577
|
-
|
|
1578
1393
|
#### setDescription()
|
|
1579
1394
|
|
|
1580
1395
|
> **setDescription**(`description`): `Promise`\<`void`\>
|
|
1581
1396
|
|
|
1582
1397
|
Defined in:
|
|
1583
|
-
[epub/index.ts:
|
|
1398
|
+
[epub/index.ts:1289](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1289)
|
|
1584
1399
|
|
|
1585
1400
|
Update the Epub's description metadata entry.
|
|
1586
1401
|
|
|
@@ -1598,16 +1413,12 @@ encoded as HTML entities.
|
|
|
1598
1413
|
|
|
1599
1414
|
`Promise`\<`void`\>
|
|
1600
1415
|
|
|
1601
|
-
##### Inherited from
|
|
1602
|
-
|
|
1603
|
-
`BaseEpub.setDescription`
|
|
1604
|
-
|
|
1605
1416
|
#### setIdentifier()
|
|
1606
1417
|
|
|
1607
1418
|
> **setIdentifier**(`identifier`): `Promise`\<`void`\>
|
|
1608
1419
|
|
|
1609
1420
|
Defined in:
|
|
1610
|
-
[epub/index.ts:
|
|
1421
|
+
[epub/index.ts:859](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L859)
|
|
1611
1422
|
|
|
1612
1423
|
Set the dc:identifier metadata element with the provided string.
|
|
1613
1424
|
|
|
@@ -1628,16 +1439,12 @@ new element
|
|
|
1628
1439
|
|
|
1629
1440
|
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
1630
1441
|
|
|
1631
|
-
##### Inherited from
|
|
1632
|
-
|
|
1633
|
-
`BaseEpub.setIdentifier`
|
|
1634
|
-
|
|
1635
1442
|
#### setLanguage()
|
|
1636
1443
|
|
|
1637
1444
|
> **setLanguage**(`locale`): `Promise`\<`void`\>
|
|
1638
1445
|
|
|
1639
1446
|
Defined in:
|
|
1640
|
-
[epub/index.ts:
|
|
1447
|
+
[epub/index.ts:1171](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1171)
|
|
1641
1448
|
|
|
1642
1449
|
Update the Epub's language metadata entry.
|
|
1643
1450
|
|
|
@@ -1658,16 +1465,12 @@ element
|
|
|
1658
1465
|
|
|
1659
1466
|
https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
|
|
1660
1467
|
|
|
1661
|
-
##### Inherited from
|
|
1662
|
-
|
|
1663
|
-
`BaseEpub.setLanguage`
|
|
1664
|
-
|
|
1665
1468
|
#### setPackageVocabularyPrefix()
|
|
1666
1469
|
|
|
1667
1470
|
> **setPackageVocabularyPrefix**(`prefix`, `uri`): `Promise`\<`void`\>
|
|
1668
1471
|
|
|
1669
1472
|
Defined in:
|
|
1670
|
-
[epub/index.ts:
|
|
1473
|
+
[epub/index.ts:1340](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1340)
|
|
1671
1474
|
|
|
1672
1475
|
Set a custom vocabulary prefix on the root package element.
|
|
1673
1476
|
|
|
@@ -1686,16 +1489,12 @@ Set a custom vocabulary prefix on the root package element.
|
|
|
1686
1489
|
|
|
1687
1490
|
https://www.w3.org/TR/epub-33/#sec-prefix-attr
|
|
1688
1491
|
|
|
1689
|
-
##### Inherited from
|
|
1690
|
-
|
|
1691
|
-
`BaseEpub.setPackageVocabularyPrefix`
|
|
1692
|
-
|
|
1693
1492
|
#### setPublicationDate()
|
|
1694
1493
|
|
|
1695
1494
|
> **setPublicationDate**(`date`): `Promise`\<`void`\>
|
|
1696
1495
|
|
|
1697
1496
|
Defined in:
|
|
1698
|
-
[epub/index.ts:
|
|
1497
|
+
[epub/index.ts:982](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L982)
|
|
1699
1498
|
|
|
1700
1499
|
Set the dc:date metadata element with the provided date.
|
|
1701
1500
|
|
|
@@ -1716,16 +1515,12 @@ element
|
|
|
1716
1515
|
|
|
1717
1516
|
https://www.w3.org/TR/epub-33/#sec-opf-dcdate
|
|
1718
1517
|
|
|
1719
|
-
##### Inherited from
|
|
1720
|
-
|
|
1721
|
-
`BaseEpub.setPublicationDate`
|
|
1722
|
-
|
|
1723
1518
|
#### setTitle()
|
|
1724
1519
|
|
|
1725
1520
|
> **setTitle**(`title`): `Promise`\<`void`\>
|
|
1726
1521
|
|
|
1727
1522
|
Defined in:
|
|
1728
|
-
[epub/index.ts:
|
|
1523
|
+
[epub/index.ts:1364](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1364)
|
|
1729
1524
|
|
|
1730
1525
|
Set the title of the Epub.
|
|
1731
1526
|
|
|
@@ -1748,16 +1543,12 @@ To set specific titles and their types, use epub.setTitles().
|
|
|
1748
1543
|
|
|
1749
1544
|
https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
1750
1545
|
|
|
1751
|
-
##### Inherited from
|
|
1752
|
-
|
|
1753
|
-
`BaseEpub.setTitle`
|
|
1754
|
-
|
|
1755
1546
|
#### setTitles()
|
|
1756
1547
|
|
|
1757
1548
|
> **setTitles**(`entries`): `Promise`\<`void`\>
|
|
1758
1549
|
|
|
1759
1550
|
Defined in:
|
|
1760
|
-
[epub/index.ts:
|
|
1551
|
+
[epub/index.ts:1392](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L1392)
|
|
1761
1552
|
|
|
1762
1553
|
##### Parameters
|
|
1763
1554
|
|
|
@@ -1769,16 +1560,12 @@ Defined in:
|
|
|
1769
1560
|
|
|
1770
1561
|
`Promise`\<`void`\>
|
|
1771
1562
|
|
|
1772
|
-
##### Inherited from
|
|
1773
|
-
|
|
1774
|
-
`BaseEpub.setTitles`
|
|
1775
|
-
|
|
1776
1563
|
#### setType()
|
|
1777
1564
|
|
|
1778
1565
|
> **setType**(`type`): `Promise`\<`void`\>
|
|
1779
1566
|
|
|
1780
1567
|
Defined in:
|
|
1781
|
-
[epub/index.ts:
|
|
1568
|
+
[epub/index.ts:998](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L998)
|
|
1782
1569
|
|
|
1783
1570
|
Set the dc:type metadata element.
|
|
1784
1571
|
|
|
@@ -1799,16 +1586,12 @@ element.
|
|
|
1799
1586
|
|
|
1800
1587
|
https://www.w3.org/TR/epub-33/#sec-opf-dctype
|
|
1801
1588
|
|
|
1802
|
-
##### Inherited from
|
|
1803
|
-
|
|
1804
|
-
`BaseEpub.setType`
|
|
1805
|
-
|
|
1806
1589
|
#### updateManifestItem()
|
|
1807
1590
|
|
|
1808
1591
|
> **updateManifestItem**(`id`, `newItem`): `Promise`\<`void`\>
|
|
1809
1592
|
|
|
1810
1593
|
Defined in:
|
|
1811
|
-
[epub/index.ts:
|
|
1594
|
+
[epub/index.ts:2236](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2236)
|
|
1812
1595
|
|
|
1813
1596
|
Update the manifest entry for an existing item.
|
|
1814
1597
|
|
|
@@ -1830,10 +1613,6 @@ To update the contents of an entry, use `epub.writeItemContents()` or
|
|
|
1830
1613
|
|
|
1831
1614
|
https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
1832
1615
|
|
|
1833
|
-
##### Inherited from
|
|
1834
|
-
|
|
1835
|
-
`BaseEpub.updateManifestItem`
|
|
1836
|
-
|
|
1837
1616
|
#### writeItemContents()
|
|
1838
1617
|
|
|
1839
1618
|
##### Call Signature
|
|
@@ -1841,7 +1620,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
1841
1620
|
> **writeItemContents**(`id`, `contents`): `Promise`\<`void`\>
|
|
1842
1621
|
|
|
1843
1622
|
Defined in:
|
|
1844
|
-
[epub/index.ts:
|
|
1623
|
+
[epub/index.ts:2072](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2072)
|
|
1845
1624
|
|
|
1846
1625
|
Write new contents for an existing manifest item, specified by its id.
|
|
1847
1626
|
|
|
@@ -1863,16 +1642,12 @@ The id must reference an existing manifest item. If creating a new item, use
|
|
|
1863
1642
|
|
|
1864
1643
|
https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
1865
1644
|
|
|
1866
|
-
###### Inherited from
|
|
1867
|
-
|
|
1868
|
-
`BaseEpub.writeItemContents`
|
|
1869
|
-
|
|
1870
1645
|
##### Call Signature
|
|
1871
1646
|
|
|
1872
1647
|
> **writeItemContents**(`id`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
1873
1648
|
|
|
1874
1649
|
Defined in:
|
|
1875
|
-
[epub/index.ts:
|
|
1650
|
+
[epub/index.ts:2073](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2073)
|
|
1876
1651
|
|
|
1877
1652
|
Write new contents for an existing manifest item, specified by its id.
|
|
1878
1653
|
|
|
@@ -1895,16 +1670,12 @@ The id must reference an existing manifest item. If creating a new item, use
|
|
|
1895
1670
|
|
|
1896
1671
|
https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
1897
1672
|
|
|
1898
|
-
###### Inherited from
|
|
1899
|
-
|
|
1900
|
-
`BaseEpub.writeItemContents`
|
|
1901
|
-
|
|
1902
1673
|
#### writeXhtmlItemContents()
|
|
1903
1674
|
|
|
1904
1675
|
> **writeXhtmlItemContents**(`id`, `contents`): `Promise`\<`void`\>
|
|
1905
1676
|
|
|
1906
1677
|
Defined in:
|
|
1907
|
-
[epub/index.ts:
|
|
1678
|
+
[epub/index.ts:2112](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L2112)
|
|
1908
1679
|
|
|
1909
1680
|
Write new contents for an existing XHTML item, specified by its id.
|
|
1910
1681
|
|
|
@@ -1926,16 +1697,12 @@ The id must reference an existing manifest item. If creating a new item, use
|
|
|
1926
1697
|
|
|
1927
1698
|
https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
1928
1699
|
|
|
1929
|
-
##### Inherited from
|
|
1930
|
-
|
|
1931
|
-
`BaseEpub.writeXhtmlItemContents`
|
|
1932
|
-
|
|
1933
1700
|
#### addLinkToXhtmlHead()
|
|
1934
1701
|
|
|
1935
1702
|
> `static` **addLinkToXhtmlHead**(`xml`, `link`): `void`
|
|
1936
1703
|
|
|
1937
1704
|
Defined in:
|
|
1938
|
-
[epub/index.ts:
|
|
1705
|
+
[epub/index.ts:234](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L234)
|
|
1939
1706
|
|
|
1940
1707
|
Given an XML structure representing a complete XHTML document, add a `link`
|
|
1941
1708
|
element to the `head` of the document.
|
|
@@ -1956,16 +1723,13 @@ This method modifies the provided XML structure.
|
|
|
1956
1723
|
|
|
1957
1724
|
`void`
|
|
1958
1725
|
|
|
1959
|
-
##### Inherited from
|
|
1960
|
-
|
|
1961
|
-
`BaseEpub.addLinkToXhtmlHead`
|
|
1962
|
-
|
|
1963
1726
|
#### create()
|
|
1964
1727
|
|
|
1965
|
-
> `static` **create**(`
|
|
1728
|
+
> `static` **create**(`path`, `__namedParameters`, `additionalMetadata`):
|
|
1729
|
+
> `Promise`\<[`Epub`](#epub)\>
|
|
1966
1730
|
|
|
1967
1731
|
Defined in:
|
|
1968
|
-
[epub/
|
|
1732
|
+
[epub/index.ts:389](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L389)
|
|
1969
1733
|
|
|
1970
1734
|
Construct an Epub instance, optionally beginning with the provided metadata.
|
|
1971
1735
|
|
|
@@ -1973,24 +1737,21 @@ Construct an Epub instance, optionally beginning with the provided metadata.
|
|
|
1973
1737
|
|
|
1974
1738
|
| Parameter | Type | Default value | Description |
|
|
1975
1739
|
| -------------------- | ------------------------------- | ------------- | --------------------------------------- |
|
|
1976
|
-
| `
|
|
1740
|
+
| `path` | `string` | `undefined` | - |
|
|
1741
|
+
| `__namedParameters` | [`DublinCore`](#dublincore) | `undefined` | - |
|
|
1977
1742
|
| `additionalMetadata` | [`EpubMetadata`](#epubmetadata) | `[]` | An array of additional metadata entries |
|
|
1978
1743
|
|
|
1979
1744
|
##### Returns
|
|
1980
1745
|
|
|
1981
1746
|
`Promise`\<[`Epub`](#epub)\>
|
|
1982
1747
|
|
|
1983
|
-
##### Overrides
|
|
1984
|
-
|
|
1985
|
-
`BaseEpub.create`
|
|
1986
|
-
|
|
1987
1748
|
#### createXmlElement()
|
|
1988
1749
|
|
|
1989
1750
|
> `static` **createXmlElement**\<`Name`\>(`name`, `properties`, `children`):
|
|
1990
1751
|
> [`XmlElement`](#xmlelement)\<`Name`\>
|
|
1991
1752
|
|
|
1992
1753
|
Defined in:
|
|
1993
|
-
[epub/index.ts:
|
|
1754
|
+
[epub/index.ts:269](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L269)
|
|
1994
1755
|
|
|
1995
1756
|
##### Type Parameters
|
|
1996
1757
|
|
|
@@ -2010,16 +1771,12 @@ Defined in:
|
|
|
2010
1771
|
|
|
2011
1772
|
[`XmlElement`](#xmlelement)\<`Name`\>
|
|
2012
1773
|
|
|
2013
|
-
##### Inherited from
|
|
2014
|
-
|
|
2015
|
-
`BaseEpub.createXmlElement`
|
|
2016
|
-
|
|
2017
1774
|
#### createXmlTextNode()
|
|
2018
1775
|
|
|
2019
1776
|
> `static` **createXmlTextNode**(`text`): [`XmlTextNode`](#xmltextnode)
|
|
2020
1777
|
|
|
2021
1778
|
Defined in:
|
|
2022
|
-
[epub/index.ts:
|
|
1779
|
+
[epub/index.ts:282](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L282)
|
|
2023
1780
|
|
|
2024
1781
|
##### Parameters
|
|
2025
1782
|
|
|
@@ -2031,17 +1788,13 @@ Defined in:
|
|
|
2031
1788
|
|
|
2032
1789
|
[`XmlTextNode`](#xmltextnode)
|
|
2033
1790
|
|
|
2034
|
-
##### Inherited from
|
|
2035
|
-
|
|
2036
|
-
`BaseEpub.createXmlTextNode`
|
|
2037
|
-
|
|
2038
1791
|
#### findXmlChildByName()
|
|
2039
1792
|
|
|
2040
1793
|
> `static` **findXmlChildByName**\<`Name`\>(`name`, `xml`, `filter?`):
|
|
2041
1794
|
> `undefined` \| [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2042
1795
|
|
|
2043
1796
|
Defined in:
|
|
2044
|
-
[epub/index.ts:
|
|
1797
|
+
[epub/index.ts:343](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L343)
|
|
2045
1798
|
|
|
2046
1799
|
Given an XML structure, find the first child matching the provided name and
|
|
2047
1800
|
optional filter.
|
|
@@ -2064,16 +1817,12 @@ optional filter.
|
|
|
2064
1817
|
|
|
2065
1818
|
`undefined` \| [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2066
1819
|
|
|
2067
|
-
##### Inherited from
|
|
2068
|
-
|
|
2069
|
-
`BaseEpub.findXmlChildByName`
|
|
2070
|
-
|
|
2071
1820
|
#### formatSmilDuration()
|
|
2072
1821
|
|
|
2073
1822
|
> `static` **formatSmilDuration**(`duration`): `string`
|
|
2074
1823
|
|
|
2075
1824
|
Defined in:
|
|
2076
|
-
[epub/index.ts:
|
|
1825
|
+
[epub/index.ts:217](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L217)
|
|
2077
1826
|
|
|
2078
1827
|
Format a duration, provided as a number of seconds, as a SMIL clock value, to be
|
|
2079
1828
|
used for Media Overlays.
|
|
@@ -2092,39 +1841,31 @@ used for Media Overlays.
|
|
|
2092
1841
|
|
|
2093
1842
|
https://www.w3.org/TR/epub-33/#sec-duration
|
|
2094
1843
|
|
|
2095
|
-
##### Inherited from
|
|
2096
|
-
|
|
2097
|
-
`BaseEpub.formatSmilDuration`
|
|
2098
|
-
|
|
2099
1844
|
#### from()
|
|
2100
1845
|
|
|
2101
|
-
> `static` **from**(
|
|
1846
|
+
> `static` **from**(`pathOrData`): `Promise`\<[`Epub`](#epub)\>
|
|
2102
1847
|
|
|
2103
1848
|
Defined in:
|
|
2104
|
-
[epub/
|
|
1849
|
+
[epub/index.ts:480](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L480)
|
|
2105
1850
|
|
|
2106
1851
|
Construct an Epub instance by reading an existing EPUB publication.
|
|
2107
1852
|
|
|
2108
1853
|
##### Parameters
|
|
2109
1854
|
|
|
2110
|
-
| Parameter
|
|
2111
|
-
|
|
|
2112
|
-
|
|
|
1855
|
+
| Parameter | Type | Description |
|
|
1856
|
+
| ------------ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1857
|
+
| `pathOrData` | `string` \| `Uint8Array`\<`ArrayBufferLike`\> | Must be either a string representing the path to an EPUB file on disk, or a Uint8Array representing the data of the EPUB publication. |
|
|
2113
1858
|
|
|
2114
1859
|
##### Returns
|
|
2115
1860
|
|
|
2116
1861
|
`Promise`\<[`Epub`](#epub)\>
|
|
2117
1862
|
|
|
2118
|
-
##### Overrides
|
|
2119
|
-
|
|
2120
|
-
`BaseEpub.from`
|
|
2121
|
-
|
|
2122
1863
|
#### getXhtmlBody()
|
|
2123
1864
|
|
|
2124
1865
|
> `static` **getXhtmlBody**(`xml`): [`ParsedXml`](#parsedxml)
|
|
2125
1866
|
|
|
2126
1867
|
Defined in:
|
|
2127
|
-
[epub/index.ts:
|
|
1868
|
+
[epub/index.ts:259](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L259)
|
|
2128
1869
|
|
|
2129
1870
|
Given an XML structure representing a complete XHTML document, return the
|
|
2130
1871
|
sub-structure representing the children of the document's body element.
|
|
@@ -2139,16 +1880,12 @@ sub-structure representing the children of the document's body element.
|
|
|
2139
1880
|
|
|
2140
1881
|
[`ParsedXml`](#parsedxml)
|
|
2141
1882
|
|
|
2142
|
-
##### Inherited from
|
|
2143
|
-
|
|
2144
|
-
`BaseEpub.getXhtmlBody`
|
|
2145
|
-
|
|
2146
1883
|
#### getXhtmlTextContent()
|
|
2147
1884
|
|
|
2148
1885
|
> `static` **getXhtmlTextContent**(`xml`): `string`
|
|
2149
1886
|
|
|
2150
1887
|
Defined in:
|
|
2151
|
-
[epub/index.ts:
|
|
1888
|
+
[epub/index.ts:291](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L291)
|
|
2152
1889
|
|
|
2153
1890
|
Given an XML structure representing a complete XHTML document, return a string
|
|
2154
1891
|
representing the concatenation of all text nodes in the document.
|
|
@@ -2163,16 +1900,12 @@ representing the concatenation of all text nodes in the document.
|
|
|
2163
1900
|
|
|
2164
1901
|
`string`
|
|
2165
1902
|
|
|
2166
|
-
##### Inherited from
|
|
2167
|
-
|
|
2168
|
-
`BaseEpub.getXhtmlTextContent`
|
|
2169
|
-
|
|
2170
1903
|
#### getXmlChildren()
|
|
2171
1904
|
|
|
2172
1905
|
> `static` **getXmlChildren**\<`Name`\>(`element`): [`ParsedXml`](#parsedxml)
|
|
2173
1906
|
|
|
2174
1907
|
Defined in:
|
|
2175
|
-
[epub/index.ts:
|
|
1908
|
+
[epub/index.ts:323](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L323)
|
|
2176
1909
|
|
|
2177
1910
|
Given an XMLElement, return a list of its children
|
|
2178
1911
|
|
|
@@ -2192,16 +1925,12 @@ Given an XMLElement, return a list of its children
|
|
|
2192
1925
|
|
|
2193
1926
|
[`ParsedXml`](#parsedxml)
|
|
2194
1927
|
|
|
2195
|
-
##### Inherited from
|
|
2196
|
-
|
|
2197
|
-
`BaseEpub.getXmlChildren`
|
|
2198
|
-
|
|
2199
1928
|
#### getXmlElementName()
|
|
2200
1929
|
|
|
2201
1930
|
> `static` **getXmlElementName**\<`Name`\>(`element`): `Name`
|
|
2202
1931
|
|
|
2203
1932
|
Defined in:
|
|
2204
|
-
[epub/index.ts:
|
|
1933
|
+
[epub/index.ts:308](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L308)
|
|
2205
1934
|
|
|
2206
1935
|
Given an XMLElement, return its tag name.
|
|
2207
1936
|
|
|
@@ -2221,16 +1950,12 @@ Given an XMLElement, return its tag name.
|
|
|
2221
1950
|
|
|
2222
1951
|
`Name`
|
|
2223
1952
|
|
|
2224
|
-
##### Inherited from
|
|
2225
|
-
|
|
2226
|
-
`BaseEpub.getXmlElementName`
|
|
2227
|
-
|
|
2228
1953
|
#### isXmlTextNode()
|
|
2229
1954
|
|
|
2230
1955
|
> `static` **isXmlTextNode**(`node`): `node is XmlTextNode`
|
|
2231
1956
|
|
|
2232
1957
|
Defined in:
|
|
2233
|
-
[epub/index.ts:
|
|
1958
|
+
[epub/index.ts:356](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L356)
|
|
2234
1959
|
|
|
2235
1960
|
Given an XMLNode, determine whether it represents a text node or an XML element.
|
|
2236
1961
|
|
|
@@ -2244,16 +1969,12 @@ Given an XMLNode, determine whether it represents a text node or an XML element.
|
|
|
2244
1969
|
|
|
2245
1970
|
`node is XmlTextNode`
|
|
2246
1971
|
|
|
2247
|
-
##### Inherited from
|
|
2248
|
-
|
|
2249
|
-
`BaseEpub.isXmlTextNode`
|
|
2250
|
-
|
|
2251
1972
|
#### replaceXmlChildren()
|
|
2252
1973
|
|
|
2253
1974
|
> `static` **replaceXmlChildren**\<`Name`\>(`element`, `children`): `void`
|
|
2254
1975
|
|
|
2255
1976
|
Defined in:
|
|
2256
|
-
[epub/index.ts:
|
|
1977
|
+
[epub/index.ts:331](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L331)
|
|
2257
1978
|
|
|
2258
1979
|
##### Type Parameters
|
|
2259
1980
|
|
|
@@ -2272,16 +1993,12 @@ Defined in:
|
|
|
2272
1993
|
|
|
2273
1994
|
`void`
|
|
2274
1995
|
|
|
2275
|
-
##### Inherited from
|
|
2276
|
-
|
|
2277
|
-
`BaseEpub.replaceXmlChildren`
|
|
2278
|
-
|
|
2279
1996
|
---
|
|
2280
1997
|
|
|
2281
1998
|
## AlternateScript
|
|
2282
1999
|
|
|
2283
2000
|
Defined in:
|
|
2284
|
-
[epub/index.ts:
|
|
2001
|
+
[epub/index.ts:105](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L105)
|
|
2285
2002
|
|
|
2286
2003
|
### Properties
|
|
2287
2004
|
|
|
@@ -2290,21 +2007,21 @@ Defined in:
|
|
|
2290
2007
|
> **locale**: `Locale`
|
|
2291
2008
|
|
|
2292
2009
|
Defined in:
|
|
2293
|
-
[epub/index.ts:
|
|
2010
|
+
[epub/index.ts:107](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L107)
|
|
2294
2011
|
|
|
2295
2012
|
#### name
|
|
2296
2013
|
|
|
2297
2014
|
> **name**: `string`
|
|
2298
2015
|
|
|
2299
2016
|
Defined in:
|
|
2300
|
-
[epub/index.ts:
|
|
2017
|
+
[epub/index.ts:106](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L106)
|
|
2301
2018
|
|
|
2302
2019
|
---
|
|
2303
2020
|
|
|
2304
2021
|
## Collection
|
|
2305
2022
|
|
|
2306
2023
|
Defined in:
|
|
2307
|
-
[epub/index.ts:
|
|
2024
|
+
[epub/index.ts:129](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L129)
|
|
2308
2025
|
|
|
2309
2026
|
### Properties
|
|
2310
2027
|
|
|
@@ -2313,28 +2030,28 @@ Defined in:
|
|
|
2313
2030
|
> **name**: `string`
|
|
2314
2031
|
|
|
2315
2032
|
Defined in:
|
|
2316
|
-
[epub/index.ts:
|
|
2033
|
+
[epub/index.ts:130](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L130)
|
|
2317
2034
|
|
|
2318
2035
|
#### position?
|
|
2319
2036
|
|
|
2320
2037
|
> `optional` **position**: `string`
|
|
2321
2038
|
|
|
2322
2039
|
Defined in:
|
|
2323
|
-
[epub/index.ts:
|
|
2040
|
+
[epub/index.ts:132](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L132)
|
|
2324
2041
|
|
|
2325
2042
|
#### type?
|
|
2326
2043
|
|
|
2327
2044
|
> `optional` **type**: `string`
|
|
2328
2045
|
|
|
2329
2046
|
Defined in:
|
|
2330
|
-
[epub/index.ts:
|
|
2047
|
+
[epub/index.ts:131](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L131)
|
|
2331
2048
|
|
|
2332
2049
|
---
|
|
2333
2050
|
|
|
2334
2051
|
## DcCreator
|
|
2335
2052
|
|
|
2336
2053
|
Defined in:
|
|
2337
|
-
[epub/index.ts:
|
|
2054
|
+
[epub/index.ts:110](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L110)
|
|
2338
2055
|
|
|
2339
2056
|
### Properties
|
|
2340
2057
|
|
|
@@ -2343,42 +2060,42 @@ Defined in:
|
|
|
2343
2060
|
> `optional` **alternateScripts**: [`AlternateScript`](#alternatescript)[]
|
|
2344
2061
|
|
|
2345
2062
|
Defined in:
|
|
2346
|
-
[epub/index.ts:
|
|
2063
|
+
[epub/index.ts:115](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L115)
|
|
2347
2064
|
|
|
2348
2065
|
#### fileAs?
|
|
2349
2066
|
|
|
2350
2067
|
> `optional` **fileAs**: `string`
|
|
2351
2068
|
|
|
2352
2069
|
Defined in:
|
|
2353
|
-
[epub/index.ts:
|
|
2070
|
+
[epub/index.ts:114](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L114)
|
|
2354
2071
|
|
|
2355
2072
|
#### name
|
|
2356
2073
|
|
|
2357
2074
|
> **name**: `string`
|
|
2358
2075
|
|
|
2359
2076
|
Defined in:
|
|
2360
|
-
[epub/index.ts:
|
|
2077
|
+
[epub/index.ts:111](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L111)
|
|
2361
2078
|
|
|
2362
2079
|
#### role?
|
|
2363
2080
|
|
|
2364
2081
|
> `optional` **role**: `string`
|
|
2365
2082
|
|
|
2366
2083
|
Defined in:
|
|
2367
|
-
[epub/index.ts:
|
|
2084
|
+
[epub/index.ts:112](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L112)
|
|
2368
2085
|
|
|
2369
2086
|
#### roleScheme?
|
|
2370
2087
|
|
|
2371
2088
|
> `optional` **roleScheme**: `string`
|
|
2372
2089
|
|
|
2373
2090
|
Defined in:
|
|
2374
|
-
[epub/index.ts:
|
|
2091
|
+
[epub/index.ts:113](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L113)
|
|
2375
2092
|
|
|
2376
2093
|
---
|
|
2377
2094
|
|
|
2378
2095
|
## DcSubject
|
|
2379
2096
|
|
|
2380
2097
|
Defined in:
|
|
2381
|
-
[epub/index.ts:
|
|
2098
|
+
[epub/index.ts:99](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L99)
|
|
2382
2099
|
|
|
2383
2100
|
### Properties
|
|
2384
2101
|
|
|
@@ -2387,28 +2104,28 @@ Defined in:
|
|
|
2387
2104
|
> **authority**: `string`
|
|
2388
2105
|
|
|
2389
2106
|
Defined in:
|
|
2390
|
-
[epub/index.ts:
|
|
2107
|
+
[epub/index.ts:101](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L101)
|
|
2391
2108
|
|
|
2392
2109
|
#### term
|
|
2393
2110
|
|
|
2394
2111
|
> **term**: `string`
|
|
2395
2112
|
|
|
2396
2113
|
Defined in:
|
|
2397
|
-
[epub/index.ts:
|
|
2114
|
+
[epub/index.ts:102](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L102)
|
|
2398
2115
|
|
|
2399
2116
|
#### value
|
|
2400
2117
|
|
|
2401
2118
|
> **value**: `string`
|
|
2402
2119
|
|
|
2403
2120
|
Defined in:
|
|
2404
|
-
[epub/index.ts:
|
|
2121
|
+
[epub/index.ts:100](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L100)
|
|
2405
2122
|
|
|
2406
2123
|
---
|
|
2407
2124
|
|
|
2408
2125
|
## DublinCore
|
|
2409
2126
|
|
|
2410
2127
|
Defined in:
|
|
2411
|
-
[epub/index.ts:
|
|
2128
|
+
[epub/index.ts:118](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L118)
|
|
2412
2129
|
|
|
2413
2130
|
### Properties
|
|
2414
2131
|
|
|
@@ -2417,56 +2134,56 @@ Defined in:
|
|
|
2417
2134
|
> `optional` **contributors**: [`DcCreator`](#dccreator)[]
|
|
2418
2135
|
|
|
2419
2136
|
Defined in:
|
|
2420
|
-
[epub/index.ts:
|
|
2137
|
+
[epub/index.ts:125](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L125)
|
|
2421
2138
|
|
|
2422
2139
|
#### creators?
|
|
2423
2140
|
|
|
2424
2141
|
> `optional` **creators**: [`DcCreator`](#dccreator)[]
|
|
2425
2142
|
|
|
2426
2143
|
Defined in:
|
|
2427
|
-
[epub/index.ts:
|
|
2144
|
+
[epub/index.ts:124](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L124)
|
|
2428
2145
|
|
|
2429
2146
|
#### date?
|
|
2430
2147
|
|
|
2431
2148
|
> `optional` **date**: `Date`
|
|
2432
2149
|
|
|
2433
2150
|
Defined in:
|
|
2434
|
-
[epub/index.ts:
|
|
2151
|
+
[epub/index.ts:122](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L122)
|
|
2435
2152
|
|
|
2436
2153
|
#### identifier
|
|
2437
2154
|
|
|
2438
2155
|
> **identifier**: `string`
|
|
2439
2156
|
|
|
2440
2157
|
Defined in:
|
|
2441
|
-
[epub/index.ts:
|
|
2158
|
+
[epub/index.ts:121](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L121)
|
|
2442
2159
|
|
|
2443
2160
|
#### language
|
|
2444
2161
|
|
|
2445
2162
|
> **language**: `Locale`
|
|
2446
2163
|
|
|
2447
2164
|
Defined in:
|
|
2448
|
-
[epub/index.ts:
|
|
2165
|
+
[epub/index.ts:120](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L120)
|
|
2449
2166
|
|
|
2450
2167
|
#### subjects?
|
|
2451
2168
|
|
|
2452
2169
|
> `optional` **subjects**: (`string` \| [`DcSubject`](#dcsubject))[]
|
|
2453
2170
|
|
|
2454
2171
|
Defined in:
|
|
2455
|
-
[epub/index.ts:
|
|
2172
|
+
[epub/index.ts:123](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L123)
|
|
2456
2173
|
|
|
2457
2174
|
#### title
|
|
2458
2175
|
|
|
2459
2176
|
> **title**: `string`
|
|
2460
2177
|
|
|
2461
2178
|
Defined in:
|
|
2462
|
-
[epub/index.ts:
|
|
2179
|
+
[epub/index.ts:119](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L119)
|
|
2463
2180
|
|
|
2464
2181
|
#### type?
|
|
2465
2182
|
|
|
2466
2183
|
> `optional` **type**: `string`
|
|
2467
2184
|
|
|
2468
2185
|
Defined in:
|
|
2469
|
-
[epub/index.ts:
|
|
2186
|
+
[epub/index.ts:126](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L126)
|
|
2470
2187
|
|
|
2471
2188
|
---
|
|
2472
2189
|
|
|
@@ -2476,7 +2193,7 @@ Defined in:
|
|
|
2476
2193
|
> \`$\{Letter \| Uppercase\<Letter\> \| QuestionMark\}$\{string\}\`
|
|
2477
2194
|
|
|
2478
2195
|
Defined in:
|
|
2479
|
-
[epub/index.ts:
|
|
2196
|
+
[epub/index.ts:60](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L60)
|
|
2480
2197
|
|
|
2481
2198
|
A valid name for an XML element (must start with a letter)
|
|
2482
2199
|
|
|
@@ -2487,7 +2204,7 @@ A valid name for an XML element (must start with a letter)
|
|
|
2487
2204
|
> **EpubMetadata** = [`MetadataEntry`](#metadataentry)[]
|
|
2488
2205
|
|
|
2489
2206
|
Defined in:
|
|
2490
|
-
[epub/index.ts:
|
|
2207
|
+
[epub/index.ts:97](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L97)
|
|
2491
2208
|
|
|
2492
2209
|
---
|
|
2493
2210
|
|
|
@@ -2496,7 +2213,7 @@ Defined in:
|
|
|
2496
2213
|
> **ManifestItem** = `object`
|
|
2497
2214
|
|
|
2498
2215
|
Defined in:
|
|
2499
|
-
[epub/index.ts:
|
|
2216
|
+
[epub/index.ts:81](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L81)
|
|
2500
2217
|
|
|
2501
2218
|
### Properties
|
|
2502
2219
|
|
|
@@ -2505,42 +2222,42 @@ Defined in:
|
|
|
2505
2222
|
> `optional` **fallback**: `string`
|
|
2506
2223
|
|
|
2507
2224
|
Defined in:
|
|
2508
|
-
[epub/index.ts:
|
|
2225
|
+
[epub/index.ts:85](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L85)
|
|
2509
2226
|
|
|
2510
2227
|
#### href
|
|
2511
2228
|
|
|
2512
2229
|
> **href**: `string`
|
|
2513
2230
|
|
|
2514
2231
|
Defined in:
|
|
2515
|
-
[epub/index.ts:
|
|
2232
|
+
[epub/index.ts:83](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L83)
|
|
2516
2233
|
|
|
2517
2234
|
#### id
|
|
2518
2235
|
|
|
2519
2236
|
> **id**: `string`
|
|
2520
2237
|
|
|
2521
2238
|
Defined in:
|
|
2522
|
-
[epub/index.ts:
|
|
2239
|
+
[epub/index.ts:82](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L82)
|
|
2523
2240
|
|
|
2524
2241
|
#### mediaOverlay?
|
|
2525
2242
|
|
|
2526
2243
|
> `optional` **mediaOverlay**: `string`
|
|
2527
2244
|
|
|
2528
2245
|
Defined in:
|
|
2529
|
-
[epub/index.ts:
|
|
2246
|
+
[epub/index.ts:86](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L86)
|
|
2530
2247
|
|
|
2531
2248
|
#### mediaType?
|
|
2532
2249
|
|
|
2533
2250
|
> `optional` **mediaType**: `string`
|
|
2534
2251
|
|
|
2535
2252
|
Defined in:
|
|
2536
|
-
[epub/index.ts:
|
|
2253
|
+
[epub/index.ts:84](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L84)
|
|
2537
2254
|
|
|
2538
2255
|
#### properties?
|
|
2539
2256
|
|
|
2540
2257
|
> `optional` **properties**: `string`[]
|
|
2541
2258
|
|
|
2542
2259
|
Defined in:
|
|
2543
|
-
[epub/index.ts:
|
|
2260
|
+
[epub/index.ts:87](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L87)
|
|
2544
2261
|
|
|
2545
2262
|
---
|
|
2546
2263
|
|
|
@@ -2549,7 +2266,7 @@ Defined in:
|
|
|
2549
2266
|
> **MetadataEntry** = `object`
|
|
2550
2267
|
|
|
2551
2268
|
Defined in:
|
|
2552
|
-
[epub/index.ts:
|
|
2269
|
+
[epub/index.ts:90](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L90)
|
|
2553
2270
|
|
|
2554
2271
|
### Properties
|
|
2555
2272
|
|
|
@@ -2558,28 +2275,38 @@ Defined in:
|
|
|
2558
2275
|
> `optional` **id**: `string`
|
|
2559
2276
|
|
|
2560
2277
|
Defined in:
|
|
2561
|
-
[epub/index.ts:
|
|
2278
|
+
[epub/index.ts:91](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L91)
|
|
2562
2279
|
|
|
2563
2280
|
#### properties
|
|
2564
2281
|
|
|
2565
2282
|
> **properties**: `Record`\<`string`, `string`\>
|
|
2566
2283
|
|
|
2567
2284
|
Defined in:
|
|
2568
|
-
[epub/index.ts:
|
|
2285
|
+
[epub/index.ts:93](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L93)
|
|
2569
2286
|
|
|
2570
2287
|
#### type
|
|
2571
2288
|
|
|
2572
2289
|
> **type**: [`ElementName`](#elementname)
|
|
2573
2290
|
|
|
2574
2291
|
Defined in:
|
|
2575
|
-
[epub/index.ts:
|
|
2292
|
+
[epub/index.ts:92](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L92)
|
|
2576
2293
|
|
|
2577
2294
|
#### value
|
|
2578
2295
|
|
|
2579
2296
|
> **value**: `string` \| `undefined`
|
|
2580
2297
|
|
|
2581
2298
|
Defined in:
|
|
2582
|
-
[epub/index.ts:
|
|
2299
|
+
[epub/index.ts:94](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L94)
|
|
2300
|
+
|
|
2301
|
+
---
|
|
2302
|
+
|
|
2303
|
+
## PackageElement
|
|
2304
|
+
|
|
2305
|
+
> **PackageElement** = [`XmlElement`](#xmlelement)\<`"package"`\> \|
|
|
2306
|
+
> [`XmlElement`](#xmlelement)\<`"opf:package"`\>
|
|
2307
|
+
|
|
2308
|
+
Defined in:
|
|
2309
|
+
[epub/index.ts:135](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L135)
|
|
2583
2310
|
|
|
2584
2311
|
---
|
|
2585
2312
|
|
|
@@ -2588,7 +2315,7 @@ Defined in:
|
|
|
2588
2315
|
> **ParsedXml** = [`XmlNode`](#xmlnode)[]
|
|
2589
2316
|
|
|
2590
2317
|
Defined in:
|
|
2591
|
-
[epub/index.ts:
|
|
2318
|
+
[epub/index.ts:79](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L79)
|
|
2592
2319
|
|
|
2593
2320
|
An XML structure
|
|
2594
2321
|
|
|
@@ -2599,7 +2326,7 @@ An XML structure
|
|
|
2599
2326
|
> **XmlElement**\<`Name`\> = `object` & `{ [key in Name]: ParsedXml }`
|
|
2600
2327
|
|
|
2601
2328
|
Defined in:
|
|
2602
|
-
[epub/index.ts:
|
|
2329
|
+
[epub/index.ts:66](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L66)
|
|
2603
2330
|
|
|
2604
2331
|
An XML element
|
|
2605
2332
|
|
|
@@ -2622,7 +2349,7 @@ An XML element
|
|
|
2622
2349
|
> **XmlNode** = [`XmlElement`](#xmlelement) \| [`XmlTextNode`](#xmltextnode)
|
|
2623
2350
|
|
|
2624
2351
|
Defined in:
|
|
2625
|
-
[epub/index.ts:
|
|
2352
|
+
[epub/index.ts:76](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L76)
|
|
2626
2353
|
|
|
2627
2354
|
A valid XML node. May be either an element or a text node.
|
|
2628
2355
|
|
|
@@ -2633,7 +2360,7 @@ A valid XML node. May be either an element or a text node.
|
|
|
2633
2360
|
> **XmlTextNode** = `object`
|
|
2634
2361
|
|
|
2635
2362
|
Defined in:
|
|
2636
|
-
[epub/index.ts:
|
|
2363
|
+
[epub/index.ts:73](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L73)
|
|
2637
2364
|
|
|
2638
2365
|
A text node in an XML document
|
|
2639
2366
|
|
|
@@ -2644,4 +2371,4 @@ A text node in an XML document
|
|
|
2644
2371
|
> **#text**: `string`
|
|
2645
2372
|
|
|
2646
2373
|
Defined in:
|
|
2647
|
-
[epub/index.ts:
|
|
2374
|
+
[epub/index.ts:73](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L73)
|