@storyteller-platform/epub 0.6.3 → 0.7.1
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 +529 -1075
- package/dist/adapters/interface.d.cts +25 -19
- package/dist/adapters/interface.d.ts +25 -19
- package/dist/adapters/memory.cjs +19 -29
- package/dist/adapters/memory.d.cts +4 -5
- package/dist/adapters/memory.d.ts +4 -5
- package/dist/adapters/memory.js +19 -32
- package/dist/adapters/tmpfs.cjs +50 -45
- package/dist/adapters/tmpfs.d.cts +9 -7
- package/dist/adapters/tmpfs.d.ts +9 -7
- package/dist/adapters/tmpfs.js +50 -45
- package/dist/epubcheck.cjs +2 -2
- package/dist/epubcheck.js +2 -2
- package/dist/index.cjs +585 -94
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +586 -100
- package/dist/upgrade.cjs +12 -44
- package/dist/upgrade.d.cts +175 -11
- package/dist/upgrade.d.ts +175 -11
- package/dist/upgrade.js +12 -44
- package/dist/zip.cjs +142 -0
- package/dist/zip.d.cts +5 -0
- package/dist/zip.d.ts +5 -0
- package/dist/zip.js +124 -0
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -220,7 +220,7 @@ To get started with developing in the Storyteller monorepo, check out the
|
|
|
220
220
|
## Epub
|
|
221
221
|
|
|
222
222
|
Defined in:
|
|
223
|
-
[epub/index.ts:
|
|
223
|
+
[libraries/epub/index.ts:346](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L346)
|
|
224
224
|
|
|
225
225
|
A single EPUB instance.
|
|
226
226
|
|
|
@@ -263,7 +263,7 @@ https://www.w3.org/TR/epub-33/
|
|
|
263
263
|
> [`Epub`](#epub)
|
|
264
264
|
|
|
265
265
|
Defined in:
|
|
266
|
-
[epub/index.ts:
|
|
266
|
+
[libraries/epub/index.ts:612](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L612)
|
|
267
267
|
|
|
268
268
|
Prefer the static factories ([Epub.using](#using), [Epub.from](#from),
|
|
269
269
|
[Epub.create](#create), [Epub.upgrade](#upgrade)) over calling this constructor
|
|
@@ -290,7 +290,7 @@ nothing else should need to.
|
|
|
290
290
|
> `protected` **adapter**: [`EpubStorageAdapter`](#epubstorageadapter)
|
|
291
291
|
|
|
292
292
|
Defined in:
|
|
293
|
-
[epub/index.ts:
|
|
293
|
+
[libraries/epub/index.ts:614](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L614)
|
|
294
294
|
|
|
295
295
|
#### adapterClass
|
|
296
296
|
|
|
@@ -298,28 +298,28 @@ Defined in:
|
|
|
298
298
|
> [`EpubStorageAdapterClass`](#epubstorageadapterclass)
|
|
299
299
|
|
|
300
300
|
Defined in:
|
|
301
|
-
[epub/index.ts:
|
|
301
|
+
[libraries/epub/index.ts:613](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L613)
|
|
302
302
|
|
|
303
303
|
#### inputPath
|
|
304
304
|
|
|
305
305
|
> `protected` **inputPath**: `undefined` \| `string`
|
|
306
306
|
|
|
307
307
|
Defined in:
|
|
308
|
-
[epub/index.ts:
|
|
308
|
+
[libraries/epub/index.ts:615](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L615)
|
|
309
309
|
|
|
310
310
|
#### readonlyOverride
|
|
311
311
|
|
|
312
312
|
> `protected` **readonlyOverride**: `boolean` = `false`
|
|
313
313
|
|
|
314
314
|
Defined in:
|
|
315
|
-
[epub/index.ts:
|
|
315
|
+
[libraries/epub/index.ts:616](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L616)
|
|
316
316
|
|
|
317
317
|
#### storage
|
|
318
318
|
|
|
319
319
|
> `readonly` **storage**: [`EpubStorageKind`](#epubstoragekind)
|
|
320
320
|
|
|
321
321
|
Defined in:
|
|
322
|
-
[epub/index.ts:
|
|
322
|
+
[libraries/epub/index.ts:604](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L604)
|
|
323
323
|
|
|
324
324
|
Storage backend kind in use for this instance
|
|
325
325
|
|
|
@@ -332,28 +332,28 @@ axis (controlled by `readonlyOverride` and the adapter's capability bag)
|
|
|
332
332
|
> `static` **xhtmlBuilder**: `XMLBuilder`
|
|
333
333
|
|
|
334
334
|
Defined in:
|
|
335
|
-
[epub/index.ts:
|
|
335
|
+
[libraries/epub/index.ts:394](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L394)
|
|
336
336
|
|
|
337
337
|
#### xhtmlParser
|
|
338
338
|
|
|
339
339
|
> `static` **xhtmlParser**: `XMLParser`
|
|
340
340
|
|
|
341
341
|
Defined in:
|
|
342
|
-
[epub/index.ts:
|
|
342
|
+
[libraries/epub/index.ts:354](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L354)
|
|
343
343
|
|
|
344
344
|
#### xmlBuilder
|
|
345
345
|
|
|
346
346
|
> `static` **xmlBuilder**: `XMLBuilder`
|
|
347
347
|
|
|
348
348
|
Defined in:
|
|
349
|
-
[epub/index.ts:
|
|
349
|
+
[libraries/epub/index.ts:387](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L387)
|
|
350
350
|
|
|
351
351
|
#### xmlParser
|
|
352
352
|
|
|
353
353
|
> `static` **xmlParser**: `XMLParser`
|
|
354
354
|
|
|
355
355
|
Defined in:
|
|
356
|
-
[epub/index.ts:
|
|
356
|
+
[libraries/epub/index.ts:347](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L347)
|
|
357
357
|
|
|
358
358
|
### Methods
|
|
359
359
|
|
|
@@ -362,7 +362,7 @@ Defined in:
|
|
|
362
362
|
> **\[dispose\]**(): `void`
|
|
363
363
|
|
|
364
364
|
Defined in:
|
|
365
|
-
[epub/index.ts:
|
|
365
|
+
[libraries/epub/index.ts:3577](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3577)
|
|
366
366
|
|
|
367
367
|
##### Returns
|
|
368
368
|
|
|
@@ -373,7 +373,7 @@ Defined in:
|
|
|
373
373
|
> **addCollection**(`collection`, `index?`): `Promise`\<`void`\>
|
|
374
374
|
|
|
375
375
|
Defined in:
|
|
376
|
-
[epub/index.ts:
|
|
376
|
+
[libraries/epub/index.ts:2223](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2223)
|
|
377
377
|
|
|
378
378
|
Add a collection to the EPUB metadata.
|
|
379
379
|
|
|
@@ -396,7 +396,7 @@ collections. Otherwise, it will be added to the end of the list.
|
|
|
396
396
|
> **addContributor**(`contributor`, `index?`): `Promise`\<`void`\>
|
|
397
397
|
|
|
398
398
|
Defined in:
|
|
399
|
-
[epub/index.ts:
|
|
399
|
+
[libraries/epub/index.ts:2568](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2568)
|
|
400
400
|
|
|
401
401
|
Add a contributor to the EPUB metadata.
|
|
402
402
|
|
|
@@ -426,7 +426,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
426
426
|
> **addCreator**(`creator`, `index?`, `type?`): `Promise`\<`void`\>
|
|
427
427
|
|
|
428
428
|
Defined in:
|
|
429
|
-
[epub/index.ts:
|
|
429
|
+
[libraries/epub/index.ts:2413](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2413)
|
|
430
430
|
|
|
431
431
|
Add a creator to the EPUB metadata.
|
|
432
432
|
|
|
@@ -456,7 +456,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
456
456
|
> **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
457
457
|
|
|
458
458
|
Defined in:
|
|
459
|
-
[epub/index.ts:
|
|
459
|
+
[libraries/epub/index.ts:3164](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3164)
|
|
460
460
|
|
|
461
461
|
Create a new manifest item and write its contents to a new entry.
|
|
462
462
|
|
|
@@ -485,7 +485,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
485
485
|
> **addManifestItem**(`item`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
486
486
|
|
|
487
487
|
Defined in:
|
|
488
|
-
[epub/index.ts:
|
|
488
|
+
[libraries/epub/index.ts:3169](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3169)
|
|
489
489
|
|
|
490
490
|
Create a new manifest item and write its contents to a new entry.
|
|
491
491
|
|
|
@@ -514,7 +514,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
514
514
|
> **addManifestItem**(`item`, `contents`): `Promise`\<`void`\>
|
|
515
515
|
|
|
516
516
|
Defined in:
|
|
517
|
-
[epub/index.ts:
|
|
517
|
+
[libraries/epub/index.ts:3174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3174)
|
|
518
518
|
|
|
519
519
|
Create a new manifest item and write its contents to a new entry.
|
|
520
520
|
|
|
@@ -542,7 +542,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
542
542
|
> **addMetadata**(`entry`): `Promise`\<`void`\>
|
|
543
543
|
|
|
544
544
|
Defined in:
|
|
545
|
-
[epub/index.ts:
|
|
545
|
+
[libraries/epub/index.ts:3285](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3285)
|
|
546
546
|
|
|
547
547
|
Add a new metadata entry to the Epub.
|
|
548
548
|
|
|
@@ -569,7 +569,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
569
569
|
> **addSpineItem**(`manifestId`, `index?`): `Promise`\<`void`\>
|
|
570
570
|
|
|
571
571
|
Defined in:
|
|
572
|
-
[epub/index.ts:
|
|
572
|
+
[libraries/epub/index.ts:2622](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2622)
|
|
573
573
|
|
|
574
574
|
Add an item to the spine of the EPUB.
|
|
575
575
|
|
|
@@ -599,7 +599,7 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
|
599
599
|
> **addSubject**(`subject`): `Promise`\<`void`\>
|
|
600
600
|
|
|
601
601
|
Defined in:
|
|
602
|
-
[epub/index.ts:
|
|
602
|
+
[libraries/epub/index.ts:1752](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1752)
|
|
603
603
|
|
|
604
604
|
Add a subject to the EPUB metadata.
|
|
605
605
|
|
|
@@ -622,7 +622,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
|
|
|
622
622
|
> **copy**(`path?`): `Promise`\<[`Epub`](#epub)\>
|
|
623
623
|
|
|
624
624
|
Defined in:
|
|
625
|
-
[epub/index.ts:
|
|
625
|
+
[libraries/epub/index.ts:709](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L709)
|
|
626
626
|
|
|
627
627
|
##### Parameters
|
|
628
628
|
|
|
@@ -641,7 +641,7 @@ Defined in:
|
|
|
641
641
|
> [`XmlElement`](#xmlelement)\<`"html"`\>)[]\>
|
|
642
642
|
|
|
643
643
|
Defined in:
|
|
644
|
-
[epub/index.ts:
|
|
644
|
+
[libraries/epub/index.ts:2981](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2981)
|
|
645
645
|
|
|
646
646
|
Create a new XHTML document with the given body and head.
|
|
647
647
|
|
|
@@ -663,7 +663,7 @@ Create a new XHTML document with the given body and head.
|
|
|
663
663
|
> **discardAndClose**(): `void`
|
|
664
664
|
|
|
665
665
|
Defined in:
|
|
666
|
-
[epub/index.ts:
|
|
666
|
+
[libraries/epub/index.ts:3527](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3527)
|
|
667
667
|
|
|
668
668
|
##### Returns
|
|
669
669
|
|
|
@@ -674,7 +674,7 @@ Defined in:
|
|
|
674
674
|
> **findAllMetadataItems**(`predicate`): `Promise`\<`object`[]\>
|
|
675
675
|
|
|
676
676
|
Defined in:
|
|
677
|
-
[epub/index.ts:
|
|
677
|
+
[libraries/epub/index.ts:959](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L959)
|
|
678
678
|
|
|
679
679
|
Returns the item in the metadata element's children array that matches the
|
|
680
680
|
provided predicate.
|
|
@@ -693,28 +693,28 @@ provided predicate.
|
|
|
693
693
|
|
|
694
694
|
> **findMetadataItem**(`predicate`): `Promise`\<`null` \| \{ `id`: `undefined`
|
|
695
695
|
> \| `string`; `properties`: \{[`k`: `string`]: `string`; \}; `type`:
|
|
696
|
-
> `` `
|
|
697
|
-
> `` `
|
|
698
|
-
> `` `
|
|
699
|
-
> `` `
|
|
700
|
-
> `` `
|
|
701
|
-
> `` `
|
|
696
|
+
> `` `r${string}` `` \| `` `a${string}` `` \| `` `b${string}` `` \|
|
|
697
|
+
> `` `c${string}` `` \| `` `d${string}` `` \| `` `e${string}` `` \|
|
|
698
|
+
> `` `f${string}` `` \| `` `g${string}` `` \| `` `h${string}` `` \|
|
|
699
|
+
> `` `i${string}` `` \| `` `j${string}` `` \| `` `k${string}` `` \|
|
|
700
|
+
> `` `l${string}` `` \| `` `m${string}` `` \| `` `n${string}` `` \|
|
|
701
|
+
> `` `o${string}` `` \| `` `p${string}` `` \| `` `q${string}` `` \|
|
|
702
702
|
> `` `s${string}` `` \| `` `t${string}` `` \| `` `u${string}` `` \|
|
|
703
703
|
> `` `v${string}` `` \| `` `w${string}` `` \| `` `x${string}` `` \|
|
|
704
|
-
> `` `y${string}` `` \| `` `z${string}` `` \| `` `
|
|
705
|
-
> `` `
|
|
706
|
-
> `` `
|
|
707
|
-
> `` `
|
|
708
|
-
> `` `
|
|
709
|
-
> `` `
|
|
710
|
-
> `` `
|
|
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
711
|
> `` `T${string}` `` \| `` `U${string}` `` \| `` `V${string}` `` \|
|
|
712
712
|
> `` `W${string}` `` \| `` `X${string}` `` \| `` `Y${string}` `` \|
|
|
713
713
|
> `` `Z${string}` `` \| `` `?${string}` ``; `value`: `undefined` \| `string`;
|
|
714
714
|
> \}\>
|
|
715
715
|
|
|
716
716
|
Defined in:
|
|
717
|
-
[epub/index.ts:
|
|
717
|
+
[libraries/epub/index.ts:950](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L950)
|
|
718
718
|
|
|
719
719
|
Returns the item in the metadata element's children array that matches the
|
|
720
720
|
provided predicate.
|
|
@@ -728,21 +728,21 @@ provided predicate.
|
|
|
728
728
|
##### Returns
|
|
729
729
|
|
|
730
730
|
`Promise`\<`null` \| \{ `id`: `undefined` \| `string`; `properties`: \{[`k`:
|
|
731
|
-
`string`]: `string`; \}; `type`: `` `
|
|
732
|
-
`` `
|
|
733
|
-
`` `
|
|
734
|
-
`` `
|
|
735
|
-
`` `
|
|
736
|
-
`` `
|
|
737
|
-
`` `
|
|
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
738
|
`` `u${string}` `` \| `` `v${string}` `` \| `` `w${string}` `` \|
|
|
739
739
|
`` `x${string}` `` \| `` `y${string}` `` \| `` `z${string}` `` \|
|
|
740
|
-
`` `
|
|
741
|
-
`` `
|
|
742
|
-
`` `
|
|
743
|
-
`` `
|
|
744
|
-
`` `
|
|
745
|
-
`` `
|
|
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
746
|
`` `S${string}` `` \| `` `T${string}` `` \| `` `U${string}` `` \|
|
|
747
747
|
`` `V${string}` `` \| `` `W${string}` `` \| `` `X${string}` `` \|
|
|
748
748
|
`` `Y${string}` `` \| `` `Z${string}` `` \| `` `?${string}` ``; `value`:
|
|
@@ -753,7 +753,7 @@ provided predicate.
|
|
|
753
753
|
> **getBaseDirection**(): `Promise`\<`"auto"` \| `"rtl"` \| `"ltr"`\>
|
|
754
754
|
|
|
755
755
|
Defined in:
|
|
756
|
-
[epub/index.ts:
|
|
756
|
+
[libraries/epub/index.ts:1706](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1706)
|
|
757
757
|
|
|
758
758
|
Retrieve the base direction from the package element.
|
|
759
759
|
|
|
@@ -772,7 +772,7 @@ https://www.w3.org/TR/epub-33/#attrdef-dir
|
|
|
772
772
|
> **getCollections**(): `Promise`\<[`Collection`](#collection)[]\>
|
|
773
773
|
|
|
774
774
|
Defined in:
|
|
775
|
-
[epub/index.ts:
|
|
775
|
+
[libraries/epub/index.ts:2183](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2183)
|
|
776
776
|
|
|
777
777
|
Retrieve the list of collections.
|
|
778
778
|
|
|
@@ -785,7 +785,7 @@ Retrieve the list of collections.
|
|
|
785
785
|
> **getContributors**(): `Promise`\<[`DcCreator`](#dccreator)[]\>
|
|
786
786
|
|
|
787
787
|
Defined in:
|
|
788
|
-
[epub/index.ts:
|
|
788
|
+
[libraries/epub/index.ts:2400](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2400)
|
|
789
789
|
|
|
790
790
|
Retrieve the list of contributors.
|
|
791
791
|
|
|
@@ -804,7 +804,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccontributor
|
|
|
804
804
|
> **getCoverImage**(): `Promise`\<`null` \| `Uint8Array`\<`ArrayBufferLike`\>\>
|
|
805
805
|
|
|
806
806
|
Defined in:
|
|
807
|
-
[epub/index.ts:
|
|
807
|
+
[libraries/epub/index.ts:1602](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1602)
|
|
808
808
|
|
|
809
809
|
Retrieve the cover image data as a byte array.
|
|
810
810
|
|
|
@@ -825,7 +825,7 @@ https://www.w3.org/TR/epub-33/#sec-cover-image
|
|
|
825
825
|
> [`ManifestItem`](#manifestitem)\>
|
|
826
826
|
|
|
827
827
|
Defined in:
|
|
828
|
-
[epub/index.ts:
|
|
828
|
+
[libraries/epub/index.ts:1583](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1583)
|
|
829
829
|
|
|
830
830
|
Retrieve the cover image manifest item.
|
|
831
831
|
|
|
@@ -845,7 +845,7 @@ https://www.w3.org/TR/epub-33/#sec-cover-image
|
|
|
845
845
|
> **getCreators**(`type`): `Promise`\<[`DcCreator`](#dccreator)[]\>
|
|
846
846
|
|
|
847
847
|
Defined in:
|
|
848
|
-
[epub/index.ts:
|
|
848
|
+
[libraries/epub/index.ts:2336](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2336)
|
|
849
849
|
|
|
850
850
|
Retrieve the list of creators.
|
|
851
851
|
|
|
@@ -868,7 +868,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
868
868
|
> **getDescription**(): `Promise`\<`null` \| `string`\>
|
|
869
869
|
|
|
870
870
|
Defined in:
|
|
871
|
-
[epub/index.ts:
|
|
871
|
+
[libraries/epub/index.ts:2034](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2034)
|
|
872
872
|
|
|
873
873
|
Retrieve the Epub's description as specified in its package document metadata.
|
|
874
874
|
|
|
@@ -884,7 +884,7 @@ as a string. Descriptions may include HTML markup.
|
|
|
884
884
|
> **getGuideEntries**(): `Promise`\<`GuideItem`[]\>
|
|
885
885
|
|
|
886
886
|
Defined in:
|
|
887
|
-
[epub/index.ts:
|
|
887
|
+
[libraries/epub/index.ts:3504](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3504)
|
|
888
888
|
|
|
889
889
|
Retrieve the guide entries from the package document.
|
|
890
890
|
|
|
@@ -895,14 +895,15 @@ many publications still include it.
|
|
|
895
895
|
|
|
896
896
|
`Promise`\<`GuideItem`[]\>
|
|
897
897
|
|
|
898
|
-
#### getIdentifier()
|
|
898
|
+
#### ~~getIdentifier()~~
|
|
899
899
|
|
|
900
900
|
> **getIdentifier**(): `Promise`\<`null` \| `string`\>
|
|
901
901
|
|
|
902
902
|
Defined in:
|
|
903
|
-
[epub/index.ts:
|
|
903
|
+
[libraries/epub/index.ts:1057](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1057)
|
|
904
904
|
|
|
905
|
-
Retrieve the identifier from the dc:identifier element in the EPUB
|
|
905
|
+
Retrieve the first identifier from the dc:identifier element in the EPUB
|
|
906
|
+
metadata.
|
|
906
907
|
|
|
907
908
|
If there is no dc:identifier element, returns null.
|
|
908
909
|
|
|
@@ -914,12 +915,39 @@ If there is no dc:identifier element, returns null.
|
|
|
914
915
|
|
|
915
916
|
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
916
917
|
|
|
918
|
+
##### Deprecated
|
|
919
|
+
|
|
920
|
+
Use [getUniqueIdentifier](#getuniqueidentifier) instead to get the unique
|
|
921
|
+
identifier, or [getIdentifiers](#getidentifiers) to get all identifiers.
|
|
922
|
+
|
|
923
|
+
#### getIdentifiers()
|
|
924
|
+
|
|
925
|
+
> **getIdentifiers**(): `Promise`\<[`EpubIdentifier`](#epubidentifier)[]\>
|
|
926
|
+
|
|
927
|
+
Defined in:
|
|
928
|
+
[libraries/epub/index.ts:1232](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1232)
|
|
929
|
+
|
|
930
|
+
Retrieve every `dc:identifier` entry, returned as found.
|
|
931
|
+
|
|
932
|
+
Values are not interpreted. Any refining `identifier-type` meta (spec D.3.8) or
|
|
933
|
+
legacy `opf:scheme` attribute is surfaced on the entry, but no parsing of the
|
|
934
|
+
value itself is attempted. To read `dc:source` entries, use
|
|
935
|
+
[getSources](#getsources).
|
|
936
|
+
|
|
937
|
+
##### Returns
|
|
938
|
+
|
|
939
|
+
`Promise`\<[`EpubIdentifier`](#epubidentifier)[]\>
|
|
940
|
+
|
|
941
|
+
##### Link
|
|
942
|
+
|
|
943
|
+
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
944
|
+
|
|
917
945
|
#### getItemArchiveLength()
|
|
918
946
|
|
|
919
947
|
> **getItemArchiveLength**(`id`): `Promise`\<`number`\>
|
|
920
948
|
|
|
921
949
|
Defined in:
|
|
922
|
-
[epub/index.ts:
|
|
950
|
+
[libraries/epub/index.ts:735](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L735)
|
|
923
951
|
|
|
924
952
|
Length of the underlying archive entry for a manifest item, in bytes Necessary
|
|
925
953
|
to compute the readium page count which is for COMPRESSED content
|
|
@@ -944,7 +972,7 @@ to compute the readium page count which is for COMPRESSED content
|
|
|
944
972
|
> [`Navigation`](#navigation)\>
|
|
945
973
|
|
|
946
974
|
Defined in:
|
|
947
|
-
[epub/index.ts:
|
|
975
|
+
[libraries/epub/index.ts:2801](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2801)
|
|
948
976
|
|
|
949
977
|
Returns the structured landmarks navigation document as a Navigation object
|
|
950
978
|
|
|
@@ -968,7 +996,7 @@ https://www.w3.org/TR/epub-33/#sec-nav-landmarks
|
|
|
968
996
|
> **getLanguage**(): `Promise`\<`null` \| `Locale`\>
|
|
969
997
|
|
|
970
998
|
Defined in:
|
|
971
|
-
[epub/index.ts:
|
|
999
|
+
[libraries/epub/index.ts:1871](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1871)
|
|
972
1000
|
|
|
973
1001
|
Retrieve the Epub's language as specified in its package document metadata.
|
|
974
1002
|
|
|
@@ -988,7 +1016,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
|
|
|
988
1016
|
> **getLayout**(): `Promise`\<`"pre-paginated"` \| `"reflowable"`\>
|
|
989
1017
|
|
|
990
1018
|
Defined in:
|
|
991
|
-
[epub/index.ts:
|
|
1019
|
+
[libraries/epub/index.ts:1687](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1687)
|
|
992
1020
|
|
|
993
1021
|
Retrieve the layout from the rendition:layout meta element in the EPUB metadata.
|
|
994
1022
|
|
|
@@ -1008,7 +1036,7 @@ https://www.w3.org/TR/epub-33/#layout
|
|
|
1008
1036
|
> [`ManifestItem`](#manifestitem)\>\>
|
|
1009
1037
|
|
|
1010
1038
|
Defined in:
|
|
1011
|
-
[epub/index.ts:
|
|
1039
|
+
[libraries/epub/index.ts:875](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L875)
|
|
1012
1040
|
|
|
1013
1041
|
Retrieve the manifest for the Epub.
|
|
1014
1042
|
|
|
@@ -1028,7 +1056,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
1028
1056
|
> **getMetadata**(): `Promise`\<[`EpubMetadata`](#epubmetadata)\>
|
|
1029
1057
|
|
|
1030
1058
|
Defined in:
|
|
1031
|
-
[epub/index.ts:
|
|
1059
|
+
[libraries/epub/index.ts:1026](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1026)
|
|
1032
1060
|
|
|
1033
1061
|
Retrieve the metadata entries for the Epub.
|
|
1034
1062
|
|
|
@@ -1051,7 +1079,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
1051
1079
|
> **getModifiedDate**(): `Promise`\<`null` \| `Date`\>
|
|
1052
1080
|
|
|
1053
1081
|
Defined in:
|
|
1054
|
-
[epub/index.ts:
|
|
1082
|
+
[libraries/epub/index.ts:1670](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1670)
|
|
1055
1083
|
|
|
1056
1084
|
Retrieve the modified date from the dcterms:modified metadata in the EPUB
|
|
1057
1085
|
metadata as a Date object.
|
|
@@ -1071,7 +1099,7 @@ https://www.w3.org/TR/epub-33/#sec-metadata-last-modified
|
|
|
1071
1099
|
> **getNcxTableOfContents**(): `Promise`\<[`NavigationList`](#navigationlist)\>
|
|
1072
1100
|
|
|
1073
1101
|
Defined in:
|
|
1074
|
-
[epub/index.ts:
|
|
1102
|
+
[libraries/epub/index.ts:3410](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3410)
|
|
1075
1103
|
|
|
1076
1104
|
Parse the NCX table of contents, if one exists, and return a tree of TocEntry
|
|
1077
1105
|
nodes.
|
|
@@ -1089,7 +1117,7 @@ and EPUB 3 publications that retain an NCX for backwards compatibility.
|
|
|
1089
1117
|
> `Promise`\<[`XmlElement`](#xmlelement)\<`"package"`\>\>
|
|
1090
1118
|
|
|
1091
1119
|
Defined in:
|
|
1092
|
-
[epub/index.ts:
|
|
1120
|
+
[libraries/epub/index.ts:810](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L810)
|
|
1093
1121
|
|
|
1094
1122
|
##### Returns
|
|
1095
1123
|
|
|
@@ -1101,7 +1129,7 @@ Defined in:
|
|
|
1101
1129
|
> `string`\>\>
|
|
1102
1130
|
|
|
1103
1131
|
Defined in:
|
|
1104
|
-
[epub/index.ts:
|
|
1132
|
+
[libraries/epub/index.ts:2051](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2051)
|
|
1105
1133
|
|
|
1106
1134
|
Return the set of custom vocabulary prefixes set on this publication's root
|
|
1107
1135
|
package element.
|
|
@@ -1116,13 +1144,35 @@ Returns a map from prefix to URI
|
|
|
1116
1144
|
|
|
1117
1145
|
https://www.w3.org/TR/epub-33/#sec-prefix-attr
|
|
1118
1146
|
|
|
1147
|
+
#### getPageBreakSource()
|
|
1148
|
+
|
|
1149
|
+
> **getPageBreakSource**(): `Promise`\<`null` \| [`EpubSource`](#epubsource)\>
|
|
1150
|
+
|
|
1151
|
+
Defined in:
|
|
1152
|
+
[libraries/epub/index.ts:1269](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1269)
|
|
1153
|
+
|
|
1154
|
+
Retrieve the `pageBreakSource` property (EPUB 3.4, spec D.2.9), the
|
|
1155
|
+
publication-level source for the source of its page break markers.
|
|
1156
|
+
|
|
1157
|
+
This property replaces the refining `source-of="pagination"` meta (spec D.3.11),
|
|
1158
|
+
see EpubSource.sourceOf. If no `pageBreakSource` property is found, we fall back
|
|
1159
|
+
to finding a `dc:source` with a `source-of="pagination"` refinement.
|
|
1160
|
+
|
|
1161
|
+
##### Returns
|
|
1162
|
+
|
|
1163
|
+
`Promise`\<`null` \| [`EpubSource`](#epubsource)\>
|
|
1164
|
+
|
|
1165
|
+
##### Link
|
|
1166
|
+
|
|
1167
|
+
https://www.w3.org/TR/epub/#pageBreakSource
|
|
1168
|
+
|
|
1119
1169
|
#### getPageList()
|
|
1120
1170
|
|
|
1121
1171
|
> **getPageList**(`__namedParameters`): `Promise`\<`null` \|
|
|
1122
1172
|
> [`Navigation`](#navigation)\>
|
|
1123
1173
|
|
|
1124
1174
|
Defined in:
|
|
1125
|
-
[epub/index.ts:
|
|
1175
|
+
[libraries/epub/index.ts:2813](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2813)
|
|
1126
1176
|
|
|
1127
1177
|
Returns the structured page list navigation document as a Navigation object
|
|
1128
1178
|
|
|
@@ -1146,7 +1196,7 @@ https://www.w3.org/TR/epub-33/#sec-nav-landmarks
|
|
|
1146
1196
|
> **getPublicationDate**(): `Promise`\<`null` \| `Date`\>
|
|
1147
1197
|
|
|
1148
1198
|
Defined in:
|
|
1149
|
-
[epub/index.ts:
|
|
1199
|
+
[libraries/epub/index.ts:1639](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1639)
|
|
1150
1200
|
|
|
1151
1201
|
Retrieve the publication date from the dc:date element in the EPUB metadata as a
|
|
1152
1202
|
Date object.
|
|
@@ -1166,18 +1216,39 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcdate
|
|
|
1166
1216
|
> **getRootfile**(): `Promise`\<`string`\>
|
|
1167
1217
|
|
|
1168
1218
|
Defined in:
|
|
1169
|
-
[epub/index.ts:
|
|
1219
|
+
[libraries/epub/index.ts:746](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L746)
|
|
1170
1220
|
|
|
1171
1221
|
##### Returns
|
|
1172
1222
|
|
|
1173
1223
|
`Promise`\<`string`\>
|
|
1174
1224
|
|
|
1225
|
+
#### getSources()
|
|
1226
|
+
|
|
1227
|
+
> **getSources**(): `Promise`\<[`EpubSource`](#epubsource)[]\>
|
|
1228
|
+
|
|
1229
|
+
Defined in:
|
|
1230
|
+
[libraries/epub/index.ts:1246](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1246)
|
|
1231
|
+
|
|
1232
|
+
Retrieve every `dc:source` entry, returned as found.
|
|
1233
|
+
|
|
1234
|
+
Like [getIdentifiers](#getidentifiers), values are not interpreted. In addition
|
|
1235
|
+
to a refining `identifier-type`, a refining `source-of` meta (spec D.3.11) is
|
|
1236
|
+
surfaced as `sourceOf`.
|
|
1237
|
+
|
|
1238
|
+
##### Returns
|
|
1239
|
+
|
|
1240
|
+
`Promise`\<[`EpubSource`](#epubsource)[]\>
|
|
1241
|
+
|
|
1242
|
+
##### Link
|
|
1243
|
+
|
|
1244
|
+
https://www.w3.org/TR/epub-33/#sec-opf-dcsource
|
|
1245
|
+
|
|
1175
1246
|
#### getSpineItems()
|
|
1176
1247
|
|
|
1177
1248
|
> **getSpineItems**(): `Promise`\<[`ManifestItem`](#manifestitem)[]\>
|
|
1178
1249
|
|
|
1179
1250
|
Defined in:
|
|
1180
|
-
[epub/index.ts:
|
|
1251
|
+
[libraries/epub/index.ts:2603](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2603)
|
|
1181
1252
|
|
|
1182
1253
|
Retrieve the manifest items that make up the Epub's spine.
|
|
1183
1254
|
|
|
@@ -1197,7 +1268,7 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
|
1197
1268
|
> **getSubjects**(): `Promise`\<(`string` \| [`DcSubject`](#dcsubject))[]\>
|
|
1198
1269
|
|
|
1199
1270
|
Defined in:
|
|
1200
|
-
[epub/index.ts:
|
|
1271
|
+
[libraries/epub/index.ts:1826](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1826)
|
|
1201
1272
|
|
|
1202
1273
|
Retrieve the list of subjects for this EPUB.
|
|
1203
1274
|
|
|
@@ -1218,7 +1289,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
|
|
|
1218
1289
|
> **getSubtitle**(): `Promise`\<`null` \| `string`\>
|
|
1219
1290
|
|
|
1220
1291
|
Defined in:
|
|
1221
|
-
[epub/index.ts:
|
|
1292
|
+
[libraries/epub/index.ts:1941](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1941)
|
|
1222
1293
|
|
|
1223
1294
|
Retrieve the subtitle of the Epub, if it exists.
|
|
1224
1295
|
|
|
@@ -1236,7 +1307,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
1236
1307
|
> [`Navigation`](#navigation)\>
|
|
1237
1308
|
|
|
1238
1309
|
Defined in:
|
|
1239
|
-
[epub/index.ts:
|
|
1310
|
+
[libraries/epub/index.ts:2784](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2784)
|
|
1240
1311
|
|
|
1241
1312
|
Returns the structured table of contents navigation document as a Navigation
|
|
1242
1313
|
object.
|
|
@@ -1261,7 +1332,7 @@ https://www.w3.org/TR/epub-33/#sec-nav-toc
|
|
|
1261
1332
|
> **getTitle**(`expanded`): `Promise`\<`null` \| `string`\>
|
|
1262
1333
|
|
|
1263
1334
|
Defined in:
|
|
1264
|
-
[epub/index.ts:
|
|
1335
|
+
[libraries/epub/index.ts:1917](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1917)
|
|
1265
1336
|
|
|
1266
1337
|
Retrieve the title of the Epub.
|
|
1267
1338
|
|
|
@@ -1284,7 +1355,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
1284
1355
|
> **getTitles**(): `Promise`\<`object`[]\>
|
|
1285
1356
|
|
|
1286
1357
|
Defined in:
|
|
1287
|
-
[epub/index.ts:
|
|
1358
|
+
[libraries/epub/index.ts:1953](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1953)
|
|
1288
1359
|
|
|
1289
1360
|
Retrieve all title entries of the Epub.
|
|
1290
1361
|
|
|
@@ -1301,7 +1372,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
1301
1372
|
> **getType**(): `Promise`\<`null` \| [`MetadataEntry`](#metadataentry)\>
|
|
1302
1373
|
|
|
1303
1374
|
Defined in:
|
|
1304
|
-
[epub/index.ts:
|
|
1375
|
+
[libraries/epub/index.ts:1739](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1739)
|
|
1305
1376
|
|
|
1306
1377
|
Retrieve the publication type from the dc:type element in the EPUB metadata.
|
|
1307
1378
|
|
|
@@ -1315,12 +1386,49 @@ If there is no dc:type element, returns null.
|
|
|
1315
1386
|
|
|
1316
1387
|
https://www.w3.org/TR/epub-33/#sec-opf-dctype
|
|
1317
1388
|
|
|
1389
|
+
#### getUniqueIdentifier()
|
|
1390
|
+
|
|
1391
|
+
> **getUniqueIdentifier**(): `Promise`\<`null` \| `string`\>
|
|
1392
|
+
|
|
1393
|
+
Defined in:
|
|
1394
|
+
[libraries/epub/index.ts:1089](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1089)
|
|
1395
|
+
|
|
1396
|
+
Retrieve the identifier with the unique identifier id in the EPUB metadata.
|
|
1397
|
+
|
|
1398
|
+
If there is no unique identifier id, returns the first dc:identifier element.
|
|
1399
|
+
|
|
1400
|
+
##### Returns
|
|
1401
|
+
|
|
1402
|
+
`Promise`\<`null` \| `string`\>
|
|
1403
|
+
|
|
1404
|
+
##### Link
|
|
1405
|
+
|
|
1406
|
+
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
1407
|
+
|
|
1408
|
+
#### getUniqueIdentifierId()
|
|
1409
|
+
|
|
1410
|
+
> **getUniqueIdentifierId**(): `Promise`\<`null` \| `string`\>
|
|
1411
|
+
|
|
1412
|
+
Defined in:
|
|
1413
|
+
[libraries/epub/index.ts:1170](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1170)
|
|
1414
|
+
|
|
1415
|
+
Retrieve the id of the publication's unique identifier, as declared by the
|
|
1416
|
+
package element's `unique-identifier` attribute.
|
|
1417
|
+
|
|
1418
|
+
##### Returns
|
|
1419
|
+
|
|
1420
|
+
`Promise`\<`null` \| `string`\>
|
|
1421
|
+
|
|
1422
|
+
##### Link
|
|
1423
|
+
|
|
1424
|
+
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
1425
|
+
|
|
1318
1426
|
#### getVersion()
|
|
1319
1427
|
|
|
1320
1428
|
> **getVersion**(): `Promise`\<`string`\>
|
|
1321
1429
|
|
|
1322
1430
|
Defined in:
|
|
1323
|
-
[epub/index.ts:
|
|
1431
|
+
[libraries/epub/index.ts:3397](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3397)
|
|
1324
1432
|
|
|
1325
1433
|
Returns the EPUB version declared on the package element.
|
|
1326
1434
|
|
|
@@ -1336,7 +1444,7 @@ Returns the EPUB version declared on the package element.
|
|
|
1336
1444
|
> `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
1337
1445
|
|
|
1338
1446
|
Defined in:
|
|
1339
|
-
[epub/index.ts:
|
|
1447
|
+
[libraries/epub/index.ts:2920](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2920)
|
|
1340
1448
|
|
|
1341
1449
|
Retrieve the contents of a file, given its href.
|
|
1342
1450
|
|
|
@@ -1359,7 +1467,7 @@ encoding parameter.
|
|
|
1359
1467
|
> **readFileContents**(`href`, `relativeTo`, `encoding`): `Promise`\<`string`\>
|
|
1360
1468
|
|
|
1361
1469
|
Defined in:
|
|
1362
|
-
[epub/index.ts:
|
|
1470
|
+
[libraries/epub/index.ts:2921](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2921)
|
|
1363
1471
|
|
|
1364
1472
|
Retrieve the contents of a file, given its href.
|
|
1365
1473
|
|
|
@@ -1385,7 +1493,7 @@ encoding parameter.
|
|
|
1385
1493
|
> **readItemContents**(`id`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
1386
1494
|
|
|
1387
1495
|
Defined in:
|
|
1388
|
-
[epub/index.ts:
|
|
1496
|
+
[libraries/epub/index.ts:2953](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2953)
|
|
1389
1497
|
|
|
1390
1498
|
Retrieve the contents of a manifest item, given its id.
|
|
1391
1499
|
|
|
@@ -1408,7 +1516,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
1408
1516
|
> **readItemContents**(`id`, `encoding`): `Promise`\<`string`\>
|
|
1409
1517
|
|
|
1410
1518
|
Defined in:
|
|
1411
|
-
[epub/index.ts:
|
|
1519
|
+
[libraries/epub/index.ts:2954](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2954)
|
|
1412
1520
|
|
|
1413
1521
|
Retrieve the contents of a manifest item, given its id.
|
|
1414
1522
|
|
|
@@ -1434,7 +1542,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
1434
1542
|
> **readXhtmlItemContents**(`id`, `as?`): `Promise`\<[`ParsedXml`](#parsedxml)\>
|
|
1435
1543
|
|
|
1436
1544
|
Defined in:
|
|
1437
|
-
[epub/index.ts:
|
|
1545
|
+
[libraries/epub/index.ts:3016](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3016)
|
|
1438
1546
|
|
|
1439
1547
|
Retrieves the contents of an XHTML item, given its manifest id.
|
|
1440
1548
|
|
|
@@ -1458,7 +1566,7 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
|
1458
1566
|
> **readXhtmlItemContents**(`id`, `as`): `Promise`\<`string`\>
|
|
1459
1567
|
|
|
1460
1568
|
Defined in:
|
|
1461
|
-
[epub/index.ts:
|
|
1569
|
+
[libraries/epub/index.ts:3017](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3017)
|
|
1462
1570
|
|
|
1463
1571
|
Retrieves the contents of an XHTML item, given its manifest id.
|
|
1464
1572
|
|
|
@@ -1482,7 +1590,7 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
|
1482
1590
|
> **removeCollection**(`index`): `Promise`\<`void`\>
|
|
1483
1591
|
|
|
1484
1592
|
Defined in:
|
|
1485
|
-
[epub/index.ts:
|
|
1593
|
+
[libraries/epub/index.ts:2292](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2292)
|
|
1486
1594
|
|
|
1487
1595
|
Remove a collection from the EPUB metadata.
|
|
1488
1596
|
|
|
@@ -1504,7 +1612,7 @@ returned by `epub.getCollections()`.
|
|
|
1504
1612
|
> **removeContributor**(`index`): `Promise`\<`void`\>
|
|
1505
1613
|
|
|
1506
1614
|
Defined in:
|
|
1507
|
-
[epub/index.ts:
|
|
1615
|
+
[libraries/epub/index.ts:2552](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2552)
|
|
1508
1616
|
|
|
1509
1617
|
Remove a contributor from the EPUB metadata.
|
|
1510
1618
|
|
|
@@ -1532,7 +1640,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
1532
1640
|
> **removeCreator**(`index`, `type`): `Promise`\<`void`\>
|
|
1533
1641
|
|
|
1534
1642
|
Defined in:
|
|
1535
|
-
[epub/index.ts:
|
|
1643
|
+
[libraries/epub/index.ts:2500](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2500)
|
|
1536
1644
|
|
|
1537
1645
|
Remove a creator from the EPUB metadata.
|
|
1538
1646
|
|
|
@@ -1559,7 +1667,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
1559
1667
|
> **removeManifestItem**(`id`): `Promise`\<`void`\>
|
|
1560
1668
|
|
|
1561
1669
|
Defined in:
|
|
1562
|
-
[epub/index.ts:
|
|
1670
|
+
[libraries/epub/index.ts:3121](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3121)
|
|
1563
1671
|
|
|
1564
1672
|
##### Parameters
|
|
1565
1673
|
|
|
@@ -1576,7 +1684,7 @@ Defined in:
|
|
|
1576
1684
|
> **removeMetadata**(`predicate`): `Promise`\<`void`\>
|
|
1577
1685
|
|
|
1578
1686
|
Defined in:
|
|
1579
|
-
[epub/index.ts:
|
|
1687
|
+
[libraries/epub/index.ts:3369](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3369)
|
|
1580
1688
|
|
|
1581
1689
|
Remove one or more metadata entries.
|
|
1582
1690
|
|
|
@@ -1602,7 +1710,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
1602
1710
|
> **removeSpineItem**(`index`): `Promise`\<`void`\>
|
|
1603
1711
|
|
|
1604
1712
|
Defined in:
|
|
1605
|
-
[epub/index.ts:
|
|
1713
|
+
[libraries/epub/index.ts:2658](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2658)
|
|
1606
1714
|
|
|
1607
1715
|
Remove the spine item at the specified index.
|
|
1608
1716
|
|
|
@@ -1625,7 +1733,7 @@ https://www.w3.org/TR/epub-33/#sec-spine-elem
|
|
|
1625
1733
|
> **removeSubject**(`index`): `Promise`\<`void`\>
|
|
1626
1734
|
|
|
1627
1735
|
Defined in:
|
|
1628
|
-
[epub/index.ts:
|
|
1736
|
+
[libraries/epub/index.ts:1789](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1789)
|
|
1629
1737
|
|
|
1630
1738
|
Remove a subject from the EPUB metadata.
|
|
1631
1739
|
|
|
@@ -1651,7 +1759,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dccreator
|
|
|
1651
1759
|
> **replaceMetadata**(`predicate`, `entry`): `Promise`\<`void`\>
|
|
1652
1760
|
|
|
1653
1761
|
Defined in:
|
|
1654
|
-
[epub/index.ts:
|
|
1762
|
+
[libraries/epub/index.ts:3324](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3324)
|
|
1655
1763
|
|
|
1656
1764
|
Replace a metadata entry with a new one.
|
|
1657
1765
|
|
|
@@ -1679,10 +1787,13 @@ https://www.w3.org/TR/epub-33/#sec-pkg-metadata
|
|
|
1679
1787
|
> `Promise`\<`string`\>
|
|
1680
1788
|
|
|
1681
1789
|
Defined in:
|
|
1682
|
-
[epub/index.ts:
|
|
1790
|
+
[libraries/epub/index.ts:2876](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2876)
|
|
1683
1791
|
|
|
1684
1792
|
Returns a path-relative-scheme-less URL, relative to the container root.
|
|
1685
1793
|
|
|
1794
|
+
An href that points outside the publication, such as an external link in a
|
|
1795
|
+
navigation document, is handed back unchanged.
|
|
1796
|
+
|
|
1686
1797
|
##### Parameters
|
|
1687
1798
|
|
|
1688
1799
|
| Parameter | Type | Description |
|
|
@@ -1701,7 +1812,7 @@ Returns a path-relative-scheme-less URL, relative to the container root.
|
|
|
1701
1812
|
> **saveAndClose**(): `Promise`\<`void`\>
|
|
1702
1813
|
|
|
1703
1814
|
Defined in:
|
|
1704
|
-
[epub/index.ts:
|
|
1815
|
+
[libraries/epub/index.ts:3542](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3542)
|
|
1705
1816
|
|
|
1706
1817
|
Write the current contents of the Epub to a new EPUB archive on disk.
|
|
1707
1818
|
|
|
@@ -1717,7 +1828,7 @@ updated to the current UTC timestamp.
|
|
|
1717
1828
|
> **setCoverImage**(`href`, `data`): `Promise`\<`void`\>
|
|
1718
1829
|
|
|
1719
1830
|
Defined in:
|
|
1720
|
-
[epub/index.ts:
|
|
1831
|
+
[libraries/epub/index.ts:1616](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1616)
|
|
1721
1832
|
|
|
1722
1833
|
Set the cover image for the EPUB.
|
|
1723
1834
|
|
|
@@ -1740,7 +1851,7 @@ then writes the provided image data to the provided href within the publication.
|
|
|
1740
1851
|
> **setDescription**(`description`): `Promise`\<`void`\>
|
|
1741
1852
|
|
|
1742
1853
|
Defined in:
|
|
1743
|
-
[epub/index.ts:
|
|
1854
|
+
[libraries/epub/index.ts:2018](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2018)
|
|
1744
1855
|
|
|
1745
1856
|
Update the Epub's description metadata entry.
|
|
1746
1857
|
|
|
@@ -1758,12 +1869,12 @@ encoded as HTML entities.
|
|
|
1758
1869
|
|
|
1759
1870
|
`Promise`\<`void`\>
|
|
1760
1871
|
|
|
1761
|
-
#### setIdentifier()
|
|
1872
|
+
#### ~~setIdentifier()~~
|
|
1762
1873
|
|
|
1763
1874
|
> **setIdentifier**(`identifier`): `Promise`\<`void`\>
|
|
1764
1875
|
|
|
1765
1876
|
Defined in:
|
|
1766
|
-
[epub/index.ts:
|
|
1877
|
+
[libraries/epub/index.ts:1073](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1073)
|
|
1767
1878
|
|
|
1768
1879
|
Set the dc:identifier metadata element with the provided string.
|
|
1769
1880
|
|
|
@@ -1784,12 +1895,54 @@ new element
|
|
|
1784
1895
|
|
|
1785
1896
|
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
1786
1897
|
|
|
1898
|
+
##### Deprecated
|
|
1899
|
+
|
|
1900
|
+
Use [setUniqueIdentifier](#setuniqueidentifier) instead.
|
|
1901
|
+
|
|
1902
|
+
#### setIdentifiers()
|
|
1903
|
+
|
|
1904
|
+
> **setIdentifiers**(`identifiers`): `Promise`\<`void`\>
|
|
1905
|
+
|
|
1906
|
+
Defined in:
|
|
1907
|
+
[libraries/epub/index.ts:1338](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1338)
|
|
1908
|
+
|
|
1909
|
+
Replace the publication's `dc:identifier` entries.
|
|
1910
|
+
|
|
1911
|
+
This replaces ALL existing `dc:identifier` elements except the publication's
|
|
1912
|
+
unique identifier (the one referenced by the package element's
|
|
1913
|
+
`unique-identifier` attribute), which is always preserved and must not be
|
|
1914
|
+
included in the provided list. If included anyway, it is ignored. See
|
|
1915
|
+
[setUniqueIdentifier](#setuniqueidentifier) to change it.
|
|
1916
|
+
|
|
1917
|
+
Identifiers are placed in the order they are provided.
|
|
1918
|
+
|
|
1919
|
+
`dc:source` entries are not touched, use [setSources](#setsources) for those.
|
|
1920
|
+
|
|
1921
|
+
When an entry has an `identifierType`, it is written in the refining form (a
|
|
1922
|
+
`meta` with `property="identifier-type"`, carrying the `scheme` attribute when
|
|
1923
|
+
provided). An entry with only a `scheme` is written using the legacy
|
|
1924
|
+
`opf:scheme` attribute.
|
|
1925
|
+
|
|
1926
|
+
##### Parameters
|
|
1927
|
+
|
|
1928
|
+
| Parameter | Type |
|
|
1929
|
+
| ------------- | ------------------------------------- |
|
|
1930
|
+
| `identifiers` | [`EpubIdentifier`](#epubidentifier)[] |
|
|
1931
|
+
|
|
1932
|
+
##### Returns
|
|
1933
|
+
|
|
1934
|
+
`Promise`\<`void`\>
|
|
1935
|
+
|
|
1936
|
+
##### Link
|
|
1937
|
+
|
|
1938
|
+
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
1939
|
+
|
|
1787
1940
|
#### setLanguage()
|
|
1788
1941
|
|
|
1789
1942
|
> **setLanguage**(`locale`): `Promise`\<`void`\>
|
|
1790
1943
|
|
|
1791
1944
|
Defined in:
|
|
1792
|
-
[epub/index.ts:
|
|
1945
|
+
[libraries/epub/index.ts:1900](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1900)
|
|
1793
1946
|
|
|
1794
1947
|
Update the Epub's language metadata entry.
|
|
1795
1948
|
|
|
@@ -1815,7 +1968,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dclanguage
|
|
|
1815
1968
|
> **setPackageVocabularyPrefix**(`prefix`, `uri`): `Promise`\<`void`\>
|
|
1816
1969
|
|
|
1817
1970
|
Defined in:
|
|
1818
|
-
[epub/index.ts:
|
|
1971
|
+
[libraries/epub/index.ts:2069](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2069)
|
|
1819
1972
|
|
|
1820
1973
|
Set a custom vocabulary prefix on the root package element.
|
|
1821
1974
|
|
|
@@ -1834,12 +1987,38 @@ Set a custom vocabulary prefix on the root package element.
|
|
|
1834
1987
|
|
|
1835
1988
|
https://www.w3.org/TR/epub-33/#sec-prefix-attr
|
|
1836
1989
|
|
|
1990
|
+
#### setPageBreakSource()
|
|
1991
|
+
|
|
1992
|
+
> **setPageBreakSource**(`value`): `Promise`\<`void`\>
|
|
1993
|
+
|
|
1994
|
+
Defined in:
|
|
1995
|
+
[libraries/epub/index.ts:1305](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1305)
|
|
1996
|
+
|
|
1997
|
+
Set the `pageBreakSource` property (EPUB 3.4, spec D.2.9), or remove it when
|
|
1998
|
+
passed null. Replaces an existing `pageBreakSource` meta if present.
|
|
1999
|
+
|
|
2000
|
+
Pass `none` to indicate the pagination is unique to this publication.
|
|
2001
|
+
|
|
2002
|
+
##### Parameters
|
|
2003
|
+
|
|
2004
|
+
| Parameter | Type |
|
|
2005
|
+
| --------- | ------------------ |
|
|
2006
|
+
| `value` | `null` \| `string` |
|
|
2007
|
+
|
|
2008
|
+
##### Returns
|
|
2009
|
+
|
|
2010
|
+
`Promise`\<`void`\>
|
|
2011
|
+
|
|
2012
|
+
##### Link
|
|
2013
|
+
|
|
2014
|
+
https://www.w3.org/TR/epub/#pageBreakSource
|
|
2015
|
+
|
|
1837
2016
|
#### setPublicationDate()
|
|
1838
2017
|
|
|
1839
2018
|
> **setPublicationDate**(`date`): `Promise`\<`void`\>
|
|
1840
2019
|
|
|
1841
2020
|
Defined in:
|
|
1842
|
-
[epub/index.ts:
|
|
2021
|
+
[libraries/epub/index.ts:1654](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1654)
|
|
1843
2022
|
|
|
1844
2023
|
Set the dc:date metadata element with the provided date.
|
|
1845
2024
|
|
|
@@ -1860,12 +2039,44 @@ element
|
|
|
1860
2039
|
|
|
1861
2040
|
https://www.w3.org/TR/epub-33/#sec-opf-dcdate
|
|
1862
2041
|
|
|
2042
|
+
#### setSources()
|
|
2043
|
+
|
|
2044
|
+
> **setSources**(`sources`): `Promise`\<`void`\>
|
|
2045
|
+
|
|
2046
|
+
Defined in:
|
|
2047
|
+
[libraries/epub/index.ts:1456](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1456)
|
|
2048
|
+
|
|
2049
|
+
Replace the publication's `dc:source` entries.
|
|
2050
|
+
|
|
2051
|
+
This replaces ALL existing `dc:source` elements (and their refining
|
|
2052
|
+
`identifier-type` / `source-of` metas). `dc:identifier` entries are not touched;
|
|
2053
|
+
use [setIdentifiers](#setidentifiers) for those. Pass an empty array to remove
|
|
2054
|
+
all sources.
|
|
2055
|
+
|
|
2056
|
+
When an entry has an `identifierType`, it is written in the refining form. A
|
|
2057
|
+
`sourceOf` value is written as a refining `source-of` meta (spec D.3.11). An
|
|
2058
|
+
entry with only a `scheme` uses the legacy `opf:scheme` attribute.
|
|
2059
|
+
|
|
2060
|
+
##### Parameters
|
|
2061
|
+
|
|
2062
|
+
| Parameter | Type |
|
|
2063
|
+
| --------- | ----------------------------- |
|
|
2064
|
+
| `sources` | [`EpubSource`](#epubsource)[] |
|
|
2065
|
+
|
|
2066
|
+
##### Returns
|
|
2067
|
+
|
|
2068
|
+
`Promise`\<`void`\>
|
|
2069
|
+
|
|
2070
|
+
##### Link
|
|
2071
|
+
|
|
2072
|
+
https://www.w3.org/TR/epub-33/#sec-opf-dcsource
|
|
2073
|
+
|
|
1863
2074
|
#### setTitle()
|
|
1864
2075
|
|
|
1865
2076
|
> **setTitle**(`title`): `Promise`\<`void`\>
|
|
1866
2077
|
|
|
1867
2078
|
Defined in:
|
|
1868
|
-
[epub/index.ts:
|
|
2079
|
+
[libraries/epub/index.ts:2093](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2093)
|
|
1869
2080
|
|
|
1870
2081
|
Set the title of the Epub.
|
|
1871
2082
|
|
|
@@ -1893,7 +2104,7 @@ https://www.w3.org/TR/epub-33/#sec-opf-dctitle
|
|
|
1893
2104
|
> **setTitles**(`entries`): `Promise`\<`void`\>
|
|
1894
2105
|
|
|
1895
2106
|
Defined in:
|
|
1896
|
-
[epub/index.ts:
|
|
2107
|
+
[libraries/epub/index.ts:2121](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L2121)
|
|
1897
2108
|
|
|
1898
2109
|
##### Parameters
|
|
1899
2110
|
|
|
@@ -1910,7 +2121,7 @@ Defined in:
|
|
|
1910
2121
|
> **setType**(`type`): `Promise`\<`void`\>
|
|
1911
2122
|
|
|
1912
2123
|
Defined in:
|
|
1913
|
-
[epub/index.ts:
|
|
2124
|
+
[libraries/epub/index.ts:1723](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1723)
|
|
1914
2125
|
|
|
1915
2126
|
Set the dc:type metadata element.
|
|
1916
2127
|
|
|
@@ -1931,12 +2142,42 @@ element.
|
|
|
1931
2142
|
|
|
1932
2143
|
https://www.w3.org/TR/epub-33/#sec-opf-dctype
|
|
1933
2144
|
|
|
2145
|
+
#### setUniqueIdentifier()
|
|
2146
|
+
|
|
2147
|
+
> **setUniqueIdentifier**(`identifier`): `Promise`\<`void`\>
|
|
2148
|
+
|
|
2149
|
+
Defined in:
|
|
2150
|
+
[libraries/epub/index.ts:1114](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L1114)
|
|
2151
|
+
|
|
2152
|
+
Set the unique identifier id for the EPUB.
|
|
2153
|
+
|
|
2154
|
+
Updates the existing dc:identifier element referenced by the unique identifier
|
|
2155
|
+
id if one exists. Otherwise creates a new element with the provided identifier,
|
|
2156
|
+
and sets the unique identifier id to the new element's id.
|
|
2157
|
+
|
|
2158
|
+
Note: you likely shouldn't change the unique identifier id unless you are
|
|
2159
|
+
producing a new EPUB.
|
|
2160
|
+
|
|
2161
|
+
##### Parameters
|
|
2162
|
+
|
|
2163
|
+
| Parameter | Type |
|
|
2164
|
+
| ------------ | -------- |
|
|
2165
|
+
| `identifier` | `string` |
|
|
2166
|
+
|
|
2167
|
+
##### Returns
|
|
2168
|
+
|
|
2169
|
+
`Promise`\<`void`\>
|
|
2170
|
+
|
|
2171
|
+
##### Link
|
|
2172
|
+
|
|
2173
|
+
https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier
|
|
2174
|
+
|
|
1934
2175
|
#### updateManifestItem()
|
|
1935
2176
|
|
|
1936
2177
|
> **updateManifestItem**(`id`, `newItem`): `Promise`\<`void`\>
|
|
1937
2178
|
|
|
1938
2179
|
Defined in:
|
|
1939
|
-
[epub/index.ts:
|
|
2180
|
+
[libraries/epub/index.ts:3236](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3236)
|
|
1940
2181
|
|
|
1941
2182
|
Update the manifest entry for an existing item.
|
|
1942
2183
|
|
|
@@ -1963,7 +2204,7 @@ https://www.w3.org/TR/epub-33/#sec-pkg-manifest
|
|
|
1963
2204
|
> **withPackage**(`producer`): `Promise`\<`void`\>
|
|
1964
2205
|
|
|
1965
2206
|
Defined in:
|
|
1966
|
-
[epub/index.ts:
|
|
2207
|
+
[libraries/epub/index.ts:836](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L836)
|
|
1967
2208
|
|
|
1968
2209
|
Safely modify the package document, without race conditions.
|
|
1969
2210
|
|
|
@@ -1989,7 +2230,7 @@ update runs exclusively.
|
|
|
1989
2230
|
> **writeItemContents**(`id`, `contents`): `Promise`\<`void`\>
|
|
1990
2231
|
|
|
1991
2232
|
Defined in:
|
|
1992
|
-
[epub/index.ts:
|
|
2233
|
+
[libraries/epub/index.ts:3073](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3073)
|
|
1993
2234
|
|
|
1994
2235
|
Write new contents for an existing manifest item, specified by its id.
|
|
1995
2236
|
|
|
@@ -2016,7 +2257,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
2016
2257
|
> **writeItemContents**(`id`, `contents`, `encoding`): `Promise`\<`void`\>
|
|
2017
2258
|
|
|
2018
2259
|
Defined in:
|
|
2019
|
-
[epub/index.ts:
|
|
2260
|
+
[libraries/epub/index.ts:3074](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3074)
|
|
2020
2261
|
|
|
2021
2262
|
Write new contents for an existing manifest item, specified by its id.
|
|
2022
2263
|
|
|
@@ -2044,7 +2285,7 @@ https://www.w3.org/TR/epub-33/#sec-contentdocs
|
|
|
2044
2285
|
> **writeXhtmlItemContents**(`id`, `contents`): `Promise`\<`void`\>
|
|
2045
2286
|
|
|
2046
2287
|
Defined in:
|
|
2047
|
-
[epub/index.ts:
|
|
2288
|
+
[libraries/epub/index.ts:3113](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3113)
|
|
2048
2289
|
|
|
2049
2290
|
Write new contents for an existing XHTML item, specified by its id.
|
|
2050
2291
|
|
|
@@ -2071,7 +2312,7 @@ https://www.w3.org/TR/epub-33/#sec-xhtml
|
|
|
2071
2312
|
> `static` **addLinkToXhtmlHead**(`xml`, `link`): `void`
|
|
2072
2313
|
|
|
2073
2314
|
Defined in:
|
|
2074
|
-
[epub/index.ts:
|
|
2315
|
+
[libraries/epub/index.ts:424](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L424)
|
|
2075
2316
|
|
|
2076
2317
|
Given an XML structure representing a complete XHTML document, add a `link`
|
|
2077
2318
|
element to the `head` of the document.
|
|
@@ -2097,7 +2338,7 @@ This method modifies the provided XML structure.
|
|
|
2097
2338
|
> `static` **assertEpub3**(`epub`): `Promise`\<`void`\>
|
|
2098
2339
|
|
|
2099
2340
|
Defined in:
|
|
2100
|
-
[epub/index.ts:
|
|
2341
|
+
[libraries/epub/index.ts:699](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L699)
|
|
2101
2342
|
|
|
2102
2343
|
##### Parameters
|
|
2103
2344
|
|
|
@@ -2115,7 +2356,7 @@ Defined in:
|
|
|
2115
2356
|
> `Promise`\<[`Epub`](#epub)\>
|
|
2116
2357
|
|
|
2117
2358
|
Defined in:
|
|
2118
|
-
[epub/index.ts:
|
|
2359
|
+
[libraries/epub/index.ts:647](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L647)
|
|
2119
2360
|
|
|
2120
2361
|
Construct a new EPUB on a writable backend, optionally seeded with the provided
|
|
2121
2362
|
metadata. Equivalent to `Epub.using(TmpFsAdapter).create(...)`.
|
|
@@ -2138,13 +2379,13 @@ metadata. Equivalent to `Epub.using(TmpFsAdapter).create(...)`.
|
|
|
2138
2379
|
> [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2139
2380
|
|
|
2140
2381
|
Defined in:
|
|
2141
|
-
[epub/index.ts:
|
|
2382
|
+
[libraries/epub/index.ts:459](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L459)
|
|
2142
2383
|
|
|
2143
2384
|
##### Type Parameters
|
|
2144
2385
|
|
|
2145
2386
|
| Type Parameter |
|
|
2146
2387
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2147
|
-
| `Name` _extends_ `` `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}` `` \| `` `
|
|
2388
|
+
| `Name` _extends_ `` `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}` `` |
|
|
2148
2389
|
|
|
2149
2390
|
##### Parameters
|
|
2150
2391
|
|
|
@@ -2163,7 +2404,7 @@ Defined in:
|
|
|
2163
2404
|
> `static` **createXmlTextNode**(`text`): [`XmlTextNode`](#xmltextnode)
|
|
2164
2405
|
|
|
2165
2406
|
Defined in:
|
|
2166
|
-
[epub/index.ts:
|
|
2407
|
+
[libraries/epub/index.ts:472](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L472)
|
|
2167
2408
|
|
|
2168
2409
|
##### Parameters
|
|
2169
2410
|
|
|
@@ -2181,7 +2422,7 @@ Defined in:
|
|
|
2181
2422
|
> `undefined` \| [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2182
2423
|
|
|
2183
2424
|
Defined in:
|
|
2184
|
-
[epub/index.ts:
|
|
2425
|
+
[libraries/epub/index.ts:545](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L545)
|
|
2185
2426
|
|
|
2186
2427
|
Given an XML structure, find the first child matching the provided name and
|
|
2187
2428
|
optional filter.
|
|
@@ -2190,7 +2431,7 @@ optional filter.
|
|
|
2190
2431
|
|
|
2191
2432
|
| Type Parameter |
|
|
2192
2433
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2193
|
-
| `Name` _extends_ `` `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}` `` \| `` `
|
|
2434
|
+
| `Name` _extends_ `` `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}` `` |
|
|
2194
2435
|
|
|
2195
2436
|
##### Parameters
|
|
2196
2437
|
|
|
@@ -2210,7 +2451,7 @@ optional filter.
|
|
|
2210
2451
|
> `undefined` \| [`XmlElement`](#xmlelement)\<`Name`\>
|
|
2211
2452
|
|
|
2212
2453
|
Defined in:
|
|
2213
|
-
[epub/index.ts:
|
|
2454
|
+
[libraries/epub/index.ts:563](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L563)
|
|
2214
2455
|
|
|
2215
2456
|
Given an XML structure, find the first descendant matching the provided name and
|
|
2216
2457
|
optional filter.
|
|
@@ -2222,7 +2463,7 @@ element in the tree matching the name and filter.
|
|
|
2222
2463
|
|
|
2223
2464
|
| Type Parameter |
|
|
2224
2465
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2225
|
-
| `Name` _extends_ `` `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}` `` \| `` `
|
|
2466
|
+
| `Name` _extends_ `` `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}` `` |
|
|
2226
2467
|
|
|
2227
2468
|
##### Parameters
|
|
2228
2469
|
|
|
@@ -2241,7 +2482,7 @@ element in the tree matching the name and filter.
|
|
|
2241
2482
|
> `static` **formatSmilDuration**(`duration`): `string`
|
|
2242
2483
|
|
|
2243
2484
|
Defined in:
|
|
2244
|
-
[epub/index.ts:
|
|
2485
|
+
[libraries/epub/index.ts:407](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L407)
|
|
2245
2486
|
|
|
2246
2487
|
Format a duration, provided as a number of seconds, as a SMIL clock value, to be
|
|
2247
2488
|
used for Media Overlays.
|
|
@@ -2267,7 +2508,7 @@ https://www.w3.org/TR/epub-33/#sec-duration
|
|
|
2267
2508
|
> `static` **from**(`pathOrData`): `Promise`\<[`Epub`](#epub)\>
|
|
2268
2509
|
|
|
2269
2510
|
Defined in:
|
|
2270
|
-
[epub/index.ts:
|
|
2511
|
+
[libraries/epub/index.ts:683](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L683)
|
|
2271
2512
|
|
|
2272
2513
|
Open an existing EPUB publication, extracting it to a temp directory so writes
|
|
2273
2514
|
can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
@@ -2297,7 +2538,7 @@ when the archive is not a valid EPUB 3
|
|
|
2297
2538
|
> `Promise`\<[`EpubReader`](#epubreader)\>
|
|
2298
2539
|
|
|
2299
2540
|
Defined in:
|
|
2300
|
-
[epub/index.ts:
|
|
2541
|
+
[libraries/epub/index.ts:684](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L684)
|
|
2301
2542
|
|
|
2302
2543
|
Open an existing EPUB publication, extracting it to a temp directory so writes
|
|
2303
2544
|
can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
@@ -2328,7 +2569,7 @@ when the archive is not a valid EPUB 3
|
|
|
2328
2569
|
> [`EpubReader`](#epubreader)\>
|
|
2329
2570
|
|
|
2330
2571
|
Defined in:
|
|
2331
|
-
[epub/index.ts:
|
|
2572
|
+
[libraries/epub/index.ts:688](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L688)
|
|
2332
2573
|
|
|
2333
2574
|
Open an existing EPUB publication, extracting it to a temp directory so writes
|
|
2334
2575
|
can mutate the unpacked tree and rezip with `saveAndClose`.
|
|
@@ -2358,7 +2599,7 @@ when the archive is not a valid EPUB 3
|
|
|
2358
2599
|
> `static` **getXhtmlBody**(`xml`): [`ParsedXml`](#parsedxml)
|
|
2359
2600
|
|
|
2360
2601
|
Defined in:
|
|
2361
|
-
[epub/index.ts:
|
|
2602
|
+
[libraries/epub/index.ts:449](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L449)
|
|
2362
2603
|
|
|
2363
2604
|
Given an XML structure representing a complete XHTML document, return the
|
|
2364
2605
|
sub-structure representing the children of the document's body element.
|
|
@@ -2378,7 +2619,7 @@ sub-structure representing the children of the document's body element.
|
|
|
2378
2619
|
> `static` **getXhtmlTextContent**(`xml`): `string`
|
|
2379
2620
|
|
|
2380
2621
|
Defined in:
|
|
2381
|
-
[epub/index.ts:
|
|
2622
|
+
[libraries/epub/index.ts:481](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L481)
|
|
2382
2623
|
|
|
2383
2624
|
Given an XML structure representing a complete XHTML document, return a string
|
|
2384
2625
|
representing the concatenation of all text nodes in the document.
|
|
@@ -2398,7 +2639,7 @@ representing the concatenation of all text nodes in the document.
|
|
|
2398
2639
|
> `static` **getXmlAttributes**(`element`): `Record`\<`string`, `string`\>
|
|
2399
2640
|
|
|
2400
2641
|
Defined in:
|
|
2401
|
-
[epub/index.ts:
|
|
2642
|
+
[libraries/epub/index.ts:498](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L498)
|
|
2402
2643
|
|
|
2403
2644
|
Given an XMLElement, return its attributes.
|
|
2404
2645
|
|
|
@@ -2417,7 +2658,7 @@ Given an XMLElement, return its attributes.
|
|
|
2417
2658
|
> `static` **getXmlChildren**\<`Name`\>(`element`): [`ParsedXml`](#parsedxml)
|
|
2418
2659
|
|
|
2419
2660
|
Defined in:
|
|
2420
|
-
[epub/index.ts:
|
|
2661
|
+
[libraries/epub/index.ts:525](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L525)
|
|
2421
2662
|
|
|
2422
2663
|
Given an XMLElement, return a list of its children
|
|
2423
2664
|
|
|
@@ -2425,7 +2666,7 @@ Given an XMLElement, return a list of its children
|
|
|
2425
2666
|
|
|
2426
2667
|
| Type Parameter |
|
|
2427
2668
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2428
|
-
| `Name` _extends_ `` `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}` `` \| `` `
|
|
2669
|
+
| `Name` _extends_ `` `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}` `` |
|
|
2429
2670
|
|
|
2430
2671
|
##### Parameters
|
|
2431
2672
|
|
|
@@ -2442,7 +2683,7 @@ Given an XMLElement, return a list of its children
|
|
|
2442
2683
|
> `static` **getXmlElementName**\<`Name`\>(`element`): `Name`
|
|
2443
2684
|
|
|
2444
2685
|
Defined in:
|
|
2445
|
-
[epub/index.ts:
|
|
2686
|
+
[libraries/epub/index.ts:510](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L510)
|
|
2446
2687
|
|
|
2447
2688
|
Given an XMLElement, return its tag name.
|
|
2448
2689
|
|
|
@@ -2450,7 +2691,7 @@ Given an XMLElement, return its tag name.
|
|
|
2450
2691
|
|
|
2451
2692
|
| Type Parameter |
|
|
2452
2693
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2453
|
-
| `Name` _extends_ `` `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}` `` \| `` `
|
|
2694
|
+
| `Name` _extends_ `` `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}` `` |
|
|
2454
2695
|
|
|
2455
2696
|
##### Parameters
|
|
2456
2697
|
|
|
@@ -2467,7 +2708,7 @@ Given an XMLElement, return its tag name.
|
|
|
2467
2708
|
> `static` **isXmlTextNode**(`node`): `node is XmlTextNode`
|
|
2468
2709
|
|
|
2469
2710
|
Defined in:
|
|
2470
|
-
[epub/index.ts:
|
|
2711
|
+
[libraries/epub/index.ts:585](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L585)
|
|
2471
2712
|
|
|
2472
2713
|
Given an XMLNode, determine whether it represents a text node or an XML element.
|
|
2473
2714
|
|
|
@@ -2486,13 +2727,13 @@ Given an XMLNode, determine whether it represents a text node or an XML element.
|
|
|
2486
2727
|
> `static` **replaceXmlChildren**\<`Name`\>(`element`, `children`): `void`
|
|
2487
2728
|
|
|
2488
2729
|
Defined in:
|
|
2489
|
-
[epub/index.ts:
|
|
2730
|
+
[libraries/epub/index.ts:533](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L533)
|
|
2490
2731
|
|
|
2491
2732
|
##### Type Parameters
|
|
2492
2733
|
|
|
2493
2734
|
| Type Parameter |
|
|
2494
2735
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2495
|
-
| `Name` _extends_ `` `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}` `` \| `` `
|
|
2736
|
+
| `Name` _extends_ `` `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}` `` |
|
|
2496
2737
|
|
|
2497
2738
|
##### Parameters
|
|
2498
2739
|
|
|
@@ -2510,7 +2751,7 @@ Defined in:
|
|
|
2510
2751
|
> `static` **upgrade**(`path`, `options`): `Promise`\<[`Epub`](#epub)\>
|
|
2511
2752
|
|
|
2512
2753
|
Defined in:
|
|
2513
|
-
[epub/index.ts:
|
|
2754
|
+
[libraries/epub/index.ts:3570](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3570)
|
|
2514
2755
|
|
|
2515
2756
|
Upgrade an EPUB 2 publication to EPUB 3 in place, returning a new, valid Epub 3
|
|
2516
2757
|
instance. Equivalent to `Epub.using(TmpFsAdapter).upgrade(...)`.
|
|
@@ -2532,7 +2773,7 @@ instance. Equivalent to `Epub.using(TmpFsAdapter).upgrade(...)`.
|
|
|
2532
2773
|
> [`EpubFactory`](#epubfactory)\<`A`\>
|
|
2533
2774
|
|
|
2534
2775
|
Defined in:
|
|
2535
|
-
[epub/index.ts:
|
|
2776
|
+
[libraries/epub/index.ts:667](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L667)
|
|
2536
2777
|
|
|
2537
2778
|
Specify the storage backend to use for the EPUB
|
|
2538
2779
|
|
|
@@ -2567,7 +2808,7 @@ using reader = await Epub.using(MemoryAdapter).from(buffer, { cache: false })
|
|
|
2567
2808
|
## EpubFactory\<A\>
|
|
2568
2809
|
|
|
2569
2810
|
Defined in:
|
|
2570
|
-
[epub/index.ts:
|
|
2811
|
+
[libraries/epub/index.ts:3599](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3599)
|
|
2571
2812
|
|
|
2572
2813
|
Adapter-bound factory returned by [Epub.using](#using).
|
|
2573
2814
|
|
|
@@ -2590,7 +2831,7 @@ runtime if the adapter is read-only or lacks `initEmpty`.
|
|
|
2590
2831
|
> [`EpubFactory`](#epubfactory)\<`A`\>
|
|
2591
2832
|
|
|
2592
2833
|
Defined in:
|
|
2593
|
-
[epub/index.ts:
|
|
2834
|
+
[libraries/epub/index.ts:3600](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3600)
|
|
2594
2835
|
|
|
2595
2836
|
##### Parameters
|
|
2596
2837
|
|
|
@@ -2609,7 +2850,7 @@ Defined in:
|
|
|
2609
2850
|
> `readonly` **adapterClass**: `A`
|
|
2610
2851
|
|
|
2611
2852
|
Defined in:
|
|
2612
|
-
[epub/index.ts:
|
|
2853
|
+
[libraries/epub/index.ts:3600](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3600)
|
|
2613
2854
|
|
|
2614
2855
|
### Methods
|
|
2615
2856
|
|
|
@@ -2619,7 +2860,7 @@ Defined in:
|
|
|
2619
2860
|
> `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\>\>
|
|
2620
2861
|
|
|
2621
2862
|
Defined in:
|
|
2622
|
-
[epub/index.ts:
|
|
2863
|
+
[libraries/epub/index.ts:3661](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3661)
|
|
2623
2864
|
|
|
2624
2865
|
Construct a new EPUB on this factory's adapter, optionally seeded with the
|
|
2625
2866
|
provided metadata. Requires a writable adapter that implements `initEmpty`
|
|
@@ -2646,20 +2887,23 @@ when the adapter is read-only or does not implement initEmpty
|
|
|
2646
2887
|
##### Call Signature
|
|
2647
2888
|
|
|
2648
2889
|
> **from**(`source`, `options`): `Promise`\<`Pick`\<[`Epub`](#epub), `"storage"`
|
|
2649
|
-
> \| `"
|
|
2650
|
-
>
|
|
2651
|
-
> `"
|
|
2652
|
-
> `"
|
|
2653
|
-
> `"
|
|
2654
|
-
> `"
|
|
2655
|
-
> `"
|
|
2656
|
-
> `"
|
|
2890
|
+
> \| `"getItemArchiveLength"` \| `"getRootfile"` \| `"getPackageElement"` \|
|
|
2891
|
+
> `"getManifest"` \| `"findMetadataItem"` \| `"findAllMetadataItems"` \|
|
|
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"` \|
|
|
2657
2900
|
> `"getLandmarks"` \| `"getPageList"` \| `"resolveHref"` \| `"readFileContents"`
|
|
2658
|
-
> \| `"readItemContents"` \| `"readXhtmlItemContents"` \|
|
|
2659
|
-
> `"
|
|
2901
|
+
> \| `"readItemContents"` \| `"readXhtmlItemContents"` \| `"getVersion"` \|
|
|
2902
|
+
> `"getNcxTableOfContents"` \| `"getGuideEntries"` \| `"discardAndClose"`\> &
|
|
2903
|
+
> `Disposable` & `object`\>
|
|
2660
2904
|
|
|
2661
2905
|
Defined in:
|
|
2662
|
-
[epub/index.ts:
|
|
2906
|
+
[libraries/epub/index.ts:3607](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3607)
|
|
2663
2907
|
|
|
2664
2908
|
Open an existing EPUB through this factory's adapter
|
|
2665
2909
|
|
|
@@ -2672,18 +2916,21 @@ Open an existing EPUB through this factory's adapter
|
|
|
2672
2916
|
|
|
2673
2917
|
###### Returns
|
|
2674
2918
|
|
|
2675
|
-
`Promise`\<`Pick`\<[`Epub`](#epub), `"storage"` \| `"
|
|
2676
|
-
`"
|
|
2677
|
-
`"findMetadataItem"` \| `"findAllMetadataItems"` \| `"
|
|
2678
|
-
`"
|
|
2679
|
-
`"
|
|
2680
|
-
`"
|
|
2681
|
-
`"
|
|
2682
|
-
\| `"
|
|
2683
|
-
`"
|
|
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"` \|
|
|
2684
2930
|
`"getPageList"` \| `"resolveHref"` \| `"readFileContents"` \|
|
|
2685
|
-
`"readItemContents"` \| `"readXhtmlItemContents"` \| `"
|
|
2686
|
-
`"
|
|
2931
|
+
`"readItemContents"` \| `"readXhtmlItemContents"` \| `"getVersion"` \|
|
|
2932
|
+
`"getNcxTableOfContents"` \| `"getGuideEntries"` \| `"discardAndClose"`\> &
|
|
2933
|
+
`Disposable` & `object`\>
|
|
2687
2934
|
|
|
2688
2935
|
###### Throws
|
|
2689
2936
|
|
|
@@ -2695,7 +2942,7 @@ when the archive is not a valid EPUB 3
|
|
|
2695
2942
|
> `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\> & `object`\>
|
|
2696
2943
|
|
|
2697
2944
|
Defined in:
|
|
2698
|
-
[epub/index.ts:
|
|
2945
|
+
[libraries/epub/index.ts:3611](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3611)
|
|
2699
2946
|
|
|
2700
2947
|
Open an existing EPUB through this factory's adapter
|
|
2701
2948
|
|
|
@@ -2720,7 +2967,7 @@ when the archive is not a valid EPUB 3
|
|
|
2720
2967
|
> `Promise`\<[`EpubInstanceFor`](#epubinstancefor)\<`A`\>\>
|
|
2721
2968
|
|
|
2722
2969
|
Defined in:
|
|
2723
|
-
[epub/index.ts:
|
|
2970
|
+
[libraries/epub/index.ts:3768](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L3768)
|
|
2724
2971
|
|
|
2725
2972
|
Upgrade an EPUB 2 publication to EPUB 3 in place using this factory's adapter,
|
|
2726
2973
|
returning a new, valid Epub 3 instance.
|
|
@@ -2761,7 +3008,7 @@ when the adapter is read-only
|
|
|
2761
3008
|
## EpubReadOnlyError
|
|
2762
3009
|
|
|
2763
3010
|
Defined in:
|
|
2764
|
-
[epub/index.ts:
|
|
3011
|
+
[libraries/epub/index.ts:233](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L233)
|
|
2765
3012
|
|
|
2766
3013
|
### Extends
|
|
2767
3014
|
|
|
@@ -2993,7 +3240,7 @@ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
|
2993
3240
|
## EpubVersionError
|
|
2994
3241
|
|
|
2995
3242
|
Defined in:
|
|
2996
|
-
[epub/index.ts:
|
|
3243
|
+
[libraries/epub/index.ts:232](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L232)
|
|
2997
3244
|
|
|
2998
3245
|
### Extends
|
|
2999
3246
|
|
|
@@ -3224,7 +3471,7 @@ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
|
3224
3471
|
## MemoryAdapter
|
|
3225
3472
|
|
|
3226
3473
|
Defined in:
|
|
3227
|
-
[epub/adapters/memory.ts:
|
|
3474
|
+
[libraries/epub/adapters/memory.ts:27](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L27)
|
|
3228
3475
|
|
|
3229
3476
|
Loads an EPUB archive into memory and serves all I/O off the in-memory zip
|
|
3230
3477
|
handle.
|
|
@@ -3237,27 +3484,12 @@ read only
|
|
|
3237
3484
|
|
|
3238
3485
|
### Properties
|
|
3239
3486
|
|
|
3240
|
-
#### rootPath
|
|
3241
|
-
|
|
3242
|
-
> `readonly` **rootPath**: `string`
|
|
3243
|
-
|
|
3244
|
-
Defined in:
|
|
3245
|
-
[epub/adapters/memory.ts:71](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/memory.ts#L71)
|
|
3246
|
-
|
|
3247
|
-
Opaque path prefix used by `resolveInternalHref` to anchor absolute paths within
|
|
3248
|
-
the archive. For TmpFsAdapter this is the tmp dir; for MemoryAdapter it's a
|
|
3249
|
-
virtual prefix that's never written to disk
|
|
3250
|
-
|
|
3251
|
-
##### Implementation of
|
|
3252
|
-
|
|
3253
|
-
[`EpubStorageAdapter`](#epubstorageadapter).[`rootPath`](#rootpath-2)
|
|
3254
|
-
|
|
3255
3487
|
#### capabilities
|
|
3256
3488
|
|
|
3257
3489
|
> `readonly` `static` **capabilities**: `object`
|
|
3258
3490
|
|
|
3259
3491
|
Defined in:
|
|
3260
|
-
[epub/adapters/memory.ts:
|
|
3492
|
+
[libraries/epub/adapters/memory.ts:29](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L29)
|
|
3261
3493
|
|
|
3262
3494
|
##### writable
|
|
3263
3495
|
|
|
@@ -3268,16 +3500,16 @@ Defined in:
|
|
|
3268
3500
|
> `readonly` `static` **kind**: `"in-memory"`
|
|
3269
3501
|
|
|
3270
3502
|
Defined in:
|
|
3271
|
-
[epub/adapters/memory.ts:
|
|
3503
|
+
[libraries/epub/adapters/memory.ts:28](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L28)
|
|
3272
3504
|
|
|
3273
3505
|
### Methods
|
|
3274
3506
|
|
|
3275
3507
|
#### archiveLength()
|
|
3276
3508
|
|
|
3277
|
-
> **archiveLength**(`
|
|
3509
|
+
> **archiveLength**(`entry`): `Promise`\<`number`\>
|
|
3278
3510
|
|
|
3279
3511
|
Defined in:
|
|
3280
|
-
[epub/adapters/memory.ts:
|
|
3512
|
+
[libraries/epub/adapters/memory.ts:94](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L94)
|
|
3281
3513
|
|
|
3282
3514
|
Length of an entry in bytes, for the readium page-count heuristic which expects
|
|
3283
3515
|
compressed size when available
|
|
@@ -3286,7 +3518,7 @@ compressed size when available
|
|
|
3286
3518
|
|
|
3287
3519
|
| Parameter | Type |
|
|
3288
3520
|
| --------- | -------- |
|
|
3289
|
-
| `
|
|
3521
|
+
| `entry` | `string` |
|
|
3290
3522
|
|
|
3291
3523
|
##### Returns
|
|
3292
3524
|
|
|
@@ -3301,7 +3533,7 @@ compressed size when available
|
|
|
3301
3533
|
> **dispose**(): `void`
|
|
3302
3534
|
|
|
3303
3535
|
Defined in:
|
|
3304
|
-
[epub/adapters/memory.ts:
|
|
3536
|
+
[libraries/epub/adapters/memory.ts:100](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L100)
|
|
3305
3537
|
|
|
3306
3538
|
Always called on close or error
|
|
3307
3539
|
|
|
@@ -3313,20 +3545,44 @@ Always called on close or error
|
|
|
3313
3545
|
|
|
3314
3546
|
[`EpubStorageAdapter`](#epubstorageadapter).[`dispose`](#dispose-6)
|
|
3315
3547
|
|
|
3548
|
+
#### exists()
|
|
3549
|
+
|
|
3550
|
+
> **exists**(`entry`): `Promise`\<`boolean`\>
|
|
3551
|
+
|
|
3552
|
+
Defined in:
|
|
3553
|
+
[libraries/epub/adapters/memory.ts:89](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L89)
|
|
3554
|
+
|
|
3555
|
+
Whether the archive holds an entry under exactly this name. Used to choose
|
|
3556
|
+
between different canditates for an href so should be exact
|
|
3557
|
+
|
|
3558
|
+
##### Parameters
|
|
3559
|
+
|
|
3560
|
+
| Parameter | Type |
|
|
3561
|
+
| --------- | -------- |
|
|
3562
|
+
| `entry` | `string` |
|
|
3563
|
+
|
|
3564
|
+
##### Returns
|
|
3565
|
+
|
|
3566
|
+
`Promise`\<`boolean`\>
|
|
3567
|
+
|
|
3568
|
+
##### Implementation of
|
|
3569
|
+
|
|
3570
|
+
[`EpubStorageAdapter`](#epubstorageadapter).[`exists`](#exists-4)
|
|
3571
|
+
|
|
3316
3572
|
#### read()
|
|
3317
3573
|
|
|
3318
3574
|
##### Call Signature
|
|
3319
3575
|
|
|
3320
|
-
> **read**(`
|
|
3576
|
+
> **read**(`entry`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
3321
3577
|
|
|
3322
3578
|
Defined in:
|
|
3323
|
-
[epub/adapters/memory.ts:
|
|
3579
|
+
[libraries/epub/adapters/memory.ts:61](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L61)
|
|
3324
3580
|
|
|
3325
3581
|
###### Parameters
|
|
3326
3582
|
|
|
3327
3583
|
| Parameter | Type |
|
|
3328
3584
|
| --------- | -------- |
|
|
3329
|
-
| `
|
|
3585
|
+
| `entry` | `string` |
|
|
3330
3586
|
|
|
3331
3587
|
###### Returns
|
|
3332
3588
|
|
|
@@ -3338,16 +3594,16 @@ Defined in:
|
|
|
3338
3594
|
|
|
3339
3595
|
##### Call Signature
|
|
3340
3596
|
|
|
3341
|
-
> **read**(`
|
|
3597
|
+
> **read**(`entry`, `encoding`): `Promise`\<`string`\>
|
|
3342
3598
|
|
|
3343
3599
|
Defined in:
|
|
3344
|
-
[epub/adapters/memory.ts:
|
|
3600
|
+
[libraries/epub/adapters/memory.ts:62](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L62)
|
|
3345
3601
|
|
|
3346
3602
|
###### Parameters
|
|
3347
3603
|
|
|
3348
3604
|
| Parameter | Type |
|
|
3349
3605
|
| ---------- | --------- |
|
|
3350
|
-
| `
|
|
3606
|
+
| `entry` | `string` |
|
|
3351
3607
|
| `encoding` | `"utf-8"` |
|
|
3352
3608
|
|
|
3353
3609
|
###### Returns
|
|
@@ -3364,7 +3620,7 @@ Defined in:
|
|
|
3364
3620
|
> `Promise`\<[`MemoryAdapter`](#memoryadapter)\>
|
|
3365
3621
|
|
|
3366
3622
|
Defined in:
|
|
3367
|
-
[epub/adapters/memory.ts:
|
|
3623
|
+
[libraries/epub/adapters/memory.ts:31](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/memory.ts#L31)
|
|
3368
3624
|
|
|
3369
3625
|
##### Parameters
|
|
3370
3626
|
|
|
@@ -3382,7 +3638,7 @@ Defined in:
|
|
|
3382
3638
|
## TmpFsAdapter
|
|
3383
3639
|
|
|
3384
3640
|
Defined in:
|
|
3385
|
-
[epub/adapters/tmpfs.ts:
|
|
3641
|
+
[libraries/epub/adapters/tmpfs.ts:53](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L53)
|
|
3386
3642
|
|
|
3387
3643
|
Extracts an EPUB archive to a temp directory and serves all I/O off the real
|
|
3388
3644
|
filesystem. `Epub.using(TmpFsAdapter).from(...)` returns a writable
|
|
@@ -3394,27 +3650,12 @@ filesystem. `Epub.using(TmpFsAdapter).from(...)` returns a writable
|
|
|
3394
3650
|
|
|
3395
3651
|
### Properties
|
|
3396
3652
|
|
|
3397
|
-
#### rootPath
|
|
3398
|
-
|
|
3399
|
-
> `readonly` **rootPath**: `string`
|
|
3400
|
-
|
|
3401
|
-
Defined in:
|
|
3402
|
-
[epub/adapters/tmpfs.ts:102](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/tmpfs.ts#L102)
|
|
3403
|
-
|
|
3404
|
-
Opaque path prefix used by `resolveInternalHref` to anchor absolute paths within
|
|
3405
|
-
the archive. For TmpFsAdapter this is the tmp dir; for MemoryAdapter it's a
|
|
3406
|
-
virtual prefix that's never written to disk
|
|
3407
|
-
|
|
3408
|
-
##### Implementation of
|
|
3409
|
-
|
|
3410
|
-
[`EpubStorageAdapter`](#epubstorageadapter).[`rootPath`](#rootpath-2)
|
|
3411
|
-
|
|
3412
3653
|
#### capabilities
|
|
3413
3654
|
|
|
3414
3655
|
> `readonly` `static` **capabilities**: `object`
|
|
3415
3656
|
|
|
3416
3657
|
Defined in:
|
|
3417
|
-
[epub/adapters/tmpfs.ts:
|
|
3658
|
+
[libraries/epub/adapters/tmpfs.ts:55](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L55)
|
|
3418
3659
|
|
|
3419
3660
|
##### writable
|
|
3420
3661
|
|
|
@@ -3425,16 +3666,16 @@ Defined in:
|
|
|
3425
3666
|
> `readonly` `static` **kind**: `"extracted-dir"`
|
|
3426
3667
|
|
|
3427
3668
|
Defined in:
|
|
3428
|
-
[epub/adapters/tmpfs.ts:
|
|
3669
|
+
[libraries/epub/adapters/tmpfs.ts:54](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L54)
|
|
3429
3670
|
|
|
3430
3671
|
### Methods
|
|
3431
3672
|
|
|
3432
3673
|
#### archiveLength()
|
|
3433
3674
|
|
|
3434
|
-
> **archiveLength**(`
|
|
3675
|
+
> **archiveLength**(`entry`): `Promise`\<`number`\>
|
|
3435
3676
|
|
|
3436
3677
|
Defined in:
|
|
3437
|
-
[epub/adapters/tmpfs.ts:
|
|
3678
|
+
[libraries/epub/adapters/tmpfs.ts:136](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L136)
|
|
3438
3679
|
|
|
3439
3680
|
Length of an entry in bytes, for the readium page-count heuristic which expects
|
|
3440
3681
|
compressed size when available
|
|
@@ -3443,7 +3684,7 @@ compressed size when available
|
|
|
3443
3684
|
|
|
3444
3685
|
| Parameter | Type |
|
|
3445
3686
|
| --------- | -------- |
|
|
3446
|
-
| `
|
|
3687
|
+
| `entry` | `string` |
|
|
3447
3688
|
|
|
3448
3689
|
##### Returns
|
|
3449
3690
|
|
|
@@ -3458,7 +3699,7 @@ compressed size when available
|
|
|
3458
3699
|
> **dispose**(): `void`
|
|
3459
3700
|
|
|
3460
3701
|
Defined in:
|
|
3461
|
-
[epub/adapters/tmpfs.ts:
|
|
3702
|
+
[libraries/epub/adapters/tmpfs.ts:213](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L213)
|
|
3462
3703
|
|
|
3463
3704
|
Always called on close or error
|
|
3464
3705
|
|
|
@@ -3475,7 +3716,7 @@ Always called on close or error
|
|
|
3475
3716
|
> **duplicate**(): `Promise`\<[`TmpFsAdapter`](#tmpfsadapter)\>
|
|
3476
3717
|
|
|
3477
3718
|
Defined in:
|
|
3478
|
-
[epub/adapters/tmpfs.ts:
|
|
3719
|
+
[libraries/epub/adapters/tmpfs.ts:163](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L163)
|
|
3479
3720
|
|
|
3480
3721
|
Required for Epub.copy
|
|
3481
3722
|
|
|
@@ -3487,12 +3728,36 @@ Required for Epub.copy
|
|
|
3487
3728
|
|
|
3488
3729
|
[`EpubStorageAdapter`](#epubstorageadapter).[`duplicate`](#duplicate-2)
|
|
3489
3730
|
|
|
3731
|
+
#### exists()
|
|
3732
|
+
|
|
3733
|
+
> **exists**(`entry`): `Promise`\<`boolean`\>
|
|
3734
|
+
|
|
3735
|
+
Defined in:
|
|
3736
|
+
[libraries/epub/adapters/tmpfs.ts:127](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L127)
|
|
3737
|
+
|
|
3738
|
+
Whether the archive holds an entry under exactly this name. Used to choose
|
|
3739
|
+
between different canditates for an href so should be exact
|
|
3740
|
+
|
|
3741
|
+
##### Parameters
|
|
3742
|
+
|
|
3743
|
+
| Parameter | Type |
|
|
3744
|
+
| --------- | -------- |
|
|
3745
|
+
| `entry` | `string` |
|
|
3746
|
+
|
|
3747
|
+
##### Returns
|
|
3748
|
+
|
|
3749
|
+
`Promise`\<`boolean`\>
|
|
3750
|
+
|
|
3751
|
+
##### Implementation of
|
|
3752
|
+
|
|
3753
|
+
[`EpubStorageAdapter`](#epubstorageadapter).[`exists`](#exists-4)
|
|
3754
|
+
|
|
3490
3755
|
#### list()
|
|
3491
3756
|
|
|
3492
3757
|
> **list**(): `AsyncIterable`\<[`EpubListEntry`](#epublistentry)\>
|
|
3493
3758
|
|
|
3494
3759
|
Defined in:
|
|
3495
|
-
[epub/adapters/tmpfs.ts:
|
|
3760
|
+
[libraries/epub/adapters/tmpfs.ts:145](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L145)
|
|
3496
3761
|
|
|
3497
3762
|
Required for Epub.saveAndClose to walk the contents
|
|
3498
3763
|
|
|
@@ -3508,16 +3773,16 @@ Required for Epub.saveAndClose to walk the contents
|
|
|
3508
3773
|
|
|
3509
3774
|
##### Call Signature
|
|
3510
3775
|
|
|
3511
|
-
> **read**(`
|
|
3776
|
+
> **read**(`entry`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
3512
3777
|
|
|
3513
3778
|
Defined in:
|
|
3514
|
-
[epub/adapters/tmpfs.ts:
|
|
3779
|
+
[libraries/epub/adapters/tmpfs.ts:105](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L105)
|
|
3515
3780
|
|
|
3516
3781
|
###### Parameters
|
|
3517
3782
|
|
|
3518
3783
|
| Parameter | Type |
|
|
3519
3784
|
| --------- | -------- |
|
|
3520
|
-
| `
|
|
3785
|
+
| `entry` | `string` |
|
|
3521
3786
|
|
|
3522
3787
|
###### Returns
|
|
3523
3788
|
|
|
@@ -3529,16 +3794,16 @@ Defined in:
|
|
|
3529
3794
|
|
|
3530
3795
|
##### Call Signature
|
|
3531
3796
|
|
|
3532
|
-
> **read**(`
|
|
3797
|
+
> **read**(`entry`, `encoding`): `Promise`\<`string`\>
|
|
3533
3798
|
|
|
3534
3799
|
Defined in:
|
|
3535
|
-
[epub/adapters/tmpfs.ts:
|
|
3800
|
+
[libraries/epub/adapters/tmpfs.ts:106](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L106)
|
|
3536
3801
|
|
|
3537
3802
|
###### Parameters
|
|
3538
3803
|
|
|
3539
3804
|
| Parameter | Type |
|
|
3540
3805
|
| ---------- | --------- |
|
|
3541
|
-
| `
|
|
3806
|
+
| `entry` | `string` |
|
|
3542
3807
|
| `encoding` | `"utf-8"` |
|
|
3543
3808
|
|
|
3544
3809
|
###### Returns
|
|
@@ -3551,10 +3816,10 @@ Defined in:
|
|
|
3551
3816
|
|
|
3552
3817
|
#### remove()
|
|
3553
3818
|
|
|
3554
|
-
> **remove**(`
|
|
3819
|
+
> **remove**(`entry`): `Promise`\<`void`\>
|
|
3555
3820
|
|
|
3556
3821
|
Defined in:
|
|
3557
|
-
[epub/adapters/tmpfs.ts:
|
|
3822
|
+
[libraries/epub/adapters/tmpfs.ts:123](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L123)
|
|
3558
3823
|
|
|
3559
3824
|
Required for removeManifestItem / setCoverImage replacement
|
|
3560
3825
|
|
|
@@ -3562,7 +3827,7 @@ Required for removeManifestItem / setCoverImage replacement
|
|
|
3562
3827
|
|
|
3563
3828
|
| Parameter | Type |
|
|
3564
3829
|
| --------- | -------- |
|
|
3565
|
-
| `
|
|
3830
|
+
| `entry` | `string` |
|
|
3566
3831
|
|
|
3567
3832
|
##### Returns
|
|
3568
3833
|
|
|
@@ -3577,7 +3842,7 @@ Required for removeManifestItem / setCoverImage replacement
|
|
|
3577
3842
|
> **serialize**(`targetPath`): `Promise`\<`void`\>
|
|
3578
3843
|
|
|
3579
3844
|
Defined in:
|
|
3580
|
-
[epub/adapters/tmpfs.ts:
|
|
3845
|
+
[libraries/epub/adapters/tmpfs.ts:174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L174)
|
|
3581
3846
|
|
|
3582
3847
|
Required for Epub.saveAndClose
|
|
3583
3848
|
|
|
@@ -3599,10 +3864,10 @@ Required for Epub.saveAndClose
|
|
|
3599
3864
|
|
|
3600
3865
|
##### Call Signature
|
|
3601
3866
|
|
|
3602
|
-
> **write**(`
|
|
3867
|
+
> **write**(`entry`, `data`): `Promise`\<`void`\>
|
|
3603
3868
|
|
|
3604
3869
|
Defined in:
|
|
3605
|
-
[epub/adapters/tmpfs.ts:
|
|
3870
|
+
[libraries/epub/adapters/tmpfs.ts:111](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L111)
|
|
3606
3871
|
|
|
3607
3872
|
Required for any mutation method on Epub
|
|
3608
3873
|
|
|
@@ -3610,7 +3875,7 @@ Required for any mutation method on Epub
|
|
|
3610
3875
|
|
|
3611
3876
|
| Parameter | Type |
|
|
3612
3877
|
| --------- | ------------ |
|
|
3613
|
-
| `
|
|
3878
|
+
| `entry` | `string` |
|
|
3614
3879
|
| `data` | `Uint8Array` |
|
|
3615
3880
|
|
|
3616
3881
|
###### Returns
|
|
@@ -3623,16 +3888,16 @@ Required for any mutation method on Epub
|
|
|
3623
3888
|
|
|
3624
3889
|
##### Call Signature
|
|
3625
3890
|
|
|
3626
|
-
> **write**(`
|
|
3891
|
+
> **write**(`entry`, `data`, `encoding`): `Promise`\<`void`\>
|
|
3627
3892
|
|
|
3628
3893
|
Defined in:
|
|
3629
|
-
[epub/adapters/tmpfs.ts:
|
|
3894
|
+
[libraries/epub/adapters/tmpfs.ts:112](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L112)
|
|
3630
3895
|
|
|
3631
3896
|
###### Parameters
|
|
3632
3897
|
|
|
3633
3898
|
| Parameter | Type |
|
|
3634
3899
|
| ---------- | --------- |
|
|
3635
|
-
| `
|
|
3900
|
+
| `entry` | `string` |
|
|
3636
3901
|
| `data` | `string` |
|
|
3637
3902
|
| `encoding` | `"utf-8"` |
|
|
3638
3903
|
|
|
@@ -3649,7 +3914,7 @@ Defined in:
|
|
|
3649
3914
|
> `static` **init**(`source`): `Promise`\<[`TmpFsAdapter`](#tmpfsadapter)\>
|
|
3650
3915
|
|
|
3651
3916
|
Defined in:
|
|
3652
|
-
[epub/adapters/tmpfs.ts:
|
|
3917
|
+
[libraries/epub/adapters/tmpfs.ts:57](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L57)
|
|
3653
3918
|
|
|
3654
3919
|
##### Parameters
|
|
3655
3920
|
|
|
@@ -3666,7 +3931,7 @@ Defined in:
|
|
|
3666
3931
|
> `static` **initEmpty**(): `Promise`\<[`TmpFsAdapter`](#tmpfsadapter)\>
|
|
3667
3932
|
|
|
3668
3933
|
Defined in:
|
|
3669
|
-
[epub/adapters/tmpfs.ts:
|
|
3934
|
+
[libraries/epub/adapters/tmpfs.ts:88](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/adapters/tmpfs.ts#L88)
|
|
3670
3935
|
|
|
3671
3936
|
##### Returns
|
|
3672
3937
|
|
|
@@ -3677,7 +3942,7 @@ Defined in:
|
|
|
3677
3942
|
## AlternateScript
|
|
3678
3943
|
|
|
3679
3944
|
Defined in:
|
|
3680
|
-
[epub/index.ts:
|
|
3945
|
+
[libraries/epub/index.ts:149](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L149)
|
|
3681
3946
|
|
|
3682
3947
|
### Properties
|
|
3683
3948
|
|
|
@@ -3686,21 +3951,21 @@ Defined in:
|
|
|
3686
3951
|
> **locale**: `Locale`
|
|
3687
3952
|
|
|
3688
3953
|
Defined in:
|
|
3689
|
-
[epub/index.ts:
|
|
3954
|
+
[libraries/epub/index.ts:151](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L151)
|
|
3690
3955
|
|
|
3691
3956
|
#### name
|
|
3692
3957
|
|
|
3693
3958
|
> **name**: `string`
|
|
3694
3959
|
|
|
3695
3960
|
Defined in:
|
|
3696
|
-
[epub/index.ts:
|
|
3961
|
+
[libraries/epub/index.ts:150](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L150)
|
|
3697
3962
|
|
|
3698
3963
|
---
|
|
3699
3964
|
|
|
3700
3965
|
## Collection
|
|
3701
3966
|
|
|
3702
3967
|
Defined in:
|
|
3703
|
-
[epub/index.ts:
|
|
3968
|
+
[libraries/epub/index.ts:173](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L173)
|
|
3704
3969
|
|
|
3705
3970
|
### Properties
|
|
3706
3971
|
|
|
@@ -3709,28 +3974,28 @@ Defined in:
|
|
|
3709
3974
|
> **name**: `string`
|
|
3710
3975
|
|
|
3711
3976
|
Defined in:
|
|
3712
|
-
[epub/index.ts:
|
|
3977
|
+
[libraries/epub/index.ts:174](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L174)
|
|
3713
3978
|
|
|
3714
3979
|
#### position?
|
|
3715
3980
|
|
|
3716
3981
|
> `optional` **position**: `string`
|
|
3717
3982
|
|
|
3718
3983
|
Defined in:
|
|
3719
|
-
[epub/index.ts:
|
|
3984
|
+
[libraries/epub/index.ts:176](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L176)
|
|
3720
3985
|
|
|
3721
3986
|
#### type?
|
|
3722
3987
|
|
|
3723
3988
|
> `optional` **type**: `string`
|
|
3724
3989
|
|
|
3725
3990
|
Defined in:
|
|
3726
|
-
[epub/index.ts:
|
|
3991
|
+
[libraries/epub/index.ts:175](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L175)
|
|
3727
3992
|
|
|
3728
3993
|
---
|
|
3729
3994
|
|
|
3730
3995
|
## DcCreator
|
|
3731
3996
|
|
|
3732
3997
|
Defined in:
|
|
3733
|
-
[epub/index.ts:
|
|
3998
|
+
[libraries/epub/index.ts:154](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L154)
|
|
3734
3999
|
|
|
3735
4000
|
### Properties
|
|
3736
4001
|
|
|
@@ -3739,42 +4004,42 @@ Defined in:
|
|
|
3739
4004
|
> `optional` **alternateScripts**: [`AlternateScript`](#alternatescript)[]
|
|
3740
4005
|
|
|
3741
4006
|
Defined in:
|
|
3742
|
-
[epub/index.ts:
|
|
4007
|
+
[libraries/epub/index.ts:159](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L159)
|
|
3743
4008
|
|
|
3744
4009
|
#### fileAs?
|
|
3745
4010
|
|
|
3746
4011
|
> `optional` **fileAs**: `string`
|
|
3747
4012
|
|
|
3748
4013
|
Defined in:
|
|
3749
|
-
[epub/index.ts:
|
|
4014
|
+
[libraries/epub/index.ts:158](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L158)
|
|
3750
4015
|
|
|
3751
4016
|
#### name
|
|
3752
4017
|
|
|
3753
4018
|
> **name**: `string`
|
|
3754
4019
|
|
|
3755
4020
|
Defined in:
|
|
3756
|
-
[epub/index.ts:
|
|
4021
|
+
[libraries/epub/index.ts:155](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L155)
|
|
3757
4022
|
|
|
3758
4023
|
#### role?
|
|
3759
4024
|
|
|
3760
4025
|
> `optional` **role**: `string`
|
|
3761
4026
|
|
|
3762
4027
|
Defined in:
|
|
3763
|
-
[epub/index.ts:
|
|
4028
|
+
[libraries/epub/index.ts:156](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L156)
|
|
3764
4029
|
|
|
3765
4030
|
#### roleScheme?
|
|
3766
4031
|
|
|
3767
4032
|
> `optional` **roleScheme**: `string`
|
|
3768
4033
|
|
|
3769
4034
|
Defined in:
|
|
3770
|
-
[epub/index.ts:
|
|
4035
|
+
[libraries/epub/index.ts:157](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L157)
|
|
3771
4036
|
|
|
3772
4037
|
---
|
|
3773
4038
|
|
|
3774
4039
|
## DcSubject
|
|
3775
4040
|
|
|
3776
4041
|
Defined in:
|
|
3777
|
-
[epub/index.ts:
|
|
4042
|
+
[libraries/epub/index.ts:116](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L116)
|
|
3778
4043
|
|
|
3779
4044
|
### Properties
|
|
3780
4045
|
|
|
@@ -3783,28 +4048,28 @@ Defined in:
|
|
|
3783
4048
|
> **authority**: `string`
|
|
3784
4049
|
|
|
3785
4050
|
Defined in:
|
|
3786
|
-
[epub/index.ts:
|
|
4051
|
+
[libraries/epub/index.ts:118](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L118)
|
|
3787
4052
|
|
|
3788
4053
|
#### term
|
|
3789
4054
|
|
|
3790
4055
|
> **term**: `string`
|
|
3791
4056
|
|
|
3792
4057
|
Defined in:
|
|
3793
|
-
[epub/index.ts:
|
|
4058
|
+
[libraries/epub/index.ts:119](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L119)
|
|
3794
4059
|
|
|
3795
4060
|
#### value
|
|
3796
4061
|
|
|
3797
4062
|
> **value**: `string`
|
|
3798
4063
|
|
|
3799
4064
|
Defined in:
|
|
3800
|
-
[epub/index.ts:
|
|
4065
|
+
[libraries/epub/index.ts:117](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L117)
|
|
3801
4066
|
|
|
3802
4067
|
---
|
|
3803
4068
|
|
|
3804
4069
|
## DublinCore
|
|
3805
4070
|
|
|
3806
4071
|
Defined in:
|
|
3807
|
-
[epub/index.ts:
|
|
4072
|
+
[libraries/epub/index.ts:162](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L162)
|
|
3808
4073
|
|
|
3809
4074
|
### Properties
|
|
3810
4075
|
|
|
@@ -3813,836 +4078,25 @@ Defined in:
|
|
|
3813
4078
|
> `optional` **contributors**: [`DcCreator`](#dccreator)[]
|
|
3814
4079
|
|
|
3815
4080
|
Defined in:
|
|
3816
|
-
[epub/index.ts:
|
|
4081
|
+
[libraries/epub/index.ts:169](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L169)
|
|
3817
4082
|
|
|
3818
4083
|
#### creators?
|
|
3819
4084
|
|
|
3820
4085
|
> `optional` **creators**: [`DcCreator`](#dccreator)[]
|
|
3821
4086
|
|
|
3822
4087
|
Defined in:
|
|
3823
|
-
[epub/index.ts:
|
|
4088
|
+
[libraries/epub/index.ts:168](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L168)
|
|
3824
4089
|
|
|
3825
4090
|
#### date?
|
|
3826
4091
|
|
|
3827
4092
|
> `optional` **date**: `Date`
|
|
3828
4093
|
|
|
3829
4094
|
Defined in:
|
|
3830
|
-
[epub/index.ts:
|
|
4095
|
+
[libraries/epub/index.ts:166](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/libraries/epub/index.ts#L166)
|
|
3831
4096
|
|
|
3832
4097
|
#### identifier
|
|
3833
4098
|
|
|
3834
4099
|
> **identifier**: `string`
|
|
3835
4100
|
|
|
3836
4101
|
Defined in:
|
|
3837
|
-
[epub/index.ts:
|
|
3838
|
-
|
|
3839
|
-
#### language
|
|
3840
|
-
|
|
3841
|
-
> **language**: `Locale`
|
|
3842
|
-
|
|
3843
|
-
Defined in:
|
|
3844
|
-
[epub/index.ts:142](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L142)
|
|
3845
|
-
|
|
3846
|
-
#### subjects?
|
|
3847
|
-
|
|
3848
|
-
> `optional` **subjects**: (`string` \| [`DcSubject`](#dcsubject))[]
|
|
3849
|
-
|
|
3850
|
-
Defined in:
|
|
3851
|
-
[epub/index.ts:145](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L145)
|
|
3852
|
-
|
|
3853
|
-
#### title
|
|
3854
|
-
|
|
3855
|
-
> **title**: `string`
|
|
3856
|
-
|
|
3857
|
-
Defined in:
|
|
3858
|
-
[epub/index.ts:141](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L141)
|
|
3859
|
-
|
|
3860
|
-
#### type?
|
|
3861
|
-
|
|
3862
|
-
> `optional` **type**: `string`
|
|
3863
|
-
|
|
3864
|
-
Defined in:
|
|
3865
|
-
[epub/index.ts:148](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L148)
|
|
3866
|
-
|
|
3867
|
-
---
|
|
3868
|
-
|
|
3869
|
-
## Epub2UpgradeOptions
|
|
3870
|
-
|
|
3871
|
-
Defined in:
|
|
3872
|
-
[epub/upgrade.ts:93](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/upgrade.ts#L93)
|
|
3873
|
-
|
|
3874
|
-
### Properties
|
|
3875
|
-
|
|
3876
|
-
#### outputPath?
|
|
3877
|
-
|
|
3878
|
-
> `optional` **outputPath**: `string`
|
|
3879
|
-
|
|
3880
|
-
Defined in:
|
|
3881
|
-
[epub/upgrade.ts:97](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/upgrade.ts#L97)
|
|
3882
|
-
|
|
3883
|
-
The path to the output file. If provided, the input file will be copied to the
|
|
3884
|
-
output path.
|
|
3885
|
-
|
|
3886
|
-
#### removeNcx?
|
|
3887
|
-
|
|
3888
|
-
> `optional` **removeNcx**: `boolean`
|
|
3889
|
-
|
|
3890
|
-
Defined in:
|
|
3891
|
-
[epub/upgrade.ts:101](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/upgrade.ts#L101)
|
|
3892
|
-
|
|
3893
|
-
Whether to remove the NCX file, as it's technically optional in EPUB 3.
|
|
3894
|
-
|
|
3895
|
-
---
|
|
3896
|
-
|
|
3897
|
-
## EpubListEntry
|
|
3898
|
-
|
|
3899
|
-
Defined in:
|
|
3900
|
-
[epub/adapters/interface.ts:17](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L17)
|
|
3901
|
-
|
|
3902
|
-
### Properties
|
|
3903
|
-
|
|
3904
|
-
#### absolutePath
|
|
3905
|
-
|
|
3906
|
-
> **absolutePath**: `string`
|
|
3907
|
-
|
|
3908
|
-
Defined in:
|
|
3909
|
-
[epub/adapters/interface.ts:19](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L19)
|
|
3910
|
-
|
|
3911
|
-
absolute path under [EpubStorageAdapter.rootPath](#rootpath-2)
|
|
3912
|
-
|
|
3913
|
-
#### relativePath
|
|
3914
|
-
|
|
3915
|
-
> **relativePath**: `string`
|
|
3916
|
-
|
|
3917
|
-
Defined in:
|
|
3918
|
-
[epub/adapters/interface.ts:21](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L21)
|
|
3919
|
-
|
|
3920
|
-
path relative to [EpubStorageAdapter.rootPath](#rootpath-2), slash-separated
|
|
3921
|
-
|
|
3922
|
-
---
|
|
3923
|
-
|
|
3924
|
-
## EpubStorageAdapter
|
|
3925
|
-
|
|
3926
|
-
Defined in:
|
|
3927
|
-
[epub/adapters/interface.ts:24](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L24)
|
|
3928
|
-
|
|
3929
|
-
### Properties
|
|
3930
|
-
|
|
3931
|
-
#### rootPath
|
|
3932
|
-
|
|
3933
|
-
> `readonly` **rootPath**: `string`
|
|
3934
|
-
|
|
3935
|
-
Defined in:
|
|
3936
|
-
[epub/adapters/interface.ts:30](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L30)
|
|
3937
|
-
|
|
3938
|
-
Opaque path prefix used by `resolveInternalHref` to anchor absolute paths within
|
|
3939
|
-
the archive. For TmpFsAdapter this is the tmp dir; for MemoryAdapter it's a
|
|
3940
|
-
virtual prefix that's never written to disk
|
|
3941
|
-
|
|
3942
|
-
### Methods
|
|
3943
|
-
|
|
3944
|
-
#### archiveLength()
|
|
3945
|
-
|
|
3946
|
-
> **archiveLength**(`path`): `Promise`\<`number`\>
|
|
3947
|
-
|
|
3948
|
-
Defined in:
|
|
3949
|
-
[epub/adapters/interface.ts:39](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L39)
|
|
3950
|
-
|
|
3951
|
-
Length of an entry in bytes, for the readium page-count heuristic which expects
|
|
3952
|
-
compressed size when available
|
|
3953
|
-
|
|
3954
|
-
##### Parameters
|
|
3955
|
-
|
|
3956
|
-
| Parameter | Type |
|
|
3957
|
-
| --------- | -------- |
|
|
3958
|
-
| `path` | `string` |
|
|
3959
|
-
|
|
3960
|
-
##### Returns
|
|
3961
|
-
|
|
3962
|
-
`Promise`\<`number`\>
|
|
3963
|
-
|
|
3964
|
-
#### dispose()
|
|
3965
|
-
|
|
3966
|
-
> **dispose**(): `void` \| `Promise`\<`void`\>
|
|
3967
|
-
|
|
3968
|
-
Defined in:
|
|
3969
|
-
[epub/adapters/interface.ts:58](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L58)
|
|
3970
|
-
|
|
3971
|
-
Always called on close or error
|
|
3972
|
-
|
|
3973
|
-
##### Returns
|
|
3974
|
-
|
|
3975
|
-
`void` \| `Promise`\<`void`\>
|
|
3976
|
-
|
|
3977
|
-
#### duplicate()?
|
|
3978
|
-
|
|
3979
|
-
> `optional` **duplicate**():
|
|
3980
|
-
> `Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
3981
|
-
|
|
3982
|
-
Defined in:
|
|
3983
|
-
[epub/adapters/interface.ts:52](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L52)
|
|
3984
|
-
|
|
3985
|
-
Required for Epub.copy
|
|
3986
|
-
|
|
3987
|
-
##### Returns
|
|
3988
|
-
|
|
3989
|
-
`Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
3990
|
-
|
|
3991
|
-
#### list()?
|
|
3992
|
-
|
|
3993
|
-
> `optional` **list**(): `AsyncIterable`\<[`EpubListEntry`](#epublistentry)\>
|
|
3994
|
-
|
|
3995
|
-
Defined in:
|
|
3996
|
-
[epub/adapters/interface.ts:49](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L49)
|
|
3997
|
-
|
|
3998
|
-
Required for Epub.saveAndClose to walk the contents
|
|
3999
|
-
|
|
4000
|
-
##### Returns
|
|
4001
|
-
|
|
4002
|
-
`AsyncIterable`\<[`EpubListEntry`](#epublistentry)\>
|
|
4003
|
-
|
|
4004
|
-
#### read()
|
|
4005
|
-
|
|
4006
|
-
##### Call Signature
|
|
4007
|
-
|
|
4008
|
-
> **read**(`path`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
4009
|
-
|
|
4010
|
-
Defined in:
|
|
4011
|
-
[epub/adapters/interface.ts:32](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L32)
|
|
4012
|
-
|
|
4013
|
-
###### Parameters
|
|
4014
|
-
|
|
4015
|
-
| Parameter | Type |
|
|
4016
|
-
| --------- | -------- |
|
|
4017
|
-
| `path` | `string` |
|
|
4018
|
-
|
|
4019
|
-
###### Returns
|
|
4020
|
-
|
|
4021
|
-
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
4022
|
-
|
|
4023
|
-
##### Call Signature
|
|
4024
|
-
|
|
4025
|
-
> **read**(`path`, `encoding`): `Promise`\<`string`\>
|
|
4026
|
-
|
|
4027
|
-
Defined in:
|
|
4028
|
-
[epub/adapters/interface.ts:33](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L33)
|
|
4029
|
-
|
|
4030
|
-
###### Parameters
|
|
4031
|
-
|
|
4032
|
-
| Parameter | Type |
|
|
4033
|
-
| ---------- | --------- |
|
|
4034
|
-
| `path` | `string` |
|
|
4035
|
-
| `encoding` | `"utf-8"` |
|
|
4036
|
-
|
|
4037
|
-
###### Returns
|
|
4038
|
-
|
|
4039
|
-
`Promise`\<`string`\>
|
|
4040
|
-
|
|
4041
|
-
#### remove()?
|
|
4042
|
-
|
|
4043
|
-
> `optional` **remove**(`path`): `Promise`\<`void`\>
|
|
4044
|
-
|
|
4045
|
-
Defined in:
|
|
4046
|
-
[epub/adapters/interface.ts:46](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L46)
|
|
4047
|
-
|
|
4048
|
-
Required for removeManifestItem / setCoverImage replacement
|
|
4049
|
-
|
|
4050
|
-
##### Parameters
|
|
4051
|
-
|
|
4052
|
-
| Parameter | Type |
|
|
4053
|
-
| --------- | -------- |
|
|
4054
|
-
| `path` | `string` |
|
|
4055
|
-
|
|
4056
|
-
##### Returns
|
|
4057
|
-
|
|
4058
|
-
`Promise`\<`void`\>
|
|
4059
|
-
|
|
4060
|
-
#### serialize()?
|
|
4061
|
-
|
|
4062
|
-
> `optional` **serialize**(`targetPath`): `Promise`\<`void`\>
|
|
4063
|
-
|
|
4064
|
-
Defined in:
|
|
4065
|
-
[epub/adapters/interface.ts:55](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L55)
|
|
4066
|
-
|
|
4067
|
-
Required for Epub.saveAndClose
|
|
4068
|
-
|
|
4069
|
-
##### Parameters
|
|
4070
|
-
|
|
4071
|
-
| Parameter | Type |
|
|
4072
|
-
| ------------ | -------- |
|
|
4073
|
-
| `targetPath` | `string` |
|
|
4074
|
-
|
|
4075
|
-
##### Returns
|
|
4076
|
-
|
|
4077
|
-
`Promise`\<`void`\>
|
|
4078
|
-
|
|
4079
|
-
#### write()?
|
|
4080
|
-
|
|
4081
|
-
##### Call Signature
|
|
4082
|
-
|
|
4083
|
-
> `optional` **write**(`path`, `data`): `Promise`\<`void`\>
|
|
4084
|
-
|
|
4085
|
-
Defined in:
|
|
4086
|
-
[epub/adapters/interface.ts:42](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L42)
|
|
4087
|
-
|
|
4088
|
-
Required for any mutation method on Epub
|
|
4089
|
-
|
|
4090
|
-
###### Parameters
|
|
4091
|
-
|
|
4092
|
-
| Parameter | Type |
|
|
4093
|
-
| --------- | ------------ |
|
|
4094
|
-
| `path` | `string` |
|
|
4095
|
-
| `data` | `Uint8Array` |
|
|
4096
|
-
|
|
4097
|
-
###### Returns
|
|
4098
|
-
|
|
4099
|
-
`Promise`\<`void`\>
|
|
4100
|
-
|
|
4101
|
-
##### Call Signature
|
|
4102
|
-
|
|
4103
|
-
> `optional` **write**(`path`, `data`, `encoding`): `Promise`\<`void`\>
|
|
4104
|
-
|
|
4105
|
-
Defined in:
|
|
4106
|
-
[epub/adapters/interface.ts:43](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L43)
|
|
4107
|
-
|
|
4108
|
-
###### Parameters
|
|
4109
|
-
|
|
4110
|
-
| Parameter | Type |
|
|
4111
|
-
| ---------- | --------- |
|
|
4112
|
-
| `path` | `string` |
|
|
4113
|
-
| `data` | `string` |
|
|
4114
|
-
| `encoding` | `"utf-8"` |
|
|
4115
|
-
|
|
4116
|
-
###### Returns
|
|
4117
|
-
|
|
4118
|
-
`Promise`\<`void`\>
|
|
4119
|
-
|
|
4120
|
-
---
|
|
4121
|
-
|
|
4122
|
-
## EpubStorageAdapterClass\<Opts\>
|
|
4123
|
-
|
|
4124
|
-
Defined in:
|
|
4125
|
-
[epub/adapters/interface.ts:61](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L61)
|
|
4126
|
-
|
|
4127
|
-
### Type Parameters
|
|
4128
|
-
|
|
4129
|
-
| Type Parameter | Default type |
|
|
4130
|
-
| ------------------------- | ------------ |
|
|
4131
|
-
| `Opts` _extends_ `object` | `object` |
|
|
4132
|
-
|
|
4133
|
-
### Properties
|
|
4134
|
-
|
|
4135
|
-
#### capabilities
|
|
4136
|
-
|
|
4137
|
-
> `readonly` **capabilities**:
|
|
4138
|
-
> [`EpubStorageCapabilities`](#epubstoragecapabilities)
|
|
4139
|
-
|
|
4140
|
-
Defined in:
|
|
4141
|
-
[epub/adapters/interface.ts:63](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L63)
|
|
4142
|
-
|
|
4143
|
-
#### kind
|
|
4144
|
-
|
|
4145
|
-
> `readonly` **kind**: [`EpubStorageKind`](#epubstoragekind)
|
|
4146
|
-
|
|
4147
|
-
Defined in:
|
|
4148
|
-
[epub/adapters/interface.ts:62](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L62)
|
|
4149
|
-
|
|
4150
|
-
### Methods
|
|
4151
|
-
|
|
4152
|
-
#### init()
|
|
4153
|
-
|
|
4154
|
-
> **init**(`source`, `opts?`):
|
|
4155
|
-
> `Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4156
|
-
|
|
4157
|
-
Defined in:
|
|
4158
|
-
[epub/adapters/interface.ts:70](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L70)
|
|
4159
|
-
|
|
4160
|
-
Open an archive from a path or buffer. The returned adapter is ready to read;
|
|
4161
|
-
the Epub class will assert it's a valid EPUB 3 afterwards.
|
|
4162
|
-
|
|
4163
|
-
##### Parameters
|
|
4164
|
-
|
|
4165
|
-
| Parameter | Type |
|
|
4166
|
-
| --------- | --------------------------------------------- |
|
|
4167
|
-
| `source` | `string` \| `Uint8Array`\<`ArrayBufferLike`\> |
|
|
4168
|
-
| `opts?` | `Opts` |
|
|
4169
|
-
|
|
4170
|
-
##### Returns
|
|
4171
|
-
|
|
4172
|
-
`Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4173
|
-
|
|
4174
|
-
#### initEmpty()?
|
|
4175
|
-
|
|
4176
|
-
> `optional` **initEmpty**(`opts?`):
|
|
4177
|
-
> `Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4178
|
-
|
|
4179
|
-
Defined in:
|
|
4180
|
-
[epub/adapters/interface.ts:79](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L79)
|
|
4181
|
-
|
|
4182
|
-
Initialize an empty extract root for [Epub.create](#create).
|
|
4183
|
-
|
|
4184
|
-
Optional — adapters that can't be written to from scratch (e.g. read-only zip
|
|
4185
|
-
handles) should leave this off, and `Epub.using(...).create(...)` will throw.
|
|
4186
|
-
|
|
4187
|
-
##### Parameters
|
|
4188
|
-
|
|
4189
|
-
| Parameter | Type |
|
|
4190
|
-
| --------- | ------ |
|
|
4191
|
-
| `opts?` | `Opts` |
|
|
4192
|
-
|
|
4193
|
-
##### Returns
|
|
4194
|
-
|
|
4195
|
-
`Promise`\<[`EpubStorageAdapter`](#epubstorageadapter)\>
|
|
4196
|
-
|
|
4197
|
-
---
|
|
4198
|
-
|
|
4199
|
-
## EpubStorageCapabilities
|
|
4200
|
-
|
|
4201
|
-
Defined in:
|
|
4202
|
-
[epub/adapters/interface.ts:12](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L12)
|
|
4203
|
-
|
|
4204
|
-
### Properties
|
|
4205
|
-
|
|
4206
|
-
#### writable
|
|
4207
|
-
|
|
4208
|
-
> `readonly` **writable**: `boolean`
|
|
4209
|
-
|
|
4210
|
-
Defined in:
|
|
4211
|
-
[epub/adapters/interface.ts:14](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L14)
|
|
4212
|
-
|
|
4213
|
-
when false, the Epub class refuses every mutation method at runtime
|
|
4214
|
-
|
|
4215
|
-
---
|
|
4216
|
-
|
|
4217
|
-
## FromOptions
|
|
4218
|
-
|
|
4219
|
-
Defined in:
|
|
4220
|
-
[epub/index.ts:178](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L178)
|
|
4221
|
-
|
|
4222
|
-
### Properties
|
|
4223
|
-
|
|
4224
|
-
#### readonly?
|
|
4225
|
-
|
|
4226
|
-
> `optional` **readonly**: `boolean`
|
|
4227
|
-
|
|
4228
|
-
Defined in:
|
|
4229
|
-
[epub/index.ts:183](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L183)
|
|
4230
|
-
|
|
4231
|
-
when true, mutation methods throw [EpubReadOnlyError](#epubreadonlyerror) at
|
|
4232
|
-
runtime
|
|
4233
|
-
|
|
4234
|
-
##### Default
|
|
4235
|
-
|
|
4236
|
-
```ts
|
|
4237
|
-
false
|
|
4238
|
-
```
|
|
4239
|
-
|
|
4240
|
-
---
|
|
4241
|
-
|
|
4242
|
-
## Landmark
|
|
4243
|
-
|
|
4244
|
-
Defined in:
|
|
4245
|
-
[epub/upgrade.ts:87](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/upgrade.ts#L87)
|
|
4246
|
-
|
|
4247
|
-
### Properties
|
|
4248
|
-
|
|
4249
|
-
#### href
|
|
4250
|
-
|
|
4251
|
-
> **href**: `string`
|
|
4252
|
-
|
|
4253
|
-
Defined in:
|
|
4254
|
-
[epub/upgrade.ts:88](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/upgrade.ts#L88)
|
|
4255
|
-
|
|
4256
|
-
#### title
|
|
4257
|
-
|
|
4258
|
-
> **title**: `string`
|
|
4259
|
-
|
|
4260
|
-
Defined in:
|
|
4261
|
-
[epub/upgrade.ts:89](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/upgrade.ts#L89)
|
|
4262
|
-
|
|
4263
|
-
#### type
|
|
4264
|
-
|
|
4265
|
-
> **type**: `string`
|
|
4266
|
-
|
|
4267
|
-
Defined in:
|
|
4268
|
-
[epub/upgrade.ts:90](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/upgrade.ts#L90)
|
|
4269
|
-
|
|
4270
|
-
---
|
|
4271
|
-
|
|
4272
|
-
## MemoryAdapterOptions
|
|
4273
|
-
|
|
4274
|
-
Defined in:
|
|
4275
|
-
[epub/adapters/memory.ts:15](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/memory.ts#L15)
|
|
4276
|
-
|
|
4277
|
-
### Properties
|
|
4278
|
-
|
|
4279
|
-
#### cache?
|
|
4280
|
-
|
|
4281
|
-
> `optional` **cache**: `boolean`
|
|
4282
|
-
|
|
4283
|
-
Defined in:
|
|
4284
|
-
[epub/adapters/memory.ts:22](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/memory.ts#L22)
|
|
4285
|
-
|
|
4286
|
-
per-entry decompressed buffer cache turn it off when opening many EPUBs and
|
|
4287
|
-
reading each entry at most once keeps resident size bounded by the entry index,
|
|
4288
|
-
not the decompressed payload sum
|
|
4289
|
-
|
|
4290
|
-
##### Default
|
|
4291
|
-
|
|
4292
|
-
```ts
|
|
4293
|
-
true
|
|
4294
|
-
```
|
|
4295
|
-
|
|
4296
|
-
#### signal?
|
|
4297
|
-
|
|
4298
|
-
> `optional` **signal**: `AbortSignal`
|
|
4299
|
-
|
|
4300
|
-
Defined in:
|
|
4301
|
-
[epub/adapters/memory.ts:23](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/memory.ts#L23)
|
|
4302
|
-
|
|
4303
|
-
---
|
|
4304
|
-
|
|
4305
|
-
## Navigation
|
|
4306
|
-
|
|
4307
|
-
Defined in:
|
|
4308
|
-
[epub/index.ts:165](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L165)
|
|
4309
|
-
|
|
4310
|
-
### Properties
|
|
4311
|
-
|
|
4312
|
-
#### children
|
|
4313
|
-
|
|
4314
|
-
> **children**: [`NavigationList`](#navigationlist)
|
|
4315
|
-
|
|
4316
|
-
Defined in:
|
|
4317
|
-
[epub/index.ts:167](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L167)
|
|
4318
|
-
|
|
4319
|
-
#### title?
|
|
4320
|
-
|
|
4321
|
-
> `optional` **title**: `string`
|
|
4322
|
-
|
|
4323
|
-
Defined in:
|
|
4324
|
-
[epub/index.ts:166](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L166)
|
|
4325
|
-
|
|
4326
|
-
---
|
|
4327
|
-
|
|
4328
|
-
## NavigationItem
|
|
4329
|
-
|
|
4330
|
-
Defined in:
|
|
4331
|
-
[epub/index.ts:157](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L157)
|
|
4332
|
-
|
|
4333
|
-
### Properties
|
|
4334
|
-
|
|
4335
|
-
#### children?
|
|
4336
|
-
|
|
4337
|
-
> `optional` **children**: [`NavigationList`](#navigationlist)
|
|
4338
|
-
|
|
4339
|
-
Defined in:
|
|
4340
|
-
[epub/index.ts:160](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L160)
|
|
4341
|
-
|
|
4342
|
-
#### href?
|
|
4343
|
-
|
|
4344
|
-
> `optional` **href**: `string`
|
|
4345
|
-
|
|
4346
|
-
Defined in:
|
|
4347
|
-
[epub/index.ts:159](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L159)
|
|
4348
|
-
|
|
4349
|
-
#### title
|
|
4350
|
-
|
|
4351
|
-
> **title**: `string`
|
|
4352
|
-
|
|
4353
|
-
Defined in:
|
|
4354
|
-
[epub/index.ts:158](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L158)
|
|
4355
|
-
|
|
4356
|
-
---
|
|
4357
|
-
|
|
4358
|
-
## AdapterOptions\<A\>
|
|
4359
|
-
|
|
4360
|
-
> **AdapterOptions**\<`A`\> = `A` _extends_
|
|
4361
|
-
> [`EpubStorageAdapterClass`](#epubstorageadapterclass)\<infer Opts\> ? `Opts` :
|
|
4362
|
-
> `object`
|
|
4363
|
-
|
|
4364
|
-
Defined in:
|
|
4365
|
-
[epub/adapters/interface.ts:82](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L82)
|
|
4366
|
-
|
|
4367
|
-
### Type Parameters
|
|
4368
|
-
|
|
4369
|
-
| Type Parameter |
|
|
4370
|
-
| -------------- |
|
|
4371
|
-
| `A` |
|
|
4372
|
-
|
|
4373
|
-
---
|
|
4374
|
-
|
|
4375
|
-
## ElementName
|
|
4376
|
-
|
|
4377
|
-
> **ElementName** =
|
|
4378
|
-
> \`$\{Letter \| Uppercase\<Letter\> \| QuestionMark\}$\{string\}\`
|
|
4379
|
-
|
|
4380
|
-
Defined in:
|
|
4381
|
-
[epub/index.ts:82](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L82)
|
|
4382
|
-
|
|
4383
|
-
A valid name for an XML element (must start with a letter)
|
|
4384
|
-
|
|
4385
|
-
---
|
|
4386
|
-
|
|
4387
|
-
## EpubInstanceFor\<A\>
|
|
4388
|
-
|
|
4389
|
-
> **EpubInstanceFor**\<`A`\> = `A`\[`"capabilities"`\]\[`"writable"`\] _extends_
|
|
4390
|
-
> `true` ? [`Epub`](#epub) : [`EpubReader`](#epubreader)
|
|
4391
|
-
|
|
4392
|
-
Defined in:
|
|
4393
|
-
[epub/index.ts:3006](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L3006)
|
|
4394
|
-
|
|
4395
|
-
Resolves to [Epub](#epub) for writable adapters, [EpubReader](#epubreader) for
|
|
4396
|
-
read-only ones.
|
|
4397
|
-
|
|
4398
|
-
The conditional pivots on `capabilities.writable`, which must be a literal
|
|
4399
|
-
`true`/`false` on the adapter class (use `as const`) for inference to work.
|
|
4400
|
-
|
|
4401
|
-
### Type Parameters
|
|
4402
|
-
|
|
4403
|
-
| Type Parameter |
|
|
4404
|
-
| ------------------------------------------------------------------- |
|
|
4405
|
-
| `A` _extends_ [`EpubStorageAdapterClass`](#epubstorageadapterclass) |
|
|
4406
|
-
|
|
4407
|
-
---
|
|
4408
|
-
|
|
4409
|
-
## EpubMetadata
|
|
4410
|
-
|
|
4411
|
-
> **EpubMetadata** = [`MetadataEntry`](#metadataentry)[]
|
|
4412
|
-
|
|
4413
|
-
Defined in:
|
|
4414
|
-
[epub/index.ts:119](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L119)
|
|
4415
|
-
|
|
4416
|
-
---
|
|
4417
|
-
|
|
4418
|
-
## EpubReader
|
|
4419
|
-
|
|
4420
|
-
> **EpubReader** = `Pick`\<[`Epub`](#epub), `"storage"` \| `"getManifest"` \|
|
|
4421
|
-
> `"getVersion"` \| `"getLayout"` \| `"getBaseDirection"` \| `"getMetadata"` \|
|
|
4422
|
-
> `"findMetadataItem"` \| `"findAllMetadataItems"` \| `"getIdentifier"` \|
|
|
4423
|
-
> `"getTitle"` \| `"getSubtitle"` \| `"getTitles"` \| `"getLanguage"` \|
|
|
4424
|
-
> `"getPublicationDate"` \| `"getModifiedDate"` \| `"getDescription"` \|
|
|
4425
|
-
> `"getType"` \| `"getCreators"` \| `"getContributors"` \| `"getSubjects"` \|
|
|
4426
|
-
> `"getCollections"` \| `"getPackageVocabularyPrefixes"` \|
|
|
4427
|
-
> `"getCoverImageItem"` \| `"getCoverImage"` \| `"getSpineItems"` \|
|
|
4428
|
-
> `"getNcxTableOfContents"` \| `"getGuideEntries"` \| `"getTableOfContents"` \|
|
|
4429
|
-
> `"getLandmarks"` \| `"getPageList"` \| `"resolveHref"` \| `"readFileContents"`
|
|
4430
|
-
> \| `"readItemContents"` \| `"readXhtmlItemContents"` \|
|
|
4431
|
-
> `"getItemArchiveLength"` \| `"discardAndClose"`\> & `Disposable`
|
|
4432
|
-
|
|
4433
|
-
Defined in:
|
|
4434
|
-
[epub/index.ts:190](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L190)
|
|
4435
|
-
|
|
4436
|
-
Read-only view of an EPUB Returned by Epub.using(MemoryAdapter).from(...) and by
|
|
4437
|
-
Epub.from(path, { readonly: true })
|
|
4438
|
-
|
|
4439
|
-
---
|
|
4440
|
-
|
|
4441
|
-
## EpubStorageKind
|
|
4442
|
-
|
|
4443
|
-
> **EpubStorageKind** = `"tmp-dir"` \| `"in-memory"` \| `string` & `object`
|
|
4444
|
-
|
|
4445
|
-
Defined in:
|
|
4446
|
-
[epub/adapters/interface.ts:10](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/adapters/interface.ts#L10)
|
|
4447
|
-
|
|
4448
|
-
Pluggable storage backend for an Epub instance
|
|
4449
|
-
|
|
4450
|
-
Built-in adapters:
|
|
4451
|
-
|
|
4452
|
-
- [TmpFsAdapter](#tmpfsadapter) extracts the archive to a tmp directory and
|
|
4453
|
-
supports the full read/write/save/upgrade
|
|
4454
|
-
- [MemoryAdapter](#memoryadapter) keeps an in-memory zip handle and supports
|
|
4455
|
-
reads only
|
|
4456
|
-
|
|
4457
|
-
---
|
|
4458
|
-
|
|
4459
|
-
## InMemoryEpubReader
|
|
4460
|
-
|
|
4461
|
-
> **InMemoryEpubReader** = [`EpubReader`](#epubreader) & `object`
|
|
4462
|
-
|
|
4463
|
-
Defined in:
|
|
4464
|
-
[epub/index.ts:235](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L235)
|
|
4465
|
-
|
|
4466
|
-
Readonly Epub-instance backed by an in-memory zip handle Returned by
|
|
4467
|
-
`Epub.using(MemoryAdapter).from(...)`
|
|
4468
|
-
|
|
4469
|
-
### Type Declaration
|
|
4470
|
-
|
|
4471
|
-
#### storage
|
|
4472
|
-
|
|
4473
|
-
> `readonly` **storage**: `"in-memory"`
|
|
4474
|
-
|
|
4475
|
-
---
|
|
4476
|
-
|
|
4477
|
-
## ManifestItem
|
|
4478
|
-
|
|
4479
|
-
> **ManifestItem** = `object`
|
|
4480
|
-
|
|
4481
|
-
Defined in:
|
|
4482
|
-
[epub/index.ts:103](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L103)
|
|
4483
|
-
|
|
4484
|
-
### Properties
|
|
4485
|
-
|
|
4486
|
-
#### fallback?
|
|
4487
|
-
|
|
4488
|
-
> `optional` **fallback**: `string`
|
|
4489
|
-
|
|
4490
|
-
Defined in:
|
|
4491
|
-
[epub/index.ts:107](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L107)
|
|
4492
|
-
|
|
4493
|
-
#### href
|
|
4494
|
-
|
|
4495
|
-
> **href**: `string`
|
|
4496
|
-
|
|
4497
|
-
Defined in:
|
|
4498
|
-
[epub/index.ts:105](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L105)
|
|
4499
|
-
|
|
4500
|
-
#### id
|
|
4501
|
-
|
|
4502
|
-
> **id**: `string`
|
|
4503
|
-
|
|
4504
|
-
Defined in:
|
|
4505
|
-
[epub/index.ts:104](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L104)
|
|
4506
|
-
|
|
4507
|
-
#### mediaOverlay?
|
|
4508
|
-
|
|
4509
|
-
> `optional` **mediaOverlay**: `string`
|
|
4510
|
-
|
|
4511
|
-
Defined in:
|
|
4512
|
-
[epub/index.ts:108](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L108)
|
|
4513
|
-
|
|
4514
|
-
#### mediaType?
|
|
4515
|
-
|
|
4516
|
-
> `optional` **mediaType**: `string`
|
|
4517
|
-
|
|
4518
|
-
Defined in:
|
|
4519
|
-
[epub/index.ts:106](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L106)
|
|
4520
|
-
|
|
4521
|
-
#### properties?
|
|
4522
|
-
|
|
4523
|
-
> `optional` **properties**: `string`[]
|
|
4524
|
-
|
|
4525
|
-
Defined in:
|
|
4526
|
-
[epub/index.ts:109](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L109)
|
|
4527
|
-
|
|
4528
|
-
---
|
|
4529
|
-
|
|
4530
|
-
## MetadataEntry
|
|
4531
|
-
|
|
4532
|
-
> **MetadataEntry** = `object`
|
|
4533
|
-
|
|
4534
|
-
Defined in:
|
|
4535
|
-
[epub/index.ts:112](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L112)
|
|
4536
|
-
|
|
4537
|
-
### Properties
|
|
4538
|
-
|
|
4539
|
-
#### id?
|
|
4540
|
-
|
|
4541
|
-
> `optional` **id**: `string`
|
|
4542
|
-
|
|
4543
|
-
Defined in:
|
|
4544
|
-
[epub/index.ts:113](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L113)
|
|
4545
|
-
|
|
4546
|
-
#### properties
|
|
4547
|
-
|
|
4548
|
-
> **properties**: `Record`\<`string`, `string`\>
|
|
4549
|
-
|
|
4550
|
-
Defined in:
|
|
4551
|
-
[epub/index.ts:115](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L115)
|
|
4552
|
-
|
|
4553
|
-
#### type
|
|
4554
|
-
|
|
4555
|
-
> **type**: [`ElementName`](#elementname)
|
|
4556
|
-
|
|
4557
|
-
Defined in:
|
|
4558
|
-
[epub/index.ts:114](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L114)
|
|
4559
|
-
|
|
4560
|
-
#### value
|
|
4561
|
-
|
|
4562
|
-
> **value**: `string` \| `undefined`
|
|
4563
|
-
|
|
4564
|
-
Defined in:
|
|
4565
|
-
[epub/index.ts:116](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L116)
|
|
4566
|
-
|
|
4567
|
-
---
|
|
4568
|
-
|
|
4569
|
-
## NavigationList
|
|
4570
|
-
|
|
4571
|
-
> **NavigationList** = [`NavigationItem`](#navigationitem)[]
|
|
4572
|
-
|
|
4573
|
-
Defined in:
|
|
4574
|
-
[epub/index.ts:163](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L163)
|
|
4575
|
-
|
|
4576
|
-
---
|
|
4577
|
-
|
|
4578
|
-
## PackageElement
|
|
4579
|
-
|
|
4580
|
-
> **PackageElement** = [`XmlElement`](#xmlelement)\<`"package"`\>
|
|
4581
|
-
|
|
4582
|
-
Defined in:
|
|
4583
|
-
[epub/index.ts:176](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L176)
|
|
4584
|
-
|
|
4585
|
-
---
|
|
4586
|
-
|
|
4587
|
-
## ParsedXml
|
|
4588
|
-
|
|
4589
|
-
> **ParsedXml** = [`XmlNode`](#xmlnode)[]
|
|
4590
|
-
|
|
4591
|
-
Defined in:
|
|
4592
|
-
[epub/index.ts:101](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L101)
|
|
4593
|
-
|
|
4594
|
-
An XML structure
|
|
4595
|
-
|
|
4596
|
-
---
|
|
4597
|
-
|
|
4598
|
-
## XmlElement\<Name\>
|
|
4599
|
-
|
|
4600
|
-
> **XmlElement**\<`Name`\> = `object` & `{ [key in Name]: ParsedXml }`
|
|
4601
|
-
|
|
4602
|
-
Defined in:
|
|
4603
|
-
[epub/index.ts:88](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L88)
|
|
4604
|
-
|
|
4605
|
-
An XML element
|
|
4606
|
-
|
|
4607
|
-
### Type Declaration
|
|
4608
|
-
|
|
4609
|
-
#### :@?
|
|
4610
|
-
|
|
4611
|
-
> `optional` **:@**: `Record`\<`` `${PropertyPrefix}${string}` ``, `string`\>
|
|
4612
|
-
|
|
4613
|
-
### Type Parameters
|
|
4614
|
-
|
|
4615
|
-
| Type Parameter | Default type |
|
|
4616
|
-
| ---------------------------------------------- | ----------------------------- |
|
|
4617
|
-
| `Name` _extends_ [`ElementName`](#elementname) | [`ElementName`](#elementname) |
|
|
4618
|
-
|
|
4619
|
-
---
|
|
4620
|
-
|
|
4621
|
-
## XmlNode
|
|
4622
|
-
|
|
4623
|
-
> **XmlNode** = [`XmlElement`](#xmlelement) \| [`XmlTextNode`](#xmltextnode)
|
|
4624
|
-
|
|
4625
|
-
Defined in:
|
|
4626
|
-
[epub/index.ts:98](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L98)
|
|
4627
|
-
|
|
4628
|
-
A valid XML node. May be either an element or a text node.
|
|
4629
|
-
|
|
4630
|
-
---
|
|
4631
|
-
|
|
4632
|
-
## XmlTextNode
|
|
4633
|
-
|
|
4634
|
-
> **XmlTextNode** = `object`
|
|
4635
|
-
|
|
4636
|
-
Defined in:
|
|
4637
|
-
[epub/index.ts:95](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L95)
|
|
4638
|
-
|
|
4639
|
-
A text node in an XML document
|
|
4640
|
-
|
|
4641
|
-
### Properties
|
|
4642
|
-
|
|
4643
|
-
#### #text
|
|
4644
|
-
|
|
4645
|
-
> **#text**: `string`
|
|
4646
|
-
|
|
4647
|
-
Defined in:
|
|
4648
|
-
[epub/index.ts:95](https://gitlab.com/storyteller-platform/storyteller/-/blob/main/epub/index.ts#L95)
|
|
4102
|
+
[libraries/epub/index.ts:165](https://gitlab.com
|