Skip to main content

@storyteller-platform/epub API

Epub​

Defined in: libraries/epub/src/index.tsx:374

A single EPUB instance.

The entire EPUB contents will be read into memory.

Example usage:

import {
Epub,
getBody,
findByName,
textContent,
} from "@storyteller-platform/epub";

using epub = await Epub.from("./path/to/book.epub");
const title = await epub.getTitle();
const spineItems = await epub.getSpineItems();
const chptOne = spineItems[0];
const chptOneXml = await epub.readXhtmlItemContents(chptOne.id);

const body = getBody(chptOneXml);
const h1 = findXmlChildByName("h1", body);
const headingText = textContent(h1);

await epub.setTitle(headingText);
await epub.saveAndClose();

https://www.w3.org/TR/epub-33/

Constructors​

Constructor​

new Epub(adapterClass, adapter, inputPath, readonlyOverride): Epub

Defined in: libraries/epub/src/index.tsx:415

Prefer the static factories (Epub.using, Epub.from, Epub.create, Epub.upgrade) over calling this constructor directly. It's public so EpubFactory can construct instances; nothing else should need to.

Parameters​
ParameterTypeDefault value
adapterClassEpubStorageAdapterClassundefined
adapterEpubStorageAdapterundefined
inputPathstring | undefinedundefined
readonlyOverridebooleanfalse
Returns​

Epub

Properties​

adapter​

protected adapter: EpubStorageAdapter

Defined in: libraries/epub/src/index.tsx:417

adapterClass​

protected adapterClass: EpubStorageAdapterClass

Defined in: libraries/epub/src/index.tsx:416

inputPath​

protected inputPath: string | undefined

Defined in: libraries/epub/src/index.tsx:418

readonlyOverride​

protected readonlyOverride: boolean = false

Defined in: libraries/epub/src/index.tsx:419

storage​

readonly storage: EpubStorageKind

Defined in: libraries/epub/src/index.tsx:407

Storage backend kind in use for this instance

Public so callers can declare type-level requirements via InMemoryEpubReader Orthogonal to the read-only / writable axis (controlled by readonlyOverride and the adapter's capability bag)

Methods​

[dispose]()​

[dispose](): void

Defined in: libraries/epub/src/index.tsx:3373

Returns​

void

addCollection()​

addCollection(collection, index?): Promise<void>

Defined in: libraries/epub/src/index.tsx:1993

Add a collection to the EPUB metadata.

If index is provided, the collection will be placed at that index in the list of collections. Otherwise, it will be added to the end of the list.

Parameters​
ParameterType
collectionCollection
index?number
Returns​

Promise<void>

addContributor()​

addContributor(contributor, index?): Promise<void>

Defined in: libraries/epub/src/index.tsx:2302

Add a contributor to the EPUB metadata.

If index is provided, the creator will be placed at that index in the list of creators. Otherwise, it will be added to the end of the list.

This is a convenience method for epub.addCreator(contributor, index, 'contributor').

Parameters​
ParameterType
contributorDcCreator
index?number
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dccreator

addCreator()​

addCreator(creator, index?, type?): Promise<void>

Defined in: libraries/epub/src/index.tsx:2167

Add a creator to the EPUB metadata.

If index is provided, the creator will be placed at that index in the list of creators. Otherwise, it will be added to the end of the list.

Parameters​
ParameterTypeDefault value
creatorDcCreatorundefined
index?numberundefined
type?"creator" | "contributor""creator"
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dccreator

addManifestItem()​

Call Signature​

addManifestItem(item, contents, encoding): Promise<void>

Defined in: libraries/epub/src/index.tsx:2967

Create a new manifest item and write its contents to a new entry.

Parameters​
ParameterTypeDescription
itemManifestItem-
contentsDocumentThe new contents. May be either a parsed XML tree or a unicode string, as determined by the as argument.
encoding"xml"Optional - whether to interpret contents as a parsed XML tree, a unicode string, or a byte array. Defaults to a byte array.
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-pkg-manifest

https://www.w3.org/TR/epub-33/#sec-contentdocs

Call Signature​

addManifestItem(item, contents, encoding): Promise<void>

Defined in: libraries/epub/src/index.tsx:2972

Create a new manifest item and write its contents to a new entry.

Parameters​
ParameterTypeDescription
itemManifestItem-
contentsstringThe new contents. May be either a parsed XML tree or a unicode string, as determined by the as argument.
encoding"utf-8"Optional - whether to interpret contents as a parsed XML tree, a unicode string, or a byte array. Defaults to a byte array.
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-pkg-manifest

https://www.w3.org/TR/epub-33/#sec-contentdocs

Call Signature​

addManifestItem(item, contents): Promise<void>

Defined in: libraries/epub/src/index.tsx:2977

Create a new manifest item and write its contents to a new entry.

Parameters​
ParameterTypeDescription
itemManifestItem-
contentsUint8ArrayThe new contents. May be either a parsed XML tree or a unicode string, as determined by the as argument.
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-pkg-manifest

https://www.w3.org/TR/epub-33/#sec-contentdocs

addMetadata()​

addMetadata(entry): Promise<void>

Defined in: libraries/epub/src/index.tsx:3106

Add a new metadata entry to the Epub.

This method, like epub.getMetadata(), operates on metadata entries. For more useful semantic representations of metadata, use specific methods such as setTitle() and setLanguage().

Parameters​
ParameterType
entryMetadataEntry
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-pkg-metadata

addSpineItem()​

addSpineItem(manifestId, index?): Promise<void>

Defined in: libraries/epub/src/index.tsx:2370

Add an item to the spine of the EPUB.

If index is undefined, the item will be added to the end of the spine. Otherwise it will be inserted at the specified index.

If the manifestId does not correspond to an item in the manifest, this will throw an error.

Parameters​
ParameterType
manifestIdstring
index?number
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-spine-elem

addSubject()​

addSubject(subject): Promise<void>

Defined in: libraries/epub/src/index.tsx:1538

Add a subject to the EPUB metadata.

Parameters​
ParameterTypeDescription
subjectstring | DcSubjectMay be a string representing just a schema-less subject name, or a DcSubject object
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dcsubject

copy()​

copy(path?): Promise<Epub>

Defined in: libraries/epub/src/index.tsx:512

Parameters​
ParameterType
path?string
Returns​

Promise<Epub>

createXhtmlDocument()​

createXhtmlDocument(body, head?, language?): Promise<Document>

Defined in: libraries/epub/src/index.tsx:2768

Create a new XHTML document with the given body and head.

Parameters​
ParameterTypeDescription
bodyNode[]The XML nodes to place in the body of the document
head?Node[]Optional - the XMl nodes to place in the head
language?LocaleOptional - defaults to the EPUB's language
Returns​

Promise<Document>

createXmlDocument()​

createXmlDocument(root): Document

Defined in: libraries/epub/src/index.tsx:2732

Create a new XML document with the given root node.

Parameters​
ParameterTypeDescription
rootElementThe XML node to use as the document element
Returns​

Document

discardAndClose()​

discardAndClose(): void

Defined in: libraries/epub/src/index.tsx:3323

Returns​

void

findAllMetadataItems()​

findAllMetadataItems(predicate): Promise<MetadataEntry[]>

Defined in: libraries/epub/src/index.tsx:785

Returns the item in the metadata element's children array that matches the provided predicate.

Parameters​
ParameterType
predicate(entry) => boolean
Returns​

Promise<MetadataEntry[]>

findMetadataItem()​

findMetadataItem(predicate): Promise<MetadataEntry | null>

Defined in: libraries/epub/src/index.tsx:776

Returns the item in the metadata element's children array that matches the provided predicate.

Parameters​
ParameterType
predicate(entry) => boolean
Returns​

Promise<MetadataEntry | null>

getBaseDirection()​

getBaseDirection(): Promise<"auto" | "rtl" | "ltr">

Defined in: libraries/epub/src/index.tsx:1492

Retrieve the base direction from the package element.

If there is no dir attribute on the package element, returns 'auto'.

Returns​

Promise<"auto" | "rtl" | "ltr">

https://www.w3.org/TR/epub-33/#attrdef-dir

getCollections()​

getCollections(): Promise<Collection[]>

Defined in: libraries/epub/src/index.tsx:1953

Retrieve the list of collections.

Returns​

Promise<Collection[]>

getContributors()​

getContributors(): Promise<DcCreator[]>

Defined in: libraries/epub/src/index.tsx:2154

Retrieve the list of contributors.

This is a convenience method for epub.getCreators('contributor').

Returns​

Promise<DcCreator[]>

https://www.w3.org/TR/epub-33/#sec-opf-dccontributor

getCoverImage()​

getCoverImage(): Promise<Uint8Array<ArrayBufferLike> | null>

Defined in: libraries/epub/src/index.tsx:1388

Retrieve the cover image data as a byte array.

This does not include, for example, the cover image's filename or mime type. To retrieve the image manifest item, use epub.getCoverImageItem().

Returns​

Promise<Uint8Array<ArrayBufferLike> | null>

https://www.w3.org/TR/epub-33/#sec-cover-image

getCoverImageItem()​

getCoverImageItem(): Promise<ManifestItem | null>

Defined in: libraries/epub/src/index.tsx:1369

Retrieve the cover image manifest item.

This does not return the actual image data. To retrieve the image data, pass this item's id to epub.readItemContents, or use epub.getCoverImage() instead.

Returns​

Promise<ManifestItem | null>

https://www.w3.org/TR/epub-33/#sec-cover-image

getCreators()​

getCreators(type): Promise<DcCreator[]>

Defined in: libraries/epub/src/index.tsx:2090

Retrieve the list of creators.

Parameters​
ParameterTypeDefault value
type"creator" | "contributor""creator"
Returns​

Promise<DcCreator[]>

https://www.w3.org/TR/epub-33/#sec-opf-dccreator

getDescription()​

getDescription(): Promise<string | null>

Defined in: libraries/epub/src/index.tsx:1811

Retrieve the Epub's description as specified in its package document metadata.

If no description metadata is specified, returns null. Returns the description as a string. Descriptions may include HTML markup.

Returns​

Promise<string | null>

getGuideEntries()​

getGuideEntries(): Promise<GuideItem[]>

Defined in: libraries/epub/src/index.tsx:3306

Retrieve the guide entries from the package document.

The guide element is deprecated in EPUB 3 in favor of the landmarks nav, but many publications still include it.

Returns​

Promise<GuideItem[]>

getIdentifier()​

getIdentifier(): Promise<string | null>

Defined in: libraries/epub/src/index.tsx:877

Retrieve the first identifier from the dc:identifier element in the EPUB metadata.

If there is no dc:identifier element, returns null.

Returns​

Promise<string | null>

https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier

Deprecated​

Use getUniqueIdentifier instead to get the unique identifier, or getIdentifiers to get all identifiers.

getIdentifiers()​

getIdentifiers(): Promise<EpubIdentifier[]>

Defined in: libraries/epub/src/index.tsx:1043

Retrieve every dc:identifier entry, returned as found.

Values are not interpreted. Any refining identifier-type meta (spec D.3.8) or legacy opf:scheme attribute is surfaced on the entry, but no parsing of the value itself is attempted. To read dc:source entries, use getSources.

Returns​

Promise<EpubIdentifier[]>

https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier

getItemArchiveLength()​

getItemArchiveLength(id): Promise<number>

Defined in: libraries/epub/src/index.tsx:538

Length of the underlying archive entry for a manifest item, in bytes Necessary to compute the readium page count which is for COMPRESSED content

Parameters​
ParameterType
idstring
Returns​

Promise<number>

See​

https://github.com/readium/architecture/issues/123

getLandmarks()​

getLandmarks(__namedParameters): Promise<Navigation | null>

Defined in: libraries/epub/src/index.tsx:2555

Returns the structured landmarks navigation document as a Navigation object

Parameters​
ParameterType
__namedParameters{ resolveToRoot?: boolean; }
__namedParameters.resolveToRoot?boolean
Returns​

Promise<Navigation | null>

https://www.w3.org/TR/epub-33/#sec-nav-landmarks

getLanguage()​

getLanguage(): Promise<Locale | null>

Defined in: libraries/epub/src/index.tsx:1648

Retrieve the Epub's language as specified in its package document metadata.

If no language metadata is specified, returns null. Returns the language as an Intl.Locale instance.

Returns​

Promise<Locale | null>

https://www.w3.org/TR/epub-33/#sec-opf-dclanguage

getLayout()​

getLayout(): Promise<"pre-paginated" | "reflowable">

Defined in: libraries/epub/src/index.tsx:1473

Retrieve the layout from the rendition:layout meta element in the EPUB metadata.

If there is no meta element, returns 'reflowable'.

Returns​

Promise<"pre-paginated" | "reflowable">

https://www.w3.org/TR/epub-33/#layout

getManifest()​

getManifest(): Promise<Record<string, ManifestItem>>

Defined in: libraries/epub/src/index.tsx:698

Retrieve the manifest for the Epub.

This is represented as a map from each manifest items' id to the rest of its properties. Manifest hrefs are always URI-encoded (e.g. chapter one.xhtml -> chapter%20one.xhtml), even if the raw XML is (incorrectly) not URI-encoded.

Returns​

Promise<Record<string, ManifestItem>>

https://www.w3.org/TR/epub-33/#sec-pkg-manifest

getMetadata()​

getMetadata(): Promise<EpubMetadata>

Defined in: libraries/epub/src/index.tsx:845

Retrieve the metadata entries for the Epub.

This is represented as an array of metadata entries, in the order that they're presented in the Epub package document.

For more useful semantic representations of metadata, use specific methods such as getTitle() and getAuthors().

Returns​

Promise<EpubMetadata>

https://www.w3.org/TR/epub-33/#sec-pkg-metadata

getModifiedDate()​

getModifiedDate(): Promise<Date | null>

Defined in: libraries/epub/src/index.tsx:1456

Retrieve the modified date from the dcterms:modified metadata in the EPUB metadata as a Date object.

If there is no meta element with dcterms:modified, returns null.

Returns​

Promise<Date | null>

https://www.w3.org/TR/epub-33/#sec-metadata-last-modified

getNcxTableOfContents()​

getNcxTableOfContents(): Promise<NavigationList>

Defined in: libraries/epub/src/index.tsx:3230

Parse the NCX table of contents, if one exists, and return a tree of TocEntry nodes.

Useful for both EPUB 2 publications (where the NCX is the primary navigation) and EPUB 3 publications that retain an NCX for backwards compatibility.

Returns​

Promise<NavigationList>

getPackageDocumentSource()​

getPackageDocumentSource(): Promise<string>

Defined in: libraries/epub/src/index.tsx:592

Returns​

Promise<string>

getPackageElement()​

getPackageElement(lock): Promise<Element>

Defined in: libraries/epub/src/index.tsx:615

Parameters​
ParameterTypeDefault value
lockbooleantrue
Returns​

Promise<Element>

getPackageVocabularyPrefixes()​

getPackageVocabularyPrefixes(): Promise<Record<string, string>>

Defined in: libraries/epub/src/index.tsx:1828

Return the set of custom vocabulary prefixes set on this publication's root package element.

Returns a map from prefix to URI

Returns​

Promise<Record<string, string>>

https://www.w3.org/TR/epub-33/#sec-prefix-attr

getPageBreakSource()​

getPageBreakSource(): Promise<EpubSource | null>

Defined in: libraries/epub/src/index.tsx:1080

Retrieve the pageBreakSource property (EPUB 3.4, spec D.2.9), the publication-level source for the source of its page break markers.

This property replaces the refining source-of="pagination" meta (spec D.3.11), see EpubSource.sourceOf. If no pageBreakSource property is found, we fall back to finding a dc:source with a source-of="pagination" refinement.

Returns​

Promise<EpubSource | null>

https://www.w3.org/TR/epub/#pageBreakSource

getPageList()​

getPageList(__namedParameters): Promise<Navigation | null>

Defined in: libraries/epub/src/index.tsx:2567

Returns the structured page list navigation document as a Navigation object

Parameters​
ParameterType
__namedParameters{ resolveToRoot?: boolean; }
__namedParameters.resolveToRoot?boolean
Returns​

Promise<Navigation | null>

https://www.w3.org/TR/epub-33/#sec-nav-landmarks

getPublicationDate()​

getPublicationDate(): Promise<Date | null>

Defined in: libraries/epub/src/index.tsx:1425

Retrieve the publication date from the dc:date element in the EPUB metadata as a Date object.

If there is no dc:date element, returns null.

Returns​

Promise<Date | null>

https://www.w3.org/TR/epub-33/#sec-opf-dcdate

getRootfile()​

getRootfile(): Promise<string>

Defined in: libraries/epub/src/index.tsx:549

Returns​

Promise<string>

getSources()​

getSources(): Promise<EpubSource[]>

Defined in: libraries/epub/src/index.tsx:1057

Retrieve every dc:source entry, returned as found.

Like getIdentifiers, values are not interpreted. In addition to a refining identifier-type, a refining source-of meta (spec D.3.11) is surfaced as sourceOf.

Returns​

Promise<EpubSource[]>

https://www.w3.org/TR/epub-33/#sec-opf-dcsource

getSpineItems()​

getSpineItems(): Promise<ManifestItem & object[]>

Defined in: libraries/epub/src/index.tsx:2343

Retrieve the manifest items that make up the Epub's spine.

The spine specifies the order that the contents of the Epub should be displayed to users by default.

Returns​

Promise<ManifestItem & object[]>

https://www.w3.org/TR/epub-33/#sec-spine-elem

getSubjects()​

getSubjects(): Promise<(string | DcSubject)[]>

Defined in: libraries/epub/src/index.tsx:1603

Retrieve the list of subjects for this EPUB.

Subjects without associated authority and term metadata will be returned as strings. Otherwise, they will be represented as DcSubject objects, with a value, authority, and term.

Returns​

Promise<(string | DcSubject)[]>

https://www.w3.org/TR/epub-33/#sec-opf-dcsubject

getSubtitle()​

getSubtitle(): Promise<string | null>

Defined in: libraries/epub/src/index.tsx:1718

Retrieve the subtitle of the Epub, if it exists.

Returns​

Promise<string | null>

https://www.w3.org/TR/epub-33/#sec-opf-dctitle

getTableOfContents()​

getTableOfContents(__namedParameters): Promise<Navigation | null>

Defined in: libraries/epub/src/index.tsx:2537

Returns the structured table of contents navigation document as a Navigation object.

Parameters​
ParameterType
__namedParameters{ resolveToRoot?: boolean; }
__namedParameters.resolveToRoot?boolean
Returns​

Promise<Navigation | null>

https://www.w3.org/TR/epub-33/#sec-nav-toc

getTitle()​

getTitle(expanded): Promise<string | null>

Defined in: libraries/epub/src/index.tsx:1694

Retrieve the title of the Epub.

Parameters​
ParameterTypeDefault value
expandedbooleanfalse
Returns​

Promise<string | null>

https://www.w3.org/TR/epub-33/#sec-opf-dctitle

getTitles()​

getTitles(): Promise<object[]>

Defined in: libraries/epub/src/index.tsx:1730

Retrieve all title entries of the Epub.

Returns​

Promise<object[]>

https://www.w3.org/TR/epub-33/#sec-opf-dctitle

getType()​

getType(): Promise<MetadataEntry | null>

Defined in: libraries/epub/src/index.tsx:1525

Retrieve the publication type from the dc:type element in the EPUB metadata.

If there is no dc:type element, returns null.

Returns​

Promise<MetadataEntry | null>

https://www.w3.org/TR/epub-33/#sec-opf-dctype

getUniqueIdentifier()​

getUniqueIdentifier(): Promise<string | null>

Defined in: libraries/epub/src/index.tsx:909

Retrieve the identifier with the unique identifier id in the EPUB metadata.

If there is no unique identifier id, returns the first dc:identifier element.

Returns​

Promise<string | null>

https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier

getUniqueIdentifierId()​

getUniqueIdentifierId(): Promise<string | null>

Defined in: libraries/epub/src/index.tsx:981

Retrieve the id of the publication's unique identifier, as declared by the package element's unique-identifier attribute.

Returns​

Promise<string | null>

https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier

getVersion()​

getVersion(): Promise<string>

Defined in: libraries/epub/src/index.tsx:3217

Returns the EPUB version declared on the package element.

Returns​

Promise<string>

readFileContents()​

Call Signature​

readFileContents(href, relativeTo?): Promise<Uint8Array<ArrayBufferLike>>

Defined in: libraries/epub/src/index.tsx:2673

Retrieve the contents of a file, given its href.

Optionally takes the href that this href should be resolved relative to, and an encoding parameter.

Parameters​
ParameterTypeDescription
hrefstringThe href of the file to retrieve
relativeTo?string-
Returns​

Promise<Uint8Array<ArrayBufferLike>>

Call Signature​

readFileContents(href, relativeTo, encoding): Promise<string>

Defined in: libraries/epub/src/index.tsx:2674

Retrieve the contents of a file, given its href.

Optionally takes the href that this href should be resolved relative to, and an encoding parameter.

Parameters​
ParameterTypeDescription
hrefstringThe href of the file to retrieve
relativeTostring | undefined-
encoding"utf-8"Optional - Must be the string "utf-8". If provided, the function will encode the data into a unicode string. Otherwise, the data will be returned as a byte array.
Returns​

Promise<string>

readItemContents()​

Call Signature​

readItemContents(id): Promise<Uint8Array<ArrayBufferLike>>

Defined in: libraries/epub/src/index.tsx:2706

Retrieve the contents of a manifest item, given its id.

Parameters​
ParameterTypeDescription
idstringThe id of the manifest item to retrieve
Returns​

Promise<Uint8Array<ArrayBufferLike>>

https://www.w3.org/TR/epub-33/#sec-contentdocs

Call Signature​

readItemContents(id, encoding): Promise<string>

Defined in: libraries/epub/src/index.tsx:2707

Retrieve the contents of a manifest item, given its id.

Parameters​
ParameterTypeDescription
idstringThe id of the manifest item to retrieve
encoding"utf-8"Optional - must be the string "utf-8". If provided, the function will encode the data into a unicode string. Otherwise, the data will be returned as a byte array.
Returns​

Promise<string>

https://www.w3.org/TR/epub-33/#sec-contentdocs

readXhtmlItemContents()​

Call Signature​

readXhtmlItemContents(id, as?): Promise<Document>

Defined in: libraries/epub/src/index.tsx:2818

Retrieves the contents of an XHTML item, given its manifest id.

Parameters​
ParameterTypeDescription
idstringThe id of the manifest item to retrieve
as?"xhtml"Optional - whether to return the parsed XML document tree, or the concatenated text of the document. Defaults to the parsed XML tree.
Returns​

Promise<Document>

https://www.w3.org/TR/epub-33/#sec-xhtml

Call Signature​

readXhtmlItemContents(id, as): Promise<string>

Defined in: libraries/epub/src/index.tsx:2819

Retrieves the contents of an XHTML item, given its manifest id.

Parameters​
ParameterTypeDescription
idstringThe id of the manifest item to retrieve
as"text"Optional - whether to return the parsed XML document tree, or the concatenated text of the document. Defaults to the parsed XML tree.
Returns​

Promise<string>

https://www.w3.org/TR/epub-33/#sec-xhtml

removeCollection()​

removeCollection(index): Promise<void>

Defined in: libraries/epub/src/index.tsx:2057

Remove a collection from the EPUB metadata.

Removes the collection at the provided index. This index refers to the array returned by epub.getCollections().

Parameters​
ParameterType
indexnumber
Returns​

Promise<void>

removeContributor()​

removeContributor(index): Promise<void>

Defined in: libraries/epub/src/index.tsx:2286

Remove a contributor from the EPUB metadata.

Removes the contributor at the provided index. This index refers to the array returned by epub.getContributors().

This is a convenience method for epub.removeCreator(index, 'contributor').

Parameters​
ParameterType
indexnumber
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dccreator

removeCreator()​

removeCreator(index, type): Promise<void>

Defined in: libraries/epub/src/index.tsx:2249

Remove a creator from the EPUB metadata.

Removes the creator at the provided index. This index refers to the array returned by epub.getCreators().

Parameters​
ParameterTypeDefault value
indexnumberundefined
type"creator" | "contributor""creator"
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dccreator

removeManifestItem()​

removeManifestItem(id): Promise<void>

Defined in: libraries/epub/src/index.tsx:2918

Parameters​
ParameterType
idstring
Returns​

Promise<void>

removeMetadata()​

removeMetadata(predicate): Promise<void>

Defined in: libraries/epub/src/index.tsx:3192

Remove one or more metadata entries.

The predicate argument will be used to determine which entries to remove. The all metadata entries that match the predicate will be removed.

Parameters​
ParameterTypeDescription
predicate(entry) => booleanCalls predicate once for each metadata entry, removing any for which it returns true
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-pkg-metadata

removeSpineItem()​

removeSpineItem(index): Promise<void>

Defined in: libraries/epub/src/index.tsx:2416

Remove the spine item at the specified index.

Parameters​
ParameterType
indexnumber
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-spine-elem

removeSubject()​

removeSubject(index): Promise<void>

Defined in: libraries/epub/src/index.tsx:1575

Remove a subject from the EPUB metadata.

Removes the subject at the provided index. This index refers to the array returned by epub.getSubjects().

Parameters​
ParameterType
indexnumber
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dccreator

replaceMetadata()​

replaceMetadata(predicate, entry): Promise<void>

Defined in: libraries/epub/src/index.tsx:3141

Replace a metadata entry with a new one.

The predicate argument will be used to determine which entry to replace. The first metadata entry that matches the predicate will be replaced.

Parameters​
ParameterTypeDescription
predicate(entry) => booleanCalls predicate once for each metadata entry, until it finds one where predicate returns true
entryMetadataEntryThe new entry to replace the found entry with
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-pkg-metadata

resolveHref()​

resolveHref(href, relativeTo?, __namedParameters?): Promise<string>

Defined in: libraries/epub/src/index.tsx:2631

Returns a path-relative-scheme-less URL, relative to the container root.

An href that points outside the publication, such as an external link in a navigation document, is handed back unchanged.

Parameters​
ParameterTypeDescription
hrefstringThe href to resolve
relativeTo?stringOptional - The href to resolve this href relative to. Use if resolving a relative href from a file other than the package document.
__namedParameters?{ toRoot?: boolean; }-
__namedParameters.toRoot?boolean-
Returns​

Promise<string>

saveAndClose()​

saveAndClose(): Promise<void>

Defined in: libraries/epub/src/index.tsx:3338

Write the current contents of the Epub to a new EPUB archive on disk.

When this method is called, the "dcterms:modified" meta tag is automatically updated to the current UTC timestamp.

Returns​

Promise<void>

setCoverImage()​

setCoverImage(href, data): Promise<void>

Defined in: libraries/epub/src/index.tsx:1402

Set the cover image for the EPUB.

Adds a manifest item with the cover-image property, per the EPUB 3 spec, and then writes the provided image data to the provided href within the publication.

Parameters​
ParameterType
hrefstring
dataUint8Array
Returns​

Promise<void>

setDescription()​

setDescription(description): Promise<void>

Defined in: libraries/epub/src/index.tsx:1795

Update the Epub's description metadata entry.

Updates the existing dc:description element if one exists. Otherwise creates a new element. Any non-ASCII symbols, &, <, >, ", ', and ```` will be encoded as HTML entities.

Parameters​
ParameterType
descriptionstring
Returns​

Promise<void>

setIdentifier()​

setIdentifier(identifier): Promise<void>

Defined in: libraries/epub/src/index.tsx:893

Set the dc:identifier metadata element with the provided string.

Updates the existing dc:identifier element if one exists. Otherwise creates a new element

Parameters​
ParameterType
identifierstring
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier

Deprecated​

Use setUniqueIdentifier instead.

setIdentifiers()​

setIdentifiers(identifiers): Promise<void>

Defined in: libraries/epub/src/index.tsx:1149

Replace the publication's dc:identifier entries.

This replaces ALL existing dc:identifier elements except the publication's unique identifier (the one referenced by the package element's unique-identifier attribute), which is always preserved and must not be included in the provided list. If included anyway, it is ignored. See setUniqueIdentifier to change it.

Identifiers are placed in the order they are provided.

dc:source entries are not touched, use setSources for those.

When an entry has an identifierType, it is written in the refining form (a meta with property="identifier-type", carrying the scheme attribute when provided). An entry with only a scheme is written using the legacy opf:scheme attribute.

Parameters​
ParameterType
identifiersEpubIdentifier[]
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier

setLanguage()​

setLanguage(locale): Promise<void>

Defined in: libraries/epub/src/index.tsx:1677

Update the Epub's language metadata entry.

Updates the existing dc:language element if one exists. Otherwise creates a new element

Parameters​
ParameterType
localeLocale
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dclanguage

setPackageVocabularyPrefix()​

setPackageVocabularyPrefix(prefix, uri): Promise<void>

Defined in: libraries/epub/src/index.tsx:1846

Set a custom vocabulary prefix on the root package element.

Parameters​
ParameterType
prefixstring
uristring
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-prefix-attr

setPageBreakSource()​

setPageBreakSource(value): Promise<void>

Defined in: libraries/epub/src/index.tsx:1116

Set the pageBreakSource property (EPUB 3.4, spec D.2.9), or remove it when passed null. Replaces an existing pageBreakSource meta if present.

Pass none to indicate the pagination is unique to this publication.

Parameters​
ParameterType
valuestring | null
Returns​

Promise<void>

https://www.w3.org/TR/epub/#pageBreakSource

setPublicationDate()​

setPublicationDate(date): Promise<void>

Defined in: libraries/epub/src/index.tsx:1440

Set the dc:date metadata element with the provided date.

Updates the existing dc:date element if one exists. Otherwise creates a new element

Parameters​
ParameterType
dateDate
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dcdate

setSources()​

setSources(sources): Promise<void>

Defined in: libraries/epub/src/index.tsx:1254

Replace the publication's dc:source entries.

This replaces ALL existing dc:source elements (and their refining identifier-type / source-of metas). dc:identifier entries are not touched; use setIdentifiers for those. Pass an empty array to remove all sources.

When an entry has an identifierType, it is written in the refining form. A sourceOf value is written as a refining source-of meta (spec D.3.11). An entry with only a scheme uses the legacy opf:scheme attribute.

Parameters​
ParameterType
sourcesEpubSource[]
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dcsource

setTitle()​

setTitle(title): Promise<void>

Defined in: libraries/epub/src/index.tsx:1882

Set the title of the Epub.

This will replace all existing dc:title elements with this title. It will be given title-type "main".

To set specific titles and their types, use epub.setTitles().

Parameters​
ParameterType
titlestring
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dctitle

setTitles()​

setTitles(entries): Promise<void>

Defined in: libraries/epub/src/index.tsx:1904

Parameters​
ParameterType
entriesobject[]
Returns​

Promise<void>

setType()​

setType(type): Promise<void>

Defined in: libraries/epub/src/index.tsx:1509

Set the dc:type metadata element.

Updates the existing dc:type element if one exists. Otherwise creates a new element.

Parameters​
ParameterType
typestring
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dctype

setUniqueIdentifier()​

setUniqueIdentifier(identifier): Promise<void>

Defined in: libraries/epub/src/index.tsx:934

Set the unique identifier id for the EPUB.

Updates the existing dc:identifier element referenced by the unique identifier id if one exists. Otherwise creates a new element with the provided identifier, and sets the unique identifier id to the new element's id.

Note: you likely shouldn't change the unique identifier id unless you are producing a new EPUB.

Parameters​
ParameterType
identifierstring
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier

updateManifestItem()​

updateManifestItem(id, newItem): Promise<void>

Defined in: libraries/epub/src/index.tsx:3059

Update the manifest entry for an existing item.

To update the contents of an entry, use epub.writeItemContents() or epub.writeXhtmlItemContents()

Parameters​
ParameterType
idstring
newItemOmit<ManifestItem, "id">
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-pkg-manifest

withPackage()​

withPackage(producer): Promise<void>

Defined in: libraries/epub/src/index.tsx:655

Safely modify the package document, without race conditions.

Since the reading the package document is an async process, multiple simultaneously dispatched function calls that all attempt to modify it can clobber each other's changes. This method uses a read/write lock to ensure that each update runs exclusively.

Parameters​
ParameterTypeDescription
producer(packageElement) => void | (packageElement) => Element | (packageElement) => Promise<Element> | (packageElement) => Promise<void>The function to update the package document. If it returns a new package document, that will be persisted, otherwise it will be assumed that the package document was modified in place.
Returns​

Promise<void>

writeItemContents()​

Call Signature​

writeItemContents(id, contents): Promise<void>

Defined in: libraries/epub/src/index.tsx:2874

Write new contents for an existing manifest item, specified by its id.

The id must reference an existing manifest item. If creating a new item, use epub.addManifestItem() instead.

Parameters​
ParameterTypeDescription
idstringThe id of the manifest item to write new contents for
contentsUint8ArrayThe new contents. May be either a utf-8 encoded string or a byte array, as determined by the encoding
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-contentdocs

Call Signature​

writeItemContents(id, contents, encoding): Promise<void>

Defined in: libraries/epub/src/index.tsx:2875

Write new contents for an existing manifest item, specified by its id.

The id must reference an existing manifest item. If creating a new item, use epub.addManifestItem() instead.

Parameters​
ParameterTypeDescription
idstringThe id of the manifest item to write new contents for
contentsstringThe new contents. May be either a utf-8 encoded string or a byte array, as determined by the encoding
encoding"utf-8"Optional - must be the string "utf-8". If provided, the contents will be interpreted as a unicode string. Otherwise, the contents must be a byte array.
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-contentdocs

writeXhtmlItemContents()​

writeXhtmlItemContents(id, contents): Promise<void>

Defined in: libraries/epub/src/index.tsx:2914

Write new contents for an existing XHTML item, specified by its id.

The id must reference an existing manifest item. If creating a new item, use epub.addManifestItem() instead.

Parameters​
ParameterTypeDescription
idstringThe id of the manifest item to write new contents for
contentsDocumentThe new contents. Must be a parsed XML tree.
Returns​

Promise<void>

https://www.w3.org/TR/epub-33/#sec-xhtml

assertEpub3()​

static assertEpub3(epub): Promise<void>

Defined in: libraries/epub/src/index.tsx:502

Parameters​
ParameterType
epubEpub
Returns​

Promise<void>

create()​

static create(path, dublinCore, additionalMetadata): Promise<Epub>

Defined in: libraries/epub/src/index.tsx:450

Construct a new EPUB on a writable backend, optionally seeded with the provided metadata. Equivalent to Epub.using(TmpFsAdapter).create(...).

Parameters​
ParameterTypeDefault valueDescription
pathstringundefined-
dublinCoreDublinCoreundefinedCore metadata terms
additionalMetadataEpubMetadata[]An array of additional metadata entries
Returns​

Promise<Epub>

formatSmilDuration()​

static formatSmilDuration(duration): string

Defined in: libraries/epub/src/index.tsx:381

Format a duration, provided as a number of seconds, as a SMIL clock value, to be used for Media Overlays.

Parameters​
ParameterType
durationnumber
Returns​

string

https://www.w3.org/TR/epub-33/#sec-duration

from()​

Call Signature​

static from(pathOrData): Promise<Epub>

Defined in: libraries/epub/src/index.tsx:486

Open an existing EPUB publication, extracting it to a temp directory so writes can mutate the unpacked tree and rezip with saveAndClose.

Pass { readonly: true } to gate mutations at runtime.

prefer Epub.using(TmpFsAdapter).from(path) (or Epub.using(MemoryAdapter).from(path) for read-only, in-memory access)

Parameters​
ParameterType
pathOrDataArchiveSource
Returns​

Promise<Epub>

Throws​

when the archive is not a valid EPUB 3

Call Signature​

static from(pathOrData, options): Promise<EpubReader>

Defined in: libraries/epub/src/index.tsx:487

Open an existing EPUB publication, extracting it to a temp directory so writes can mutate the unpacked tree and rezip with saveAndClose.

Pass { readonly: true } to gate mutations at runtime.

prefer Epub.using(TmpFsAdapter).from(path) (or Epub.using(MemoryAdapter).from(path) for read-only, in-memory access)

Parameters​
ParameterType
pathOrDataArchiveSource
optionsFromOptions & object
Returns​

Promise<EpubReader>

Throws​

when the archive is not a valid EPUB 3

Call Signature​

static from(pathOrData, options?): Promise<Epub | EpubReader>

Defined in: libraries/epub/src/index.tsx:491

Open an existing EPUB publication, extracting it to a temp directory so writes can mutate the unpacked tree and rezip with saveAndClose.

Pass { readonly: true } to gate mutations at runtime.

prefer Epub.using(TmpFsAdapter).from(path) (or Epub.using(MemoryAdapter).from(path) for read-only, in-memory access)

Parameters​
ParameterType
pathOrDataArchiveSource
options?FromOptions
Returns​

Promise<Epub | EpubReader>

Throws​

when the archive is not a valid EPUB 3

upgrade()​

static upgrade(path, options): Promise<Epub>

Defined in: libraries/epub/src/index.tsx:3366

Upgrade an EPUB 2 publication to EPUB 3 in place, returning a new, valid Epub 3 instance. Equivalent to Epub.using(TmpFsAdapter).upgrade(...).

Parameters​
ParameterType
pathstring
optionsEpub2UpgradeOptions
Returns​

Promise<Epub>

using()​

static using<A>(adapterClass): EpubFactory<A>

Defined in: libraries/epub/src/index.tsx:470

Specify the storage backend to use for the EPUB

The returned factory exposes from, create, and upgrade, which route through the supplied adapter.

Type Parameters​
Type Parameter
A extends EpubStorageAdapterClass<object>
Parameters​
ParameterType
adapterClassA
Returns​

EpubFactory<A>

Example​
using epub = await Epub.using(TmpFsAdapter).from(path);
using reader = await Epub.using(MemoryAdapter).from(buffer, { cache: false });

EpubFactory<A>​

Defined in: libraries/epub/src/index.tsx:3395

Adapter-bound factory returned by Epub.using.

Mirrors the static factory surface (from, create, upgrade) but routes all I/O through the supplied adapter. Each method's signature degrades gracefully when the adapter doesn't support the operation: create and upgrade throw at runtime if the adapter is read-only or lacks initEmpty.

Type Parameters​

Type Parameter
A extends EpubStorageAdapterClass

Constructors​

Constructor​

new EpubFactory<A>(adapterClass): EpubFactory<A>

Defined in: libraries/epub/src/index.tsx:3396

Parameters​
ParameterType
adapterClassA
Returns​

EpubFactory<A>

Properties​

adapterClass​

readonly adapterClass: A

Defined in: libraries/epub/src/index.tsx:3396

Methods​

create()​

create(path, __namedParameters, additionalMetadata): Promise<EpubInstanceFor<A>>

Defined in: libraries/epub/src/index.tsx:3476

Construct a new EPUB on this factory's adapter, optionally seeded with the provided metadata. Requires a writable adapter that implements initEmpty (today: TmpFsAdapter).

Parameters​
ParameterTypeDefault value
pathstringundefined
__namedParametersDublinCoreundefined
additionalMetadataEpubMetadata[]
Returns​

Promise<EpubInstanceFor<A>>

Throws​

when the adapter is read-only or does not implement initEmpty

from()​

Call Signature​

from(source, options): Promise<Pick<Epub, "storage" | "getItemArchiveLength" | "getRootfile" | "getPackageDocumentSource" | "getPackageElement" | "getManifest" | "findMetadataItem" | "findAllMetadataItems" | "getMetadata" | "getIdentifier" | "getUniqueIdentifier" | "getUniqueIdentifierId" | "getIdentifiers" | "getSources" | "getPageBreakSource" | "getCoverImageItem" | "getCoverImage" | "getPublicationDate" | "getModifiedDate" | "getLayout" | "getBaseDirection" | "getType" | "getSubjects" | "getLanguage" | "getTitle" | "getSubtitle" | "getTitles" | "getDescription" | "getPackageVocabularyPrefixes" | "getCollections" | "getCreators" | "getContributors" | "getSpineItems" | "getTableOfContents" | "getLandmarks" | "getPageList" | "resolveHref" | "readFileContents" | "readItemContents" | "readXhtmlItemContents" | "getVersion" | "getNcxTableOfContents" | "getGuideEntries" | "discardAndClose"> & Disposable & object>

Defined in: libraries/epub/src/index.tsx:3403

Open an existing EPUB through this factory's adapter

Parameters​
ParameterType
sourceArchiveSource
optionsFromOptions & object & AdapterOptions<A>
Returns​

Promise<Pick<Epub, "storage" | "getItemArchiveLength" | "getRootfile" | "getPackageDocumentSource" | "getPackageElement" | "getManifest" | "findMetadataItem" | "findAllMetadataItems" | "getMetadata" | "getIdentifier" | "getUniqueIdentifier" | "getUniqueIdentifierId" | "getIdentifiers" | "getSources" | "getPageBreakSource" | "getCoverImageItem" | "getCoverImage" | "getPublicationDate" | "getModifiedDate" | "getLayout" | "getBaseDirection" | "getType" | "getSubjects" | "getLanguage" | "getTitle" | "getSubtitle" | "getTitles" | "getDescription" | "getPackageVocabularyPrefixes" | "getCollections" | "getCreators" | "getContributors" | "getSpineItems" | "getTableOfContents" | "getLandmarks" | "getPageList" | "resolveHref" | "readFileContents" | "readItemContents" | "readXhtmlItemContents" | "getVersion" | "getNcxTableOfContents" | "getGuideEntries" | "discardAndClose"> & Disposable & object>

Throws​

when the archive is not a valid EPUB 3

Call Signature​

from(source, options?): Promise<EpubInstanceFor<A> & object>

Defined in: libraries/epub/src/index.tsx:3407

Open an existing EPUB through this factory's adapter

Parameters​
ParameterType
sourceArchiveSource
options?FromOptions & AdapterOptions<A>
Returns​

Promise<EpubInstanceFor<A> & object>

Throws​

when the archive is not a valid EPUB 3

readPackageDocumentSource()​

readPackageDocumentSource(source, options): Promise<string>

Defined in: libraries/epub/src/index.tsx:3450

Parameters​
ParameterType
sourceArchiveSource
optionsAdapterOptions<A>
Returns​

Promise<string>

upgrade()​

upgrade(path, options): Promise<EpubInstanceFor<A>>

Defined in: libraries/epub/src/index.tsx:3603

Upgrade an EPUB 2 publication to EPUB 3 in place using this factory's adapter, returning a new, valid Epub 3 instance.

Performs the following transformations:

  • upgrades OPF metadata to EPUB 3 conventions
  • scans XHTML documents and adds manifest item properties
  • parses the NCX into a TOC tree and generates a nav.xhtml
  • removes the NCX file and the guide element (configurable)
  • fixes common font MIME types
  • bumps the package version to 3.0
  • goes over each xhtml item and rewrites it using XMLParser to make sure the output is valid XHTML

Requires a writable adapter. When Upgrade.Epub2UpgradeOptions.outputPath is set, the source file is copied to that path on disk first; this only makes sense for adapters whose source is a real fs path.

Parameters​
ParameterType
pathstring
optionsEpub2UpgradeOptions
Returns​

Promise<EpubInstanceFor<A>>

Throws​

when the adapter is read-only


EpubReadOnlyError​

Defined in: libraries/epub/src/index.tsx:255

Extends​

  • Error

Constructors​

Constructor​

new EpubReadOnlyError(message?): EpubReadOnlyError

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080

Parameters​
ParameterType
message?string
Returns​

EpubReadOnlyError

Inherited from​

Error.constructor

Constructor​

new EpubReadOnlyError(message?, options?): EpubReadOnlyError

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080

Parameters​
ParameterType
message?string
options?ErrorOptions
Returns​

EpubReadOnlyError

Inherited from​

Error.constructor

Properties​

cause?​

optional cause: unknown

Defined in: node_modules/@typescript/old/lib/lib.es2022.error.d.ts:24

Inherited from​

Error.cause

message​

message: string

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1075

Inherited from​

Error.message

name​

name: string

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1074

Inherited from​

Error.name

stack?​

optional stack: string

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1076

Inherited from​

Error.stack

stackTraceLimit​

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from​

Error.stackTraceLimit

Methods​

captureStackTrace()​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
Parameters​
ParameterType
targetObjectobject
constructorOpt?Function
Returns​

void

Inherited from​

Error.captureStackTrace

isError()​

static isError(error): error is Error

Defined in: node_modules/@typescript/old/lib/lib.esnext.error.d.ts:21

Indicates whether the argument provided is a built-in Error instance or not.

Parameters​
ParameterType
errorunknown
Returns​

error is Error

Inherited from​

Error.isError

prepareStackTrace()​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters​
ParameterType
errError
stackTracesCallSite[]
Returns​

any

See​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from​

Error.prepareStackTrace


EpubVersionError​

Defined in: libraries/epub/src/index.tsx:254

Extends​

  • Error

Constructors​

Constructor​

new EpubVersionError(message?): EpubVersionError

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080

Parameters​
ParameterType
message?string
Returns​

EpubVersionError

Inherited from​

Error.constructor

Constructor​

new EpubVersionError(message?, options?): EpubVersionError

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080

Parameters​
ParameterType
message?string
options?ErrorOptions
Returns​

EpubVersionError

Inherited from​

Error.constructor

Properties​

cause?​

optional cause: unknown

Defined in: node_modules/@typescript/old/lib/lib.es2022.error.d.ts:24

Inherited from​

Error.cause

message​

message: string

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1075

Inherited from​

Error.message

name​

name: string

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1074

Inherited from​

Error.name

stack?​

optional stack: string

Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1076

Inherited from​

Error.stack

stackTraceLimit​

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from​

Error.stackTraceLimit

Methods​

captureStackTrace()​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
Parameters​
ParameterType
targetObjectobject
constructorOpt?Function
Returns​

void

Inherited from​

Error.captureStackTrace

isError()​

static isError(error): error is Error

Defined in: node_modules/@typescript/old/lib/lib.esnext.error.d.ts:21

Indicates whether the argument provided is a built-in Error instance or not.

Parameters​
ParameterType
errorunknown
Returns​

error is Error

Inherited from​

Error.isError

prepareStackTrace()​

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters​
ParameterType
errError
stackTracesCallSite[]
Returns​

any

See​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from​

Error.prepareStackTrace


MemoryAdapter​

Defined in: libraries/epub/src/adapters/memory.ts:30

Loads an EPUB archive into memory and serves all I/O off the in-memory zip handle.

read only

Implements​

Properties​

capabilities​

readonly static capabilities: object

Defined in: libraries/epub/src/adapters/memory.ts:32

writable​

readonly writable: false = false

kind​

readonly static kind: "in-memory"

Defined in: libraries/epub/src/adapters/memory.ts:31

Methods​

archiveLength()​

archiveLength(entry): Promise<number>

Defined in: libraries/epub/src/adapters/memory.ts:85

Length of an entry in bytes, for the readium page-count heuristic which expects compressed size when available

Parameters​
ParameterType
entrystring
Returns​

Promise<number>

Implementation of​

EpubStorageAdapter.archiveLength

dispose()​

dispose(): void

Defined in: libraries/epub/src/adapters/memory.ts:91

Always called on close or error

Returns​

void

Implementation of​

EpubStorageAdapter.dispose

exists()​

exists(entry): Promise<boolean>

Defined in: libraries/epub/src/adapters/memory.ts:80

Whether the archive holds an entry under exactly this name. Used to choose between different canditates for an href so should be exact

Parameters​
ParameterType
entrystring
Returns​

Promise<boolean>

Implementation of​

EpubStorageAdapter.exists

read()​

Call Signature​

read(entry): Promise<Uint8Array<ArrayBufferLike>>

Defined in: libraries/epub/src/adapters/memory.ts:60

Parameters​
ParameterType
entrystring
Returns​

Promise<Uint8Array<ArrayBufferLike>>

Implementation of​

EpubStorageAdapter.read

Call Signature​

read(entry, encoding): Promise<string>

Defined in: libraries/epub/src/adapters/memory.ts:61

Parameters​
ParameterType
entrystring
encoding"utf-8"
Returns​

Promise<string>

Implementation of​

EpubStorageAdapter.read

init()​

static init(source, opts): Promise<MemoryAdapter>

Defined in: libraries/epub/src/adapters/memory.ts:34

Parameters​
ParameterType
sourceArchiveSource
optsMemoryAdapterOptions
Returns​

Promise<MemoryAdapter>


TmpFsAdapter​

Defined in: libraries/epub/src/adapters/tmpfs.ts:57

Extracts an EPUB archive to a temp directory and serves all I/O off the real filesystem. Epub.using(TmpFsAdapter).from(...) returns a writable Epub.

Implements​

Properties​

capabilities​

readonly static capabilities: object

Defined in: libraries/epub/src/adapters/tmpfs.ts:59

writable​

readonly writable: true = true

kind​

readonly static kind: "extracted-dir"

Defined in: libraries/epub/src/adapters/tmpfs.ts:58

Methods​

archiveLength()​

archiveLength(entry): Promise<number>

Defined in: libraries/epub/src/adapters/tmpfs.ts:127

Length of an entry in bytes, for the readium page-count heuristic which expects compressed size when available

Parameters​
ParameterType
entrystring
Returns​

Promise<number>

Implementation of​

EpubStorageAdapter.archiveLength

dispose()​

dispose(): void

Defined in: libraries/epub/src/adapters/tmpfs.ts:204

Always called on close or error

Returns​

void

Implementation of​

EpubStorageAdapter.dispose

duplicate()​

duplicate(): Promise<TmpFsAdapter>

Defined in: libraries/epub/src/adapters/tmpfs.ts:154

Required for Epub.copy

Returns​

Promise<TmpFsAdapter>

Implementation of​

EpubStorageAdapter.duplicate

exists()​

exists(entry): Promise<boolean>

Defined in: libraries/epub/src/adapters/tmpfs.ts:118

Whether the archive holds an entry under exactly this name. Used to choose between different canditates for an href so should be exact

Parameters​
ParameterType
entrystring
Returns​

Promise<boolean>

Implementation of​

EpubStorageAdapter.exists

list()​

list(): AsyncIterable<EpubListEntry>

Defined in: libraries/epub/src/adapters/tmpfs.ts:136

Required for Epub.saveAndClose to walk the contents

Returns​

AsyncIterable<EpubListEntry>

Implementation of​

EpubStorageAdapter.list

read()​

Call Signature​

read(entry): Promise<Uint8Array<ArrayBufferLike>>

Defined in: libraries/epub/src/adapters/tmpfs.ts:96

Parameters​
ParameterType
entrystring
Returns​

Promise<Uint8Array<ArrayBufferLike>>

Implementation of​

EpubStorageAdapter.read

Call Signature​

read(entry, encoding): Promise<string>

Defined in: libraries/epub/src/adapters/tmpfs.ts:97

Parameters​
ParameterType
entrystring
encoding"utf-8"
Returns​

Promise<string>

Implementation of​

EpubStorageAdapter.read

remove()​

remove(entry): Promise<void>

Defined in: libraries/epub/src/adapters/tmpfs.ts:114

Required for removeManifestItem / setCoverImage replacement

Parameters​
ParameterType
entrystring
Returns​

Promise<void>

Implementation of​

EpubStorageAdapter.remove

serialize()​

serialize(targetPath): Promise<void>

Defined in: libraries/epub/src/adapters/tmpfs.ts:165

Required for Epub.saveAndClose

Parameters​
ParameterType
targetPathstring
Returns​

Promise<void>

Implementation of​

EpubStorageAdapter.serialize

write()​

Call Signature​

write(entry, data): Promise<void>

Defined in: libraries/epub/src/adapters/tmpfs.ts:102

Required for any mutation method on Epub

Parameters​
ParameterType
entrystring
dataUint8Array
Returns​

Promise<void>

Implementation of​

EpubStorageAdapter.write

Call Signature​

write(entry, data, encoding): Promise<void>

Defined in: libraries/epub/src/adapters/tmpfs.ts:103

Parameters​
ParameterType
entrystring
datastring
encoding"utf-8"
Returns​

Promise<void>

Implementation of​

EpubStorageAdapter.write

init()​

static init(source): Promise<TmpFsAdapter>

Defined in: libraries/epub/src/adapters/tmpfs.ts:61

Parameters​
ParameterType
sourceArchiveSource
Returns​

Promise<TmpFsAdapter>

initEmpty()​

static initEmpty(): Promise<TmpFsAdapter>

Defined in: libraries/epub/src/adapters/tmpfs.ts:79

Returns​

Promise<TmpFsAdapter>


AlternateScript​

Defined in: libraries/epub/src/index.tsx:171

Properties​

locale​

locale: Locale

Defined in: libraries/epub/src/index.tsx:173

name​

name: string

Defined in: libraries/epub/src/index.tsx:172


Attr​

Defined in: node_modules/@xmldom/xmldom/index.d.ts:664

A DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types.

MDN Reference

Extends​

Properties​

ATTRIBUTE_NODE​

readonly ATTRIBUTE_NODE: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:592

Inherited from​

Node.ATTRIBUTE_NODE

baseURI​

readonly baseURI: "about:blank"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:396

Always returns about:blank currently.

MDN Reference

Inherited from​

Node.baseURI

CDATA_SECTION_NODE​

readonly CDATA_SECTION_NODE: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:596

node is a CDATASection node.

Inherited from​

Node.CDATA_SECTION_NODE

childNodes​

readonly childNodes: NodeList

Defined in: node_modules/@xmldom/xmldom/index.d.ts:374

Returns the children.

MDN Reference

Inherited from​

Node.childNodes

columnNumber?​

optional columnNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:479

One based column position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.columnNumber

COMMENT_NODE​

readonly COMMENT_NODE: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:602

node is a Comment node.

Inherited from​

Node.COMMENT_NODE

DOCUMENT_FRAGMENT_NODE​

readonly DOCUMENT_FRAGMENT_NODE: 11

Defined in: node_modules/@xmldom/xmldom/index.d.ts:608

node is a DocumentFragment node.

Inherited from​

Node.DOCUMENT_FRAGMENT_NODE

DOCUMENT_NODE​

readonly DOCUMENT_NODE: 9

Defined in: node_modules/@xmldom/xmldom/index.d.ts:604

node is a document.

Inherited from​

Node.DOCUMENT_NODE

DOCUMENT_POSITION_CONTAINED_BY​

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Defined in: node_modules/@xmldom/xmldom/index.d.ts:619

Set when other is a descendant of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINS​

readonly DOCUMENT_POSITION_CONTAINS: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:617

Set when other is an ancestor of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_DISCONNECTED​

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:611

Set when node and other are not in the same tree.

Inherited from​

Node.DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_FOLLOWING​

readonly DOCUMENT_POSITION_FOLLOWING: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:615

Set when other is following node.

Inherited from​

Node.DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC​

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

Defined in: node_modules/@xmldom/xmldom/index.d.ts:620

Inherited from​

Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_PRECEDING​

readonly DOCUMENT_POSITION_PRECEDING: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:613

Set when other is preceding node.

Inherited from​

Node.DOCUMENT_POSITION_PRECEDING

DOCUMENT_TYPE_NODE​

readonly DOCUMENT_TYPE_NODE: 10

Defined in: node_modules/@xmldom/xmldom/index.d.ts:606

node is a doctype.

Inherited from​

Node.DOCUMENT_TYPE_NODE

ELEMENT_NODE​

readonly ELEMENT_NODE: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:591

node is an element.

Inherited from​

Node.ELEMENT_NODE

ENTITY_NODE​

readonly ENTITY_NODE: 6

Defined in: node_modules/@xmldom/xmldom/index.d.ts:598

Inherited from​

Node.ENTITY_NODE

ENTITY_REFERENCE_NODE​

readonly ENTITY_REFERENCE_NODE: 5

Defined in: node_modules/@xmldom/xmldom/index.d.ts:597

Inherited from​

Node.ENTITY_REFERENCE_NODE

firstChild​

readonly firstChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:380

Returns the first child.

MDN Reference

Inherited from​

Node.firstChild

isConnected​

readonly isConnected: boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:402

Returns true if this node is inside of a document or is the document node itself.

MDN Reference

Inherited from​

Node.isConnected

lastChild​

readonly lastChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:386

Returns the last child.

MDN Reference

Inherited from​

Node.lastChild

lineNumber?​

optional lineNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:474

Zero based line position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.lineNumber

localName​

localName: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:390

The local part of the qualified name of this node.

Inherited from​

Node.localName

name​

readonly name: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:667

MDN Reference

namespaceURI​

readonly namespaceURI: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:669

MDN Reference

Overrides​

Node.namespaceURI

nextSibling​

readonly nextSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:412

Returns the next sibling.

MDN Reference

Inherited from​

Node.nextSibling

nodeName​

readonly nodeName: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:418

Returns a string appropriate for the type of node.

MDN Reference

Inherited from​

Node.nodeName

nodeType​

readonly nodeType: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:665

Returns the type of node.

MDN Reference

Overrides​

Node.nodeType

nodeValue​

nodeValue: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:426

MDN Reference

Inherited from​

Node.nodeValue

NOTATION_NODE​

readonly NOTATION_NODE: 12

Defined in: node_modules/@xmldom/xmldom/index.d.ts:609

Inherited from​

Node.NOTATION_NODE

ownerDocument​

readonly ownerDocument: Document

Defined in: node_modules/@xmldom/xmldom/index.d.ts:670

Returns the node document. Returns null for documents.

MDN Reference

Overrides​

Node.ownerDocument

ownerElement​

readonly ownerElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:672

MDN Reference

parentElement​

readonly parentElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:444

Returns the parent Node if it is of type Element, otherwise null.

MDN Reference

Inherited from​

Node.parentElement

parentNode​

readonly parentNode: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:438

Returns the parent.

MDN Reference

Inherited from​

Node.parentNode

prefix​

readonly prefix: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:674

MDN Reference

Overrides​

Node.prefix

previousSibling​

readonly previousSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:454

Returns the previous sibling.

MDN Reference

Inherited from​

Node.previousSibling

PROCESSING_INSTRUCTION_NODE​

readonly PROCESSING_INSTRUCTION_NODE: 7

Defined in: node_modules/@xmldom/xmldom/index.d.ts:600

node is a ProcessingInstruction node.

Inherited from​

Node.PROCESSING_INSTRUCTION_NODE

specified​

readonly specified: true

Defined in: node_modules/@xmldom/xmldom/index.d.ts:679

Deprecated​

MDN Reference

TEXT_NODE​

readonly TEXT_NODE: 3

Defined in: node_modules/@xmldom/xmldom/index.d.ts:594

node is a Text node.

Inherited from​

Node.TEXT_NODE

textContent​

textContent: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:468

The text content of this node and its descendants.

For Element and DocumentFragment nodes, returns the concatenation of the nodeValue of every descendant text node, excluding processing instruction and comment nodes. For all other node types, returns nodeValue.

Setting textContent on an element or document fragment replaces all child nodes with a single text node; on other nodes it sets data, value, and nodeValue directly. MDN Reference

See​

https://dom.spec.whatwg.org/#dom-node-textcontent

Inherited from​

Node.textContent

value​

value: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:681

MDN Reference

Methods​

appendChild()​

appendChild(node): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:482

MDN Reference

Parameters​
ParameterType
nodeNode
Returns​

Node

Inherited from​

Node.appendChild

cloneNode()​

cloneNode(deep?): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:533

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

Parameters​
ParameterType
deep?boolean
Returns​

Node

Throws​

May throw a DOMException if operations within Element#setAttributeNode or Node#appendChild (which are potentially invoked in this method) do not meet their specific constraints.

MDN Reference

Inherited from​

Node.cloneNode

compareDocumentPosition()​

compareDocumentPosition(other): number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:540

Returns a bitmask indicating the position of other relative to node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

number

Inherited from​

Node.compareDocumentPosition

contains()​

contains(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:489

Checks whether other is an inclusive descendant of this node.

MDN Reference

Parameters​
ParameterType
otherNode | null | undefined
Returns​

boolean

Inherited from​

Node.contains

getRootNode()​

getRootNode(options): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:502

Searches for the root node of this node.

This behavior is slightly different from the one in the specs:

  • ignores options.composed, since ShadowRoots are unsupported, therefore always returning root.

MDN Reference

Parameters​
ParameterType
optionsGetRootNodeOptions
Returns​

Node

See​
Inherited from​

Node.getRootNode

hasChildNodes()​

hasChildNodes(): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:547

Returns whether node has children.

MDN Reference

Returns​

boolean

Inherited from​

Node.hasChildNodes

insertBefore()​

insertBefore(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:550

MDN Reference

Parameters​
ParameterType
nodeNode
childNode | null
Returns​

Node

Inherited from​

Node.insertBefore

isDefaultNamespace()​

isDefaultNamespace(namespace): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:553

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

boolean

Inherited from​

Node.isDefaultNamespace

isEqualNode()​

isEqualNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:514

Checks whether the given node is equal to this node.

Two nodes are equal when they have the same type, defining characteristics (for the type), and the same childNodes. The comparison is iterative to avoid stack overflows on deeply nested trees. Attribute nodes of each Element pair are also compared iteratively.

Parameters​
ParameterType
otherNode
Returns​

boolean

See​
Inherited from​

Node.isEqualNode

isSameNode()​

isSameNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:521

Checks whether the given node is this node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

boolean

Inherited from​

Node.isSameNode

isSupported()​

isSupported(feature, version): true

Defined in: node_modules/@xmldom/xmldom/index.d.ts:568

Checks whether the DOM implementation implements a specific feature and its version.

Parameters​
ParameterTypeDescription
featurestringThe package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation.
versionstringThis is the version number of the package name to test.
Returns​

true

Deprecated​

Since DOMImplementation.hasFeature is deprecated and always returns true.

Since​

Introduced in DOM Level 2

See​

DOMImplementation.hasFeature

Inherited from​

Node.isSupported

lookupNamespaceURI()​

lookupNamespaceURI(prefix): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:571

MDN Reference

Parameters​
ParameterType
prefixstring | null
Returns​

string | null

Inherited from​

Node.lookupNamespaceURI

lookupPrefix()​

lookupPrefix(namespace): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:574

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

string | null

Inherited from​

Node.lookupPrefix

normalize()​

normalize(): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:582

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

MDN Reference

Returns​

void

Inherited from​

Node.normalize

removeChild()​

removeChild(child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:585

MDN Reference

Parameters​
ParameterType
childNode
Returns​

Node

Inherited from​

Node.removeChild

replaceChild()​

replaceChild(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:588

MDN Reference

Parameters​
ParameterType
nodeNode
childNode
Returns​

Node

Inherited from​

Node.replaceChild


Collection​

Defined in: libraries/epub/src/index.tsx:195

Properties​

name​

name: string

Defined in: libraries/epub/src/index.tsx:196

position?​

optional position: string

Defined in: libraries/epub/src/index.tsx:198

type?​

optional type: string

Defined in: libraries/epub/src/index.tsx:197


DcCreator​

Defined in: libraries/epub/src/index.tsx:176

Properties​

alternateScripts?​

optional alternateScripts: AlternateScript[]

Defined in: libraries/epub/src/index.tsx:181

fileAs?​

optional fileAs: string

Defined in: libraries/epub/src/index.tsx:180

name​

name: string

Defined in: libraries/epub/src/index.tsx:177

role?​

optional role: string

Defined in: libraries/epub/src/index.tsx:178

roleScheme?​

optional roleScheme: string

Defined in: libraries/epub/src/index.tsx:179


DcSubject​

Defined in: libraries/epub/src/index.tsx:138

Properties​

authority​

authority: string

Defined in: libraries/epub/src/index.tsx:140

term​

term: string

Defined in: libraries/epub/src/index.tsx:141

value​

value: string

Defined in: libraries/epub/src/index.tsx:139


Document​

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1188

Extends​

Properties​

ATTRIBUTE_NODE​

readonly ATTRIBUTE_NODE: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:592

Inherited from​

Node.ATTRIBUTE_NODE

baseURI​

readonly baseURI: "about:blank"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:396

Always returns about:blank currently.

MDN Reference

Inherited from​

Node.baseURI

CDATA_SECTION_NODE​

readonly CDATA_SECTION_NODE: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:596

node is a CDATASection node.

Inherited from​

Node.CDATA_SECTION_NODE

childNodes​

readonly childNodes: NodeList

Defined in: node_modules/@xmldom/xmldom/index.d.ts:374

Returns the children.

MDN Reference

Inherited from​

Node.childNodes

children​

readonly children: LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1226

Returns a live collection of the direct child elements of this document.

MDN Reference

See​

https://dom.spec.whatwg.org/#dom-parentnode-children

columnNumber?​

optional columnNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:479

One based column position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.columnNumber

COMMENT_NODE​

readonly COMMENT_NODE: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:602

node is a Comment node.

Inherited from​

Node.COMMENT_NODE

contentType​

readonly contentType: MIME_TYPE

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1196

The mime type of the document is determined at creation time and can not be modified.

See​

doctype​

readonly doctype: DocumentType | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1211

DOCUMENT_FRAGMENT_NODE​

readonly DOCUMENT_FRAGMENT_NODE: 11

Defined in: node_modules/@xmldom/xmldom/index.d.ts:608

node is a DocumentFragment node.

Inherited from​

Node.DOCUMENT_FRAGMENT_NODE

DOCUMENT_NODE​

readonly DOCUMENT_NODE: 9

Defined in: node_modules/@xmldom/xmldom/index.d.ts:604

node is a document.

Inherited from​

Node.DOCUMENT_NODE

DOCUMENT_POSITION_CONTAINED_BY​

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Defined in: node_modules/@xmldom/xmldom/index.d.ts:619

Set when other is a descendant of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINS​

readonly DOCUMENT_POSITION_CONTAINS: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:617

Set when other is an ancestor of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_DISCONNECTED​

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:611

Set when node and other are not in the same tree.

Inherited from​

Node.DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_FOLLOWING​

readonly DOCUMENT_POSITION_FOLLOWING: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:615

Set when other is following node.

Inherited from​

Node.DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC​

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

Defined in: node_modules/@xmldom/xmldom/index.d.ts:620

Inherited from​

Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_PRECEDING​

readonly DOCUMENT_POSITION_PRECEDING: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:613

Set when other is preceding node.

Inherited from​

Node.DOCUMENT_POSITION_PRECEDING

DOCUMENT_TYPE_NODE​

readonly DOCUMENT_TYPE_NODE: 10

Defined in: node_modules/@xmldom/xmldom/index.d.ts:606

node is a doctype.

Inherited from​

Node.DOCUMENT_TYPE_NODE

documentElement​

readonly documentElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1217

Gets a reference to the root node of the document.

MDN Reference

ELEMENT_NODE​

readonly ELEMENT_NODE: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:591

node is an element.

Inherited from​

Node.ELEMENT_NODE

ENTITY_NODE​

readonly ENTITY_NODE: 6

Defined in: node_modules/@xmldom/xmldom/index.d.ts:598

Inherited from​

Node.ENTITY_NODE

ENTITY_REFERENCE_NODE​

readonly ENTITY_REFERENCE_NODE: 5

Defined in: node_modules/@xmldom/xmldom/index.d.ts:597

Inherited from​

Node.ENTITY_REFERENCE_NODE

firstChild​

readonly firstChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:380

Returns the first child.

MDN Reference

Inherited from​

Node.firstChild

implementation​

readonly implementation: DOMImplementation

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1207

The implementation that created this document.

isConnected​

readonly isConnected: boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:402

Returns true if this node is inside of a document or is the document node itself.

MDN Reference

Inherited from​

Node.isConnected

lastChild​

readonly lastChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:386

Returns the last child.

MDN Reference

Inherited from​

Node.lastChild

lineNumber?​

optional lineNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:474

Zero based line position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.lineNumber

localName​

localName: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:390

The local part of the qualified name of this node.

Inherited from​

Node.localName

namespaceURI​

readonly namespaceURI: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:406

The namespace URI of this node.

Inherited from​

Node.namespaceURI

nextSibling​

readonly nextSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:412

Returns the next sibling.

MDN Reference

Inherited from​

Node.nextSibling

nodeName​

readonly nodeName: "#document"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1209

Returns a string appropriate for the type of node.

MDN Reference

Overrides​

Node.nodeName

nodeType​

readonly nodeType: 9

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1210

Returns the type of node.

MDN Reference

Overrides​

Node.nodeType

nodeValue​

nodeValue: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:426

MDN Reference

Inherited from​

Node.nodeValue

NOTATION_NODE​

readonly NOTATION_NODE: 12

Defined in: node_modules/@xmldom/xmldom/index.d.ts:609

Inherited from​

Node.NOTATION_NODE

ownerDocument​

readonly ownerDocument: Document

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1208

Returns the node document. Returns null for documents.

MDN Reference

Overrides​

Node.ownerDocument

parentElement​

readonly parentElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:444

Returns the parent Node if it is of type Element, otherwise null.

MDN Reference

Inherited from​

Node.parentElement

parentNode​

readonly parentNode: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:438

Returns the parent.

MDN Reference

Inherited from​

Node.parentNode

prefix​

prefix: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:448

The prefix of the namespace for this node.

Inherited from​

Node.prefix

previousSibling​

readonly previousSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:454

Returns the previous sibling.

MDN Reference

Inherited from​

Node.previousSibling

PROCESSING_INSTRUCTION_NODE​

readonly PROCESSING_INSTRUCTION_NODE: 7

Defined in: node_modules/@xmldom/xmldom/index.d.ts:600

node is a ProcessingInstruction node.

Inherited from​

Node.PROCESSING_INSTRUCTION_NODE

TEXT_NODE​

readonly TEXT_NODE: 3

Defined in: node_modules/@xmldom/xmldom/index.d.ts:594

node is a Text node.

Inherited from​

Node.TEXT_NODE

textContent​

textContent: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:468

The text content of this node and its descendants.

For Element and DocumentFragment nodes, returns the concatenation of the nodeValue of every descendant text node, excluding processing instruction and comment nodes. For all other node types, returns nodeValue.

Setting textContent on an element or document fragment replaces all child nodes with a single text node; on other nodes it sets data, value, and nodeValue directly. MDN Reference

See​

https://dom.spec.whatwg.org/#dom-node-textcontent

Inherited from​

Node.textContent

type​

readonly type: "xml" | "html"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1201

See​

Methods​

appendChild()​

appendChild(node): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:482

MDN Reference

Parameters​
ParameterType
nodeNode
Returns​

Node

Inherited from​

Node.appendChild

cloneNode()​

cloneNode(deep?): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:533

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

Parameters​
ParameterType
deep?boolean
Returns​

Node

Throws​

May throw a DOMException if operations within Element#setAttributeNode or Node#appendChild (which are potentially invoked in this method) do not meet their specific constraints.

MDN Reference

Inherited from​

Node.cloneNode

compareDocumentPosition()​

compareDocumentPosition(other): number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:540

Returns a bitmask indicating the position of other relative to node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

number

Inherited from​

Node.compareDocumentPosition

contains()​

contains(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:489

Checks whether other is an inclusive descendant of this node.

MDN Reference

Parameters​
ParameterType
otherNode | null | undefined
Returns​

boolean

Inherited from​

Node.contains

createAttribute()​

createAttribute(localName): Attr

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1233

Creates an attribute object with a specified name.

MDN Reference

Parameters​
ParameterType
localNamestring
Returns​

Attr

createAttributeNS()​

createAttributeNS(namespace, qualifiedName): Attr

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1236

MDN Reference

Parameters​
ParameterType
namespacestring | null
qualifiedNamestring
Returns​

Attr

createCDATASection()​

createCDATASection(data): CDATASection

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1249

Returns a new CDATASection node whose data is data.

This implementation differs from the specification: - calling this method on an HTML document does not throw NotSupportedError.

Parameters​
ParameterType
datastring
Returns​

CDATASection

Throws​

With code INVALID_CHARACTER_ERR if data contains "]]>".

See​

createComment()​

createComment(data): Comment

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1261

Creates a comment object with the specified data.

No validation is performed at creation time. When the resulting document is serialized with requireWellFormed: true, the serializer throws InvalidStateError if the comment data contains -- anywhere, ends with -, or contains characters outside the XML Char production (W3C DOM Parsing §3.2.1.3). Without that option the data is emitted verbatim.

MDN Reference

Parameters​
ParameterType
datastring
Returns​

Comment

createDocumentFragment()​

createDocumentFragment(): DocumentFragment

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1268

Creates a new document.

MDN Reference

Returns​

DocumentFragment

createElement()​

createElement(tagName): Element

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1270

Parameters​
ParameterType
tagNamestring
Returns​

Element

createElementNS()​

createElementNS(namespace, qualifiedName): Element

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1292

Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName.

If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown.

If one of the following conditions is true a "NamespaceError" DOMException will be thrown:

localName does not match the QName production. Namespace prefix is not null and namespace is the empty string. Namespace prefix is "xml" and namespace is not the XML namespace. qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns".

When supplied, options's is can be used to create a customized built-in element.

MDN Reference

Parameters​
ParameterType
namespacestring | null
qualifiedNamestring
Returns​

Element

createEntityReference()​

createEntityReference(name): EntityReference

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1319

Creates an EntityReference object. The current implementation does not fill the childNodes with those of the corresponding Entity

The name of the entity to reference. No namespace well-formedness checks are performed.

The name is validated against the XML Name production at creation time; an invalid name throws InvalidCharacterError. When the resulting node is serialized with requireWellFormed: true, the serializer re-validates nodeName against the XML Name production and throws InvalidStateError if a later nodeName mutation made it invalid; without that option the name is emitted verbatim.

This implementation differs from the specification: xmldom does not expand entities — the parser resolves entity references inline and never constructs EntityReference nodes, so this method is the only producer.

Parameters​
ParameterType
namestring
Returns​

EntityReference

Deprecated​

In DOM Level 4.

Throws​

With code INVALID_CHARACTER_ERR when name is not a valid XML Name.

Throws​

with code NOT_SUPPORTED_ERR when the document is of type html

See​

https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-392B75AE

createProcessingInstruction()​

createProcessingInstruction(target, data): ProcessingInstruction

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1338

Returns a ProcessingInstruction node whose target is target and data is data.

This behavior is slightly different from the in the specs:

  • it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".

Note: When the resulting document is serialized with requireWellFormed: true, the serializer throws InvalidStateError if .target is not a valid XML NCName (a Name with no colon) or is an ASCII case-insensitive match for "xml", or if .data contains ?> or characters outside the XML Char production (W3C DOM Parsing §3.2.1.7). Without that option the target and data are emitted verbatim.

Parameters​
ParameterType
targetstring
datastring
Returns​

ProcessingInstruction

See​

createTextNode()​

createTextNode(data): Text

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1351

Creates a text string from the specified value.

Parameters​
ParameterTypeDescription
datastringString that specifies the nodeValue property of the text node. MDN Reference
Returns​

Text

getElementById()​

getElementById(elementId): Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1356

Returns a reference to the first object with the specified value of the ID attribute.

Parameters​
ParameterType
elementIdstring
Returns​

Element | null

getElementsByClassName()​

getElementsByClassName(classNames): LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1373

Returns a LiveNodeList of all child elements which have all of the given class name(s).

Returns an empty list if classNames is an empty string or only contains HTML white space characters.

Warning: This returns a live LiveNodeList. Changes in the DOM will reflect in the array as the changes occur. If an element selected by this array no longer qualifies for the selector, it will automatically be removed. Be aware of this for iteration purposes.

Parameters​
ParameterType
classNamesstring
Returns​

LiveNodeList<Element>

See​

getElementsByTagName()​

getElementsByTagName(qualifiedName): LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1397

Returns a LiveNodeList of elements with the given qualifiedName. Searching for all descendants can be done by passing * as qualifiedName.

The complete document is searched, including the root node. The returned list is live, which means it updates itself with the DOM tree automatically. Therefore, there is no need to call Element.getElementsByTagName() with the same element and arguments repeatedly if the DOM changes in between calls.

When called on an HTML element in an HTML document, getElementsByTagName lower-cases the argument before searching for it. This is undesirable when trying to match camel-cased SVG elements (such as <linearGradient>) in an HTML document. Instead, use Element.getElementsByTagNameNS(), which preserves the capitalization of the tag name.

Element.getElementsByTagName is similar to Document.getElementsByTagName(), except that it only searches for elements that are descendants of the specified element.

Parameters​
ParameterType
qualifiedNamestring
Returns​

LiveNodeList<Element>

See​

getElementsByTagNameNS()​

getElementsByTagNameNS(namespaceURI, localName): LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1409

Returns a LiveNodeList of elements with the given tag name belonging to the given namespace. The complete document is searched, including the root node.

The returned list is live, which means it updates itself with the DOM tree automatically. Therefore, there is no need to call Element.getElementsByTagName() with the same element and arguments repeatedly if the DOM changes in between calls.

MDN Reference

Parameters​
ParameterType
namespaceURIstring | null
localNamestring
Returns​

LiveNodeList<Element>

getRootNode()​

getRootNode(options): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:502

Searches for the root node of this node.

This behavior is slightly different from the one in the specs:

  • ignores options.composed, since ShadowRoots are unsupported, therefore always returning root.

MDN Reference

Parameters​
ParameterType
optionsGetRootNodeOptions
Returns​

Node

See​
Inherited from​

Node.getRootNode

hasChildNodes()​

hasChildNodes(): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:547

Returns whether node has children.

MDN Reference

Returns​

boolean

Inherited from​

Node.hasChildNodes

importNode()​

importNode<T>(node, deep?): T

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1421

Imports a node from another document into this document, creating a new copy owned by this document. If deep is true, the copy also includes the node's descendants.

MDN Reference

Type Parameters​
Type Parameter
T extends Node
Parameters​
ParameterType
nodeT
deep?boolean
Returns​

T

See​

https://dom.spec.whatwg.org/#dom-document-importnode

insertBefore()​

insertBefore(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:550

MDN Reference

Parameters​
ParameterType
nodeNode
childNode | null
Returns​

Node

Inherited from​

Node.insertBefore

isDefaultNamespace()​

isDefaultNamespace(namespace): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:553

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

boolean

Inherited from​

Node.isDefaultNamespace

isEqualNode()​

isEqualNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:514

Checks whether the given node is equal to this node.

Two nodes are equal when they have the same type, defining characteristics (for the type), and the same childNodes. The comparison is iterative to avoid stack overflows on deeply nested trees. Attribute nodes of each Element pair are also compared iteratively.

Parameters​
ParameterType
otherNode
Returns​

boolean

See​
Inherited from​

Node.isEqualNode

isSameNode()​

isSameNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:521

Checks whether the given node is this node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

boolean

Inherited from​

Node.isSameNode

isSupported()​

isSupported(feature, version): true

Defined in: node_modules/@xmldom/xmldom/index.d.ts:568

Checks whether the DOM implementation implements a specific feature and its version.

Parameters​
ParameterTypeDescription
featurestringThe package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation.
versionstringThis is the version number of the package name to test.
Returns​

true

Deprecated​

Since DOMImplementation.hasFeature is deprecated and always returns true.

Since​

Introduced in DOM Level 2

See​

DOMImplementation.hasFeature

Inherited from​

Node.isSupported

lookupNamespaceURI()​

lookupNamespaceURI(prefix): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:571

MDN Reference

Parameters​
ParameterType
prefixstring | null
Returns​

string | null

Inherited from​

Node.lookupNamespaceURI

lookupPrefix()​

lookupPrefix(namespace): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:574

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

string | null

Inherited from​

Node.lookupPrefix

normalize()​

normalize(): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:582

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

MDN Reference

Returns​

void

Inherited from​

Node.normalize

removeChild()​

removeChild(child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:585

MDN Reference

Parameters​
ParameterType
childNode
Returns​

Node

Inherited from​

Node.removeChild

replaceChild()​

replaceChild(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:588

MDN Reference

Parameters​
ParameterType
nodeNode
childNode
Returns​

Node

Inherited from​

Node.replaceChild


DocumentType​

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1431

A Node containing a doctype.

MDN Reference

Extends​

Properties​

ATTRIBUTE_NODE​

readonly ATTRIBUTE_NODE: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:592

Inherited from​

Node.ATTRIBUTE_NODE

baseURI​

readonly baseURI: "about:blank"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:396

Always returns about:blank currently.

MDN Reference

Inherited from​

Node.baseURI

CDATA_SECTION_NODE​

readonly CDATA_SECTION_NODE: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:596

node is a CDATASection node.

Inherited from​

Node.CDATA_SECTION_NODE

childNodes​

readonly childNodes: NodeList

Defined in: node_modules/@xmldom/xmldom/index.d.ts:374

Returns the children.

MDN Reference

Inherited from​

Node.childNodes

columnNumber?​

optional columnNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:479

One based column position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.columnNumber

COMMENT_NODE​

readonly COMMENT_NODE: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:602

node is a Comment node.

Inherited from​

Node.COMMENT_NODE

DOCUMENT_FRAGMENT_NODE​

readonly DOCUMENT_FRAGMENT_NODE: 11

Defined in: node_modules/@xmldom/xmldom/index.d.ts:608

node is a DocumentFragment node.

Inherited from​

Node.DOCUMENT_FRAGMENT_NODE

DOCUMENT_NODE​

readonly DOCUMENT_NODE: 9

Defined in: node_modules/@xmldom/xmldom/index.d.ts:604

node is a document.

Inherited from​

Node.DOCUMENT_NODE

DOCUMENT_POSITION_CONTAINED_BY​

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Defined in: node_modules/@xmldom/xmldom/index.d.ts:619

Set when other is a descendant of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINS​

readonly DOCUMENT_POSITION_CONTAINS: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:617

Set when other is an ancestor of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_DISCONNECTED​

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:611

Set when node and other are not in the same tree.

Inherited from​

Node.DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_FOLLOWING​

readonly DOCUMENT_POSITION_FOLLOWING: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:615

Set when other is following node.

Inherited from​

Node.DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC​

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

Defined in: node_modules/@xmldom/xmldom/index.d.ts:620

Inherited from​

Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_PRECEDING​

readonly DOCUMENT_POSITION_PRECEDING: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:613

Set when other is preceding node.

Inherited from​

Node.DOCUMENT_POSITION_PRECEDING

DOCUMENT_TYPE_NODE​

readonly DOCUMENT_TYPE_NODE: 10

Defined in: node_modules/@xmldom/xmldom/index.d.ts:606

node is a doctype.

Inherited from​

Node.DOCUMENT_TYPE_NODE

ELEMENT_NODE​

readonly ELEMENT_NODE: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:591

node is an element.

Inherited from​

Node.ELEMENT_NODE

ENTITY_NODE​

readonly ENTITY_NODE: 6

Defined in: node_modules/@xmldom/xmldom/index.d.ts:598

Inherited from​

Node.ENTITY_NODE

ENTITY_REFERENCE_NODE​

readonly ENTITY_REFERENCE_NODE: 5

Defined in: node_modules/@xmldom/xmldom/index.d.ts:597

Inherited from​

Node.ENTITY_REFERENCE_NODE

firstChild​

readonly firstChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:380

Returns the first child.

MDN Reference

Inherited from​

Node.firstChild

internalSubset​

readonly internalSubset: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1449

The internal subset string (the raw content between [ and ]), or an empty string. Declared readonly by the WHATWG DOM spec; xmldom does not enforce this — direct property writes succeed and the written value is serialized verbatim. When serialized with requireWellFormed: true, throws InvalidStateError if the value contains "]>". MDN Reference

isConnected​

readonly isConnected: boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:402

Returns true if this node is inside of a document or is the document node itself.

MDN Reference

Inherited from​

Node.isConnected

lastChild​

readonly lastChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:386

Returns the last child.

MDN Reference

Inherited from​

Node.lastChild

lineNumber?​

optional lineNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:474

Zero based line position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.lineNumber

localName​

localName: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:390

The local part of the qualified name of this node.

Inherited from​

Node.localName

name​

readonly name: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1440

The doctype name, stored verbatim. Declared readonly by the WHATWG DOM spec; xmldom does not enforce this — direct property writes succeed and the written value is serialized verbatim. When serialized with requireWellFormed: true, throws InvalidStateError if the value is not a valid XML Name production (XML 1.0 [5]). MDN Reference

namespaceURI​

readonly namespaceURI: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:406

The namespace URI of this node.

Inherited from​

Node.namespaceURI

nextSibling​

readonly nextSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:412

Returns the next sibling.

MDN Reference

Inherited from​

Node.nextSibling

nodeName​

readonly nodeName: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:418

Returns a string appropriate for the type of node.

MDN Reference

Inherited from​

Node.nodeName

nodeType​

readonly nodeType: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:424

Returns the type of node.

MDN Reference

Inherited from​

Node.nodeType

nodeValue​

nodeValue: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:426

MDN Reference

Inherited from​

Node.nodeValue

NOTATION_NODE​

readonly NOTATION_NODE: 12

Defined in: node_modules/@xmldom/xmldom/index.d.ts:609

Inherited from​

Node.NOTATION_NODE

ownerDocument​

readonly ownerDocument: Document | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:432

Returns the node document. Returns null for documents.

MDN Reference

Inherited from​

Node.ownerDocument

parentElement​

readonly parentElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:444

Returns the parent Node if it is of type Element, otherwise null.

MDN Reference

Inherited from​

Node.parentElement

parentNode​

readonly parentNode: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:438

Returns the parent.

MDN Reference

Inherited from​

Node.parentNode

prefix​

prefix: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:448

The prefix of the namespace for this node.

Inherited from​

Node.prefix

previousSibling​

readonly previousSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:454

Returns the previous sibling.

MDN Reference

Inherited from​

Node.previousSibling

PROCESSING_INSTRUCTION_NODE​

readonly PROCESSING_INSTRUCTION_NODE: 7

Defined in: node_modules/@xmldom/xmldom/index.d.ts:600

node is a ProcessingInstruction node.

Inherited from​

Node.PROCESSING_INSTRUCTION_NODE

publicId​

readonly publicId: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1458

The external subset public identifier, stored verbatim including surrounding quotes. Declared readonly by the WHATWG DOM spec; xmldom does not enforce this — direct property writes succeed and the written value is serialized verbatim. When serialized with requireWellFormed: true, throws InvalidStateError if the value is non-empty and does not match the XML PubidLiteral production (XML 1.0 [12]). MDN Reference

systemId​

readonly systemId: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1467

The external subset system identifier, stored verbatim including surrounding quotes. Declared readonly by the WHATWG DOM spec; xmldom does not enforce this — direct property writes succeed and the written value is serialized verbatim. When serialized with requireWellFormed: true, throws InvalidStateError if the value is non-empty and does not match the XML SystemLiteral production (XML 1.0 [11]). MDN Reference

TEXT_NODE​

readonly TEXT_NODE: 3

Defined in: node_modules/@xmldom/xmldom/index.d.ts:594

node is a Text node.

Inherited from​

Node.TEXT_NODE

textContent​

textContent: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:468

The text content of this node and its descendants.

For Element and DocumentFragment nodes, returns the concatenation of the nodeValue of every descendant text node, excluding processing instruction and comment nodes. For all other node types, returns nodeValue.

Setting textContent on an element or document fragment replaces all child nodes with a single text node; on other nodes it sets data, value, and nodeValue directly. MDN Reference

See​

https://dom.spec.whatwg.org/#dom-node-textcontent

Inherited from​

Node.textContent

Methods​

appendChild()​

appendChild(node): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:482

MDN Reference

Parameters​
ParameterType
nodeNode
Returns​

Node

Inherited from​

Node.appendChild

cloneNode()​

cloneNode(deep?): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:533

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

Parameters​
ParameterType
deep?boolean
Returns​

Node

Throws​

May throw a DOMException if operations within Element#setAttributeNode or Node#appendChild (which are potentially invoked in this method) do not meet their specific constraints.

MDN Reference

Inherited from​

Node.cloneNode

compareDocumentPosition()​

compareDocumentPosition(other): number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:540

Returns a bitmask indicating the position of other relative to node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

number

Inherited from​

Node.compareDocumentPosition

contains()​

contains(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:489

Checks whether other is an inclusive descendant of this node.

MDN Reference

Parameters​
ParameterType
otherNode | null | undefined
Returns​

boolean

Inherited from​

Node.contains

getRootNode()​

getRootNode(options): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:502

Searches for the root node of this node.

This behavior is slightly different from the one in the specs:

  • ignores options.composed, since ShadowRoots are unsupported, therefore always returning root.

MDN Reference

Parameters​
ParameterType
optionsGetRootNodeOptions
Returns​

Node

See​
Inherited from​

Node.getRootNode

hasChildNodes()​

hasChildNodes(): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:547

Returns whether node has children.

MDN Reference

Returns​

boolean

Inherited from​

Node.hasChildNodes

insertBefore()​

insertBefore(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:550

MDN Reference

Parameters​
ParameterType
nodeNode
childNode | null
Returns​

Node

Inherited from​

Node.insertBefore

isDefaultNamespace()​

isDefaultNamespace(namespace): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:553

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

boolean

Inherited from​

Node.isDefaultNamespace

isEqualNode()​

isEqualNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:514

Checks whether the given node is equal to this node.

Two nodes are equal when they have the same type, defining characteristics (for the type), and the same childNodes. The comparison is iterative to avoid stack overflows on deeply nested trees. Attribute nodes of each Element pair are also compared iteratively.

Parameters​
ParameterType
otherNode
Returns​

boolean

See​
Inherited from​

Node.isEqualNode

isSameNode()​

isSameNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:521

Checks whether the given node is this node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

boolean

Inherited from​

Node.isSameNode

isSupported()​

isSupported(feature, version): true

Defined in: node_modules/@xmldom/xmldom/index.d.ts:568

Checks whether the DOM implementation implements a specific feature and its version.

Parameters​
ParameterTypeDescription
featurestringThe package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation.
versionstringThis is the version number of the package name to test.
Returns​

true

Deprecated​

Since DOMImplementation.hasFeature is deprecated and always returns true.

Since​

Introduced in DOM Level 2

See​

DOMImplementation.hasFeature

Inherited from​

Node.isSupported

lookupNamespaceURI()​

lookupNamespaceURI(prefix): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:571

MDN Reference

Parameters​
ParameterType
prefixstring | null
Returns​

string | null

Inherited from​

Node.lookupNamespaceURI

lookupPrefix()​

lookupPrefix(namespace): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:574

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

string | null

Inherited from​

Node.lookupPrefix

normalize()​

normalize(): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:582

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

MDN Reference

Returns​

void

Inherited from​

Node.normalize

removeChild()​

removeChild(child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:585

MDN Reference

Parameters​
ParameterType
childNode
Returns​

Node

Inherited from​

Node.removeChild

replaceChild()​

replaceChild(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:588

MDN Reference

Parameters​
ParameterType
nodeNode
childNode
Returns​

Node

Inherited from​

Node.replaceChild


DublinCore​

Defined in: libraries/epub/src/index.tsx:184

Properties​

contributors?​

optional contributors: DcCreator[]

Defined in: libraries/epub/src/index.tsx:191

creators?​

optional creators: DcCreator[]

Defined in: libraries/epub/src/index.tsx:190

date?​

optional date: Date

Defined in: libraries/epub/src/index.tsx:188

identifier​

identifier: string

Defined in: libraries/epub/src/index.tsx:187

language​

language: Locale

Defined in: libraries/epub/src/index.tsx:186

subjects?​

optional subjects: (string | DcSubject)[]

Defined in: libraries/epub/src/index.tsx:189

title​

title: string

Defined in: libraries/epub/src/index.tsx:185

type?​

optional type: string

Defined in: libraries/epub/src/index.tsx:192


Element​

Defined in: node_modules/@xmldom/xmldom/index.d.ts:842

Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.

MDN Reference

Extends​

Properties​

ATTRIBUTE_NODE​

readonly ATTRIBUTE_NODE: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:592

Inherited from​

Node.ATTRIBUTE_NODE

attributes​

readonly attributes: NamedNodeMap

Defined in: node_modules/@xmldom/xmldom/index.d.ts:846

MDN Reference

baseURI​

readonly baseURI: "about:blank"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:396

Always returns about:blank currently.

MDN Reference

Inherited from​

Node.baseURI

CDATA_SECTION_NODE​

readonly CDATA_SECTION_NODE: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:596

node is a CDATASection node.

Inherited from​

Node.CDATA_SECTION_NODE

childNodes​

readonly childNodes: NodeList

Defined in: node_modules/@xmldom/xmldom/index.d.ts:374

Returns the children.

MDN Reference

Inherited from​

Node.childNodes

children​

readonly children: LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:861

Returns a live collection of the direct child elements of this element.

MDN Reference

See​

https://dom.spec.whatwg.org/#dom-parentnode-children

columnNumber?​

optional columnNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:479

One based column position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.columnNumber

COMMENT_NODE​

readonly COMMENT_NODE: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:602

node is a Comment node.

Inherited from​

Node.COMMENT_NODE

DOCUMENT_FRAGMENT_NODE​

readonly DOCUMENT_FRAGMENT_NODE: 11

Defined in: node_modules/@xmldom/xmldom/index.d.ts:608

node is a DocumentFragment node.

Inherited from​

Node.DOCUMENT_FRAGMENT_NODE

DOCUMENT_NODE​

readonly DOCUMENT_NODE: 9

Defined in: node_modules/@xmldom/xmldom/index.d.ts:604

node is a document.

Inherited from​

Node.DOCUMENT_NODE

DOCUMENT_POSITION_CONTAINED_BY​

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Defined in: node_modules/@xmldom/xmldom/index.d.ts:619

Set when other is a descendant of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINS​

readonly DOCUMENT_POSITION_CONTAINS: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:617

Set when other is an ancestor of node.

Inherited from​

Node.DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_DISCONNECTED​

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:611

Set when node and other are not in the same tree.

Inherited from​

Node.DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_FOLLOWING​

readonly DOCUMENT_POSITION_FOLLOWING: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:615

Set when other is following node.

Inherited from​

Node.DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC​

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

Defined in: node_modules/@xmldom/xmldom/index.d.ts:620

Inherited from​

Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_PRECEDING​

readonly DOCUMENT_POSITION_PRECEDING: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:613

Set when other is preceding node.

Inherited from​

Node.DOCUMENT_POSITION_PRECEDING

DOCUMENT_TYPE_NODE​

readonly DOCUMENT_TYPE_NODE: 10

Defined in: node_modules/@xmldom/xmldom/index.d.ts:606

node is a doctype.

Inherited from​

Node.DOCUMENT_TYPE_NODE

ELEMENT_NODE​

readonly ELEMENT_NODE: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:591

node is an element.

Inherited from​

Node.ELEMENT_NODE

ENTITY_NODE​

readonly ENTITY_NODE: 6

Defined in: node_modules/@xmldom/xmldom/index.d.ts:598

Inherited from​

Node.ENTITY_NODE

ENTITY_REFERENCE_NODE​

readonly ENTITY_REFERENCE_NODE: 5

Defined in: node_modules/@xmldom/xmldom/index.d.ts:597

Inherited from​

Node.ENTITY_REFERENCE_NODE

firstChild​

readonly firstChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:380

Returns the first child.

MDN Reference

Inherited from​

Node.firstChild

isConnected​

readonly isConnected: boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:402

Returns true if this node is inside of a document or is the document node itself.

MDN Reference

Inherited from​

Node.isConnected

lastChild​

readonly lastChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:386

Returns the last child.

MDN Reference

Inherited from​

Node.lastChild

lineNumber?​

optional lineNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:474

Zero based line position inside the parsed source, if the locator was not disabled.

Inherited from​

Node.lineNumber

localName​

localName: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:390

The local part of the qualified name of this node.

Inherited from​

Node.localName

namespaceURI​

readonly namespaceURI: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:406

The namespace URI of this node.

Inherited from​

Node.namespaceURI

nextSibling​

readonly nextSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:412

Returns the next sibling.

MDN Reference

Inherited from​

Node.nextSibling

nodeName​

readonly nodeName: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:418

Returns a string appropriate for the type of node.

MDN Reference

Inherited from​

Node.nodeName

nodeType​

readonly nodeType: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:843

Returns the type of node.

MDN Reference

Overrides​

Node.nodeType

nodeValue​

nodeValue: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:426

MDN Reference

Inherited from​

Node.nodeValue

NOTATION_NODE​

readonly NOTATION_NODE: 12

Defined in: node_modules/@xmldom/xmldom/index.d.ts:609

Inherited from​

Node.NOTATION_NODE

ownerDocument​

readonly ownerDocument: Document | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:432

Returns the node document. Returns null for documents.

MDN Reference

Inherited from​

Node.ownerDocument

parentElement​

readonly parentElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:444

Returns the parent Node if it is of type Element, otherwise null.

MDN Reference

Inherited from​

Node.parentElement

parentNode​

readonly parentNode: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:438

Returns the parent.

MDN Reference

Inherited from​

Node.parentNode

prefix​

prefix: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:448

The prefix of the namespace for this node.

Inherited from​

Node.prefix

previousSibling​

readonly previousSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:454

Returns the previous sibling.

MDN Reference

Inherited from​

Node.previousSibling

PROCESSING_INSTRUCTION_NODE​

readonly PROCESSING_INSTRUCTION_NODE: 7

Defined in: node_modules/@xmldom/xmldom/index.d.ts:600

node is a ProcessingInstruction node.

Inherited from​

Node.PROCESSING_INSTRUCTION_NODE

tagName​

readonly tagName: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:852

Returns the HTML-uppercased qualified name.

MDN Reference

TEXT_NODE​

readonly TEXT_NODE: 3

Defined in: node_modules/@xmldom/xmldom/index.d.ts:594

node is a Text node.

Inherited from​

Node.TEXT_NODE

textContent​

textContent: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:468

The text content of this node and its descendants.

For Element and DocumentFragment nodes, returns the concatenation of the nodeValue of every descendant text node, excluding processing instruction and comment nodes. For all other node types, returns nodeValue.

Setting textContent on an element or document fragment replaces all child nodes with a single text node; on other nodes it sets data, value, and nodeValue directly. MDN Reference

See​

https://dom.spec.whatwg.org/#dom-node-textcontent

Inherited from​

Node.textContent

Methods​

appendChild()​

appendChild(node): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:482

MDN Reference

Parameters​
ParameterType
nodeNode
Returns​

Node

Inherited from​

Node.appendChild

cloneNode()​

cloneNode(deep?): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:533

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

Parameters​
ParameterType
deep?boolean
Returns​

Node

Throws​

May throw a DOMException if operations within Element#setAttributeNode or Node#appendChild (which are potentially invoked in this method) do not meet their specific constraints.

MDN Reference

Inherited from​

Node.cloneNode

compareDocumentPosition()​

compareDocumentPosition(other): number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:540

Returns a bitmask indicating the position of other relative to node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

number

Inherited from​

Node.compareDocumentPosition

contains()​

contains(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:489

Checks whether other is an inclusive descendant of this node.

MDN Reference

Parameters​
ParameterType
otherNode | null | undefined
Returns​

boolean

Inherited from​

Node.contains

getAttribute()​

getAttribute(qualifiedName): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:869

Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.

MDN Reference

Parameters​
ParameterType
qualifiedNamestring
Returns​

string | null

getAttributeNames()​

getAttributeNames(): string[]

Defined in: node_modules/@xmldom/xmldom/index.d.ts:882

Returns the qualified names of all element's attributes. Can contain duplicates.

MDN Reference

Returns​

string[]

getAttributeNode()​

getAttributeNode(qualifiedName): Attr | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:884

MDN Reference

Parameters​
ParameterType
qualifiedNamestring
Returns​

Attr | null

getAttributeNodeNS()​

getAttributeNodeNS(namespace, localName): Attr | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:886

MDN Reference

Parameters​
ParameterType
namespacestring | null
localNamestring
Returns​

Attr | null

getAttributeNS()​

getAttributeNS(namespace, localName): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:876

Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.

MDN Reference

Parameters​
ParameterType
namespacestring | null
localNamestring
Returns​

string | null

getElementsByClassName()​

getElementsByClassName(classNames): LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:905

Returns a LiveNodeList of all child elements which have all of the given class name(s).

Returns an empty list if classNames is an empty string or only contains HTML white space characters.

Warning: This returns a live LiveNodeList. Changes in the DOM will reflect in the array as the changes occur. If an element selected by this array no longer qualifies for the selector, it will automatically be removed. Be aware of this for iteration purposes.

Parameters​
ParameterType
classNamesstring
Returns​

LiveNodeList<Element>

See​

getElementsByTagName()​

getElementsByTagName(qualifiedName): LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:929

Returns a LiveNodeList of elements with the given qualifiedName. Searching for all descendants can be done by passing * as qualifiedName.

All descendants of the specified element are searched, but not the element itself. The returned list is live, which means it updates itself with the DOM tree automatically. Therefore, there is no need to call Element.getElementsByTagName() with the same element and arguments repeatedly if the DOM changes in between calls.

When called on an HTML element in an HTML document, getElementsByTagName lower-cases the argument before searching for it. This is undesirable when trying to match camel-cased SVG elements (such as <linearGradient>) in an HTML document. Instead, use Element.getElementsByTagNameNS(), which preserves the capitalization of the tag name.

Element.getElementsByTagName is similar to Document.getElementsByTagName(), except that it only searches for elements that are descendants of the specified element.

Parameters​
ParameterType
qualifiedNamestring
Returns​

LiveNodeList<Element>

See​

getElementsByTagNameNS()​

getElementsByTagNameNS(namespaceURI, localName): LiveNodeList<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:938

Returns a LiveNodeList of elements with the given tag name belonging to the given namespace. It is similar to Document.getElementsByTagNameNS, except that its search is restricted to descendants of the specified element.

MDN Reference

Parameters​
ParameterType
namespaceURIstring | null
localNamestring
Returns​

LiveNodeList<Element>

getQualifiedName()​

getQualifiedName(): string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:943

Returns​

string

getRootNode()​

getRootNode(options): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:502

Searches for the root node of this node.

This behavior is slightly different from the one in the specs:

  • ignores options.composed, since ShadowRoots are unsupported, therefore always returning root.

MDN Reference

Parameters​
ParameterType
optionsGetRootNodeOptions
Returns​

Node

See​
Inherited from​

Node.getRootNode

hasAttribute()​

hasAttribute(qualifiedName): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:950

Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.

MDN Reference

Parameters​
ParameterType
qualifiedNamestring
Returns​

boolean

hasAttributeNS()​

hasAttributeNS(namespace, localName): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:957

Returns true if element has an attribute whose namespace is namespace and local name is localName.

MDN Reference

Parameters​
ParameterType
namespacestring | null
localNamestring
Returns​

boolean

hasAttributes()​

hasAttributes(): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:963

Returns true if element has attributes, and false otherwise.

MDN Reference

Returns​

boolean

hasChildNodes()​

hasChildNodes(): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:547

Returns whether node has children.

MDN Reference

Returns​

boolean

Inherited from​

Node.hasChildNodes

insertBefore()​

insertBefore(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:550

MDN Reference

Parameters​
ParameterType
nodeNode
childNode | null
Returns​

Node

Inherited from​

Node.insertBefore

isDefaultNamespace()​

isDefaultNamespace(namespace): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:553

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

boolean

Inherited from​

Node.isDefaultNamespace

isEqualNode()​

isEqualNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:514

Checks whether the given node is equal to this node.

Two nodes are equal when they have the same type, defining characteristics (for the type), and the same childNodes. The comparison is iterative to avoid stack overflows on deeply nested trees. Attribute nodes of each Element pair are also compared iteratively.

Parameters​
ParameterType
otherNode
Returns​

boolean

See​
Inherited from​

Node.isEqualNode

isSameNode()​

isSameNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:521

Checks whether the given node is this node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

boolean

Inherited from​

Node.isSameNode

isSupported()​

isSupported(feature, version): true

Defined in: node_modules/@xmldom/xmldom/index.d.ts:568

Checks whether the DOM implementation implements a specific feature and its version.

Parameters​
ParameterTypeDescription
featurestringThe package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation.
versionstringThis is the version number of the package name to test.
Returns​

true

Deprecated​

Since DOMImplementation.hasFeature is deprecated and always returns true.

Since​

Introduced in DOM Level 2

See​

DOMImplementation.hasFeature

Inherited from​

Node.isSupported

lookupNamespaceURI()​

lookupNamespaceURI(prefix): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:571

MDN Reference

Parameters​
ParameterType
prefixstring | null
Returns​

string | null

Inherited from​

Node.lookupNamespaceURI

lookupPrefix()​

lookupPrefix(namespace): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:574

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

string | null

Inherited from​

Node.lookupPrefix

normalize()​

normalize(): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:582

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

MDN Reference

Returns​

void

Inherited from​

Node.normalize

removeAttribute()​

removeAttribute(qualifiedName): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:969

Removes element's first attribute whose qualified name is qualifiedName.

MDN Reference

Parameters​
ParameterType
qualifiedNamestring
Returns​

void

removeAttributeNode()​

removeAttributeNode(attr): Attr

Defined in: node_modules/@xmldom/xmldom/index.d.ts:977

MDN Reference

Parameters​
ParameterType
attrAttr
Returns​

Attr

removeAttributeNS()​

removeAttributeNS(namespace, localName): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:975

Removes element's attribute whose namespace is namespace and local name is localName.

MDN Reference

Parameters​
ParameterType
namespacestring | null
localNamestring
Returns​

void

removeChild()​

removeChild(child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:585

MDN Reference

Parameters​
ParameterType
childNode
Returns​

Node

Inherited from​

Node.removeChild

replaceChild()​

replaceChild(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:588

MDN Reference

Parameters​
ParameterType
nodeNode
childNode
Returns​

Node

Inherited from​

Node.replaceChild

setAttribute()​

setAttribute(qualifiedName, value): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:983

Sets the value of element's first attribute whose qualified name is qualifiedName to value.

MDN Reference

Parameters​
ParameterType
qualifiedNamestring
valuestring
Returns​

void

setAttributeNode()​

setAttributeNode(attr): Attr | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:996

MDN Reference

Parameters​
ParameterType
attrAttr
Returns​

Attr | null

setAttributeNodeNS()​

setAttributeNodeNS(attr): Attr | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:998

MDN Reference

Parameters​
ParameterType
attrAttr
Returns​

Attr | null

setAttributeNS()​

setAttributeNS(namespace, qualifiedName, value): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:990

Sets the value of element's attribute whose namespace is namespace and local name is localName to value.

MDN Reference

Parameters​
ParameterType
namespacestring | null
qualifiedNamestring
valuestring
Returns​

void


Epub2UpgradeOptions​

Defined in: libraries/epub/src/upgrade.tsx:76

Properties​

outputPath?​

optional outputPath: string

Defined in: libraries/epub/src/upgrade.tsx:80

The path to the output file. If provided, the input file will be copied to the output path.

removeNcx?​

optional removeNcx: boolean

Defined in: libraries/epub/src/upgrade.tsx:84

Whether to remove the NCX file, as it's technically optional in EPUB 3.


EpubIdentifier​

Defined in: libraries/epub/src/index.tsx:144

Properties​

id?​

optional id: string

Defined in: libraries/epub/src/index.tsx:146

identifierType?​

optional identifierType: string

Defined in: libraries/epub/src/index.tsx:148

the value of a refining identifier-type meta, if present

scheme?​

optional scheme: string

Defined in: libraries/epub/src/index.tsx:150

the scheme of a refining identifier-type meta, or a legacy opf:scheme attribute

value​

value: string

Defined in: libraries/epub/src/index.tsx:145


EpubListEntry​

Defined in: libraries/epub/src/adapters/interface.ts:39

Properties​

absolutePath​

absolutePath: string

Defined in: libraries/epub/src/adapters/interface.ts:41

location the adapter can read the entry back from, in whatever form it stores

relativePath​

relativePath: string

Defined in: libraries/epub/src/adapters/interface.ts:43

the entry name, as it appears in the archive


EpubSource​

Defined in: libraries/epub/src/index.tsx:153

Properties​

id?​

optional id: string

Defined in: libraries/epub/src/index.tsx:155

identifierType?​

optional identifierType: string

Defined in: libraries/epub/src/index.tsx:157

the value of a refining identifier-type meta, if present

isPageBreakSource?​

optional isPageBreakSource: boolean

Defined in: libraries/epub/src/index.tsx:168

whether this source has a source-of="pagination" refinement or of a <meta property="pageBreakSource"> element

as of EPUB 3.4 source-of is advised-deprecated in favour of the publication-level pageBreakSource property. if you want to be sure to get the source of pagination, use Epub.getPageBreakSource

scheme?​

optional scheme: string

Defined in: libraries/epub/src/index.tsx:159

the scheme of a refining identifier-type meta, or a legacy opf:scheme attribute

value​

value: string

Defined in: libraries/epub/src/index.tsx:154


EpubStorageAdapter​

Defined in: libraries/epub/src/adapters/interface.ts:56

Adapters only receive entry names, which is:

  • the name a file has in the archive itself
  • relative to the container root, slash-separated,
  • already percent-decoded (eg OEBPS/a b.xhtml, not OEBPS/a%20b.xhtml)

Adapter decides where to store files under what name In previous versions of the EPUB lib, this was a little bit more muddled, leading to eg the TmpFsAdapter trying to read OEBPS/a%20b.xhtml, whereas it was stored as OEBPS/a b.xhtml

Methods​

archiveLength()​

archiveLength(entry): Promise<number>

Defined in: libraries/epub/src/adapters/interface.ts:71

Length of an entry in bytes, for the readium page-count heuristic which expects compressed size when available

Parameters​
ParameterType
entrystring
Returns​

Promise<number>

dispose()​

dispose(): void | Promise<void>

Defined in: libraries/epub/src/adapters/interface.ts:90

Always called on close or error

Returns​

void | Promise<void>

duplicate()?​

optional duplicate(): Promise<EpubStorageAdapter>

Defined in: libraries/epub/src/adapters/interface.ts:84

Required for Epub.copy

Returns​

Promise<EpubStorageAdapter>

exists()​

exists(entry): Promise<boolean>

Defined in: libraries/epub/src/adapters/interface.ts:65

Whether the archive holds an entry under exactly this name. Used to choose between different canditates for an href so should be exact

Parameters​
ParameterType
entrystring
Returns​

Promise<boolean>

list()?​

optional list(): AsyncIterable<EpubListEntry>

Defined in: libraries/epub/src/adapters/interface.ts:81

Required for Epub.saveAndClose to walk the contents

Returns​

AsyncIterable<EpubListEntry>

read()​

Call Signature​

read(entry): Promise<Uint8Array<ArrayBufferLike>>

Defined in: libraries/epub/src/adapters/interface.ts:57

Parameters​
ParameterType
entrystring
Returns​

Promise<Uint8Array<ArrayBufferLike>>

Call Signature​

read(entry, encoding): Promise<string>

Defined in: libraries/epub/src/adapters/interface.ts:58

Parameters​
ParameterType
entrystring
encoding"utf-8"
Returns​

Promise<string>

remove()?​

optional remove(entry): Promise<void>

Defined in: libraries/epub/src/adapters/interface.ts:78

Required for removeManifestItem / setCoverImage replacement

Parameters​
ParameterType
entrystring
Returns​

Promise<void>

serialize()?​

optional serialize(targetPath): Promise<void>

Defined in: libraries/epub/src/adapters/interface.ts:87

Required for Epub.saveAndClose

Parameters​
ParameterType
targetPathstring
Returns​

Promise<void>

write()?​

Call Signature​

optional write(entry, data): Promise<void>

Defined in: libraries/epub/src/adapters/interface.ts:74

Required for any mutation method on Epub

Parameters​
ParameterType
entrystring
dataUint8Array
Returns​

Promise<void>

Call Signature​

optional write(entry, data, encoding): Promise<void>

Defined in: libraries/epub/src/adapters/interface.ts:75

Parameters​
ParameterType
entrystring
datastring
encoding"utf-8"
Returns​

Promise<void>


EpubStorageAdapterClass<Opts>​

Defined in: libraries/epub/src/adapters/interface.ts:93

Type Parameters​

Type ParameterDefault type
Opts extends objectobject

Properties​

capabilities​

readonly capabilities: EpubStorageCapabilities

Defined in: libraries/epub/src/adapters/interface.ts:95

kind​

readonly kind: EpubStorageKind

Defined in: libraries/epub/src/adapters/interface.ts:94

Methods​

init()​

init(source, opts?): Promise<EpubStorageAdapter>

Defined in: libraries/epub/src/adapters/interface.ts:101

Open an archive from a path or buffer. Will throw if the archive is not a valid EPUB 3

Parameters​
ParameterType
sourceArchiveSource
opts?Opts
Returns​

Promise<EpubStorageAdapter>

initEmpty()?​

optional initEmpty(opts?): Promise<EpubStorageAdapter>

Defined in: libraries/epub/src/adapters/interface.ts:107

Initialize an empty extract root for Epub.create. Only necessary for adapters that can write

Parameters​
ParameterType
opts?Opts
Returns​

Promise<EpubStorageAdapter>


EpubStorageCapabilities​

Defined in: libraries/epub/src/adapters/interface.ts:34

Properties​

writable​

readonly writable: boolean

Defined in: libraries/epub/src/adapters/interface.ts:36

when false, the Epub class refuses every mutation method at runtime


FromOptions​

Defined in: libraries/epub/src/index.tsx:222

Properties​

readonly?​

optional readonly: boolean

Defined in: libraries/epub/src/index.tsx:227

when true, mutation methods throw EpubReadOnlyError at runtime

Default​
false;

GuideItem​

Defined in: libraries/epub/src/index.tsx:216

Properties​

href​

href: string

Defined in: libraries/epub/src/index.tsx:217

title​

title: string

Defined in: libraries/epub/src/index.tsx:218

type​

type: string

Defined in: libraries/epub/src/index.tsx:219


Landmark​

Defined in: libraries/epub/src/upgrade.tsx:70

Properties​

href​

href: string

Defined in: libraries/epub/src/upgrade.tsx:71

title​

title: string

Defined in: libraries/epub/src/upgrade.tsx:72

type​

type: string

Defined in: libraries/epub/src/upgrade.tsx:73


MemoryAdapterOptions​

Defined in: libraries/epub/src/adapters/memory.ts:13

Properties​

cache?​

optional cache: boolean

Defined in: libraries/epub/src/adapters/memory.ts:20

per-entry decompressed buffer cache turn it off when opening many EPUBs and reading each entry at most once keeps resident size bounded by the entry index, not the decompressed payload sum

Default​
true;

signal?​

optional signal: AbortSignal

Defined in: libraries/epub/src/adapters/memory.ts:21


Defined in: libraries/epub/src/index.tsx:210

Properties​

children​

children: NavigationList

Defined in: libraries/epub/src/index.tsx:213

role​

role: string

Defined in: libraries/epub/src/index.tsx:212

title?​

optional title: string

Defined in: libraries/epub/src/index.tsx:211


Defined in: libraries/epub/src/index.tsx:201

Properties​

children?​

optional children: NavigationList

Defined in: libraries/epub/src/index.tsx:205

href?​

optional href: string

Defined in: libraries/epub/src/index.tsx:203

role?​

optional role: string

Defined in: libraries/epub/src/index.tsx:204

title​

title: string

Defined in: libraries/epub/src/index.tsx:202


Node​

Defined in: node_modules/@xmldom/xmldom/index.d.ts:368

The DOM Node interface is an abstract base class upon which many other DOM API objects are based, thus letting those object types to be used similarly and often interchangeably. As an abstract class, there is no such thing as a plain Node object. All objects that implement Node functionality are based on one of its subclasses. Most notable are Document, Element, and DocumentFragment.

In addition, every kind of DOM node is represented by an interface based on Node. These include Attr, CharacterData (which Text, Comment, CDATASection and ProcessingInstruction are all based on), and DocumentType.

In some cases, a particular feature of the base Node interface may not apply to one of its child interfaces; in that case, the inheriting node may return null or throw an exception, depending on circumstances. For example, attempting to add children to a node type that cannot have children will throw an exception.

This behavior is slightly different from the in the specs:

  • unimplemented interfaces: EventTarget

See​

Prettierignore​

Properties​

ATTRIBUTE_NODE​

readonly ATTRIBUTE_NODE: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:592

baseURI​

readonly baseURI: "about:blank"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:396

Always returns about:blank currently.

MDN Reference

CDATA_SECTION_NODE​

readonly CDATA_SECTION_NODE: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:596

node is a CDATASection node.

childNodes​

readonly childNodes: NodeList

Defined in: node_modules/@xmldom/xmldom/index.d.ts:374

Returns the children.

MDN Reference

columnNumber?​

optional columnNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:479

One based column position inside the parsed source, if the locator was not disabled.

COMMENT_NODE​

readonly COMMENT_NODE: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:602

node is a Comment node.

DOCUMENT_FRAGMENT_NODE​

readonly DOCUMENT_FRAGMENT_NODE: 11

Defined in: node_modules/@xmldom/xmldom/index.d.ts:608

node is a DocumentFragment node.

DOCUMENT_NODE​

readonly DOCUMENT_NODE: 9

Defined in: node_modules/@xmldom/xmldom/index.d.ts:604

node is a document.

DOCUMENT_POSITION_CONTAINED_BY​

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Defined in: node_modules/@xmldom/xmldom/index.d.ts:619

Set when other is a descendant of node.

DOCUMENT_POSITION_CONTAINS​

readonly DOCUMENT_POSITION_CONTAINS: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:617

Set when other is an ancestor of node.

DOCUMENT_POSITION_DISCONNECTED​

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:611

Set when node and other are not in the same tree.

DOCUMENT_POSITION_FOLLOWING​

readonly DOCUMENT_POSITION_FOLLOWING: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:615

Set when other is following node.

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC​

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

Defined in: node_modules/@xmldom/xmldom/index.d.ts:620

DOCUMENT_POSITION_PRECEDING​

readonly DOCUMENT_POSITION_PRECEDING: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:613

Set when other is preceding node.

DOCUMENT_TYPE_NODE​

readonly DOCUMENT_TYPE_NODE: 10

Defined in: node_modules/@xmldom/xmldom/index.d.ts:606

node is a doctype.

ELEMENT_NODE​

readonly ELEMENT_NODE: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:591

node is an element.

ENTITY_NODE​

readonly ENTITY_NODE: 6

Defined in: node_modules/@xmldom/xmldom/index.d.ts:598

ENTITY_REFERENCE_NODE​

readonly ENTITY_REFERENCE_NODE: 5

Defined in: node_modules/@xmldom/xmldom/index.d.ts:597

firstChild​

readonly firstChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:380

Returns the first child.

MDN Reference

isConnected​

readonly isConnected: boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:402

Returns true if this node is inside of a document or is the document node itself.

MDN Reference

lastChild​

readonly lastChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:386

Returns the last child.

MDN Reference

lineNumber?​

optional lineNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:474

Zero based line position inside the parsed source, if the locator was not disabled.

localName​

localName: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:390

The local part of the qualified name of this node.

namespaceURI​

readonly namespaceURI: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:406

The namespace URI of this node.

nextSibling​

readonly nextSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:412

Returns the next sibling.

MDN Reference

nodeName​

readonly nodeName: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:418

Returns a string appropriate for the type of node.

MDN Reference

nodeType​

readonly nodeType: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:424

Returns the type of node.

MDN Reference

nodeValue​

nodeValue: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:426

MDN Reference

NOTATION_NODE​

readonly NOTATION_NODE: 12

Defined in: node_modules/@xmldom/xmldom/index.d.ts:609

ownerDocument​

readonly ownerDocument: Document | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:432

Returns the node document. Returns null for documents.

MDN Reference

parentElement​

readonly parentElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:444

Returns the parent Node if it is of type Element, otherwise null.

MDN Reference

parentNode​

readonly parentNode: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:438

Returns the parent.

MDN Reference

prefix​

prefix: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:448

The prefix of the namespace for this node.

previousSibling​

readonly previousSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:454

Returns the previous sibling.

MDN Reference

PROCESSING_INSTRUCTION_NODE​

readonly PROCESSING_INSTRUCTION_NODE: 7

Defined in: node_modules/@xmldom/xmldom/index.d.ts:600

node is a ProcessingInstruction node.

TEXT_NODE​

readonly TEXT_NODE: 3

Defined in: node_modules/@xmldom/xmldom/index.d.ts:594

node is a Text node.

textContent​

textContent: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:468

The text content of this node and its descendants.

For Element and DocumentFragment nodes, returns the concatenation of the nodeValue of every descendant text node, excluding processing instruction and comment nodes. For all other node types, returns nodeValue.

Setting textContent on an element or document fragment replaces all child nodes with a single text node; on other nodes it sets data, value, and nodeValue directly. MDN Reference

See​

https://dom.spec.whatwg.org/#dom-node-textcontent

Methods​

appendChild()​

appendChild(node): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:482

MDN Reference

Parameters​
ParameterType
nodeNode
Returns​

Node

cloneNode()​

cloneNode(deep?): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:533

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

Parameters​
ParameterType
deep?boolean
Returns​

Node

Throws​

May throw a DOMException if operations within Element#setAttributeNode or Node#appendChild (which are potentially invoked in this method) do not meet their specific constraints.

MDN Reference

compareDocumentPosition()​

compareDocumentPosition(other): number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:540

Returns a bitmask indicating the position of other relative to node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

number

contains()​

contains(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:489

Checks whether other is an inclusive descendant of this node.

MDN Reference

Parameters​
ParameterType
otherNode | null | undefined
Returns​

boolean

getRootNode()​

getRootNode(options): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:502

Searches for the root node of this node.

This behavior is slightly different from the one in the specs:

  • ignores options.composed, since ShadowRoots are unsupported, therefore always returning root.

MDN Reference

Parameters​
ParameterType
optionsGetRootNodeOptions
Returns​

Node

See​

hasChildNodes()​

hasChildNodes(): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:547

Returns whether node has children.

MDN Reference

Returns​

boolean

insertBefore()​

insertBefore(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:550

MDN Reference

Parameters​
ParameterType
nodeNode
childNode | null
Returns​

Node

isDefaultNamespace()​

isDefaultNamespace(namespace): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:553

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

boolean

isEqualNode()​

isEqualNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:514

Checks whether the given node is equal to this node.

Two nodes are equal when they have the same type, defining characteristics (for the type), and the same childNodes. The comparison is iterative to avoid stack overflows on deeply nested trees. Attribute nodes of each Element pair are also compared iteratively.

Parameters​
ParameterType
otherNode
Returns​

boolean

See​

isSameNode()​

isSameNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:521

Checks whether the given node is this node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

boolean

isSupported()​

isSupported(feature, version): true

Defined in: node_modules/@xmldom/xmldom/index.d.ts:568

Checks whether the DOM implementation implements a specific feature and its version.

Parameters​
ParameterTypeDescription
featurestringThe package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation.
versionstringThis is the version number of the package name to test.
Returns​

true

Deprecated​

Since DOMImplementation.hasFeature is deprecated and always returns true.

Since​

Introduced in DOM Level 2

See​

DOMImplementation.hasFeature

lookupNamespaceURI()​

lookupNamespaceURI(prefix): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:571

MDN Reference

Parameters​
ParameterType
prefixstring | null
Returns​

string | null

lookupPrefix()​

lookupPrefix(namespace): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:574

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

string | null

normalize()​

normalize(): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:582

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

MDN Reference

Returns​

void

removeChild()​

removeChild(child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:585

MDN Reference

Parameters​
ParameterType
childNode
Returns​

Node

replaceChild()​

replaceChild(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:588

MDN Reference

Parameters​
ParameterType
nodeNode
childNode
Returns​

Node


Text​

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1051

The textual content of Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children.

MDN Reference

Extends​

  • CharacterData

Properties​

ATTRIBUTE_NODE​

readonly ATTRIBUTE_NODE: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:592

Inherited from​

CharacterData.ATTRIBUTE_NODE

baseURI​

readonly baseURI: "about:blank"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:396

Always returns about:blank currently.

MDN Reference

Inherited from​

CharacterData.baseURI

CDATA_SECTION_NODE​

readonly CDATA_SECTION_NODE: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:596

node is a CDATASection node.

Inherited from​

CharacterData.CDATA_SECTION_NODE

childNodes​

readonly childNodes: NodeList

Defined in: node_modules/@xmldom/xmldom/index.d.ts:374

Returns the children.

MDN Reference

Inherited from​

CharacterData.childNodes

columnNumber?​

optional columnNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:479

One based column position inside the parsed source, if the locator was not disabled.

Inherited from​

CharacterData.columnNumber

COMMENT_NODE​

readonly COMMENT_NODE: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:602

node is a Comment node.

Inherited from​

CharacterData.COMMENT_NODE

data​

data: string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1019

MDN Reference

Inherited from​

CharacterData.data

DOCUMENT_FRAGMENT_NODE​

readonly DOCUMENT_FRAGMENT_NODE: 11

Defined in: node_modules/@xmldom/xmldom/index.d.ts:608

node is a DocumentFragment node.

Inherited from​

CharacterData.DOCUMENT_FRAGMENT_NODE

DOCUMENT_NODE​

readonly DOCUMENT_NODE: 9

Defined in: node_modules/@xmldom/xmldom/index.d.ts:604

node is a document.

Inherited from​

CharacterData.DOCUMENT_NODE

DOCUMENT_POSITION_CONTAINED_BY​

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Defined in: node_modules/@xmldom/xmldom/index.d.ts:619

Set when other is a descendant of node.

Inherited from​

CharacterData.DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINS​

readonly DOCUMENT_POSITION_CONTAINS: 8

Defined in: node_modules/@xmldom/xmldom/index.d.ts:617

Set when other is an ancestor of node.

Inherited from​

CharacterData.DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_DISCONNECTED​

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:611

Set when node and other are not in the same tree.

Inherited from​

CharacterData.DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_FOLLOWING​

readonly DOCUMENT_POSITION_FOLLOWING: 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:615

Set when other is following node.

Inherited from​

CharacterData.DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC​

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

Defined in: node_modules/@xmldom/xmldom/index.d.ts:620

Inherited from​

CharacterData.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_PRECEDING​

readonly DOCUMENT_POSITION_PRECEDING: 2

Defined in: node_modules/@xmldom/xmldom/index.d.ts:613

Set when other is preceding node.

Inherited from​

CharacterData.DOCUMENT_POSITION_PRECEDING

DOCUMENT_TYPE_NODE​

readonly DOCUMENT_TYPE_NODE: 10

Defined in: node_modules/@xmldom/xmldom/index.d.ts:606

node is a doctype.

Inherited from​

CharacterData.DOCUMENT_TYPE_NODE

ELEMENT_NODE​

readonly ELEMENT_NODE: 1

Defined in: node_modules/@xmldom/xmldom/index.d.ts:591

node is an element.

Inherited from​

CharacterData.ELEMENT_NODE

ENTITY_NODE​

readonly ENTITY_NODE: 6

Defined in: node_modules/@xmldom/xmldom/index.d.ts:598

Inherited from​

CharacterData.ENTITY_NODE

ENTITY_REFERENCE_NODE​

readonly ENTITY_REFERENCE_NODE: 5

Defined in: node_modules/@xmldom/xmldom/index.d.ts:597

Inherited from​

CharacterData.ENTITY_REFERENCE_NODE

firstChild​

readonly firstChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:380

Returns the first child.

MDN Reference

Inherited from​

CharacterData.firstChild

isConnected​

readonly isConnected: boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:402

Returns true if this node is inside of a document or is the document node itself.

MDN Reference

Inherited from​

CharacterData.isConnected

lastChild​

readonly lastChild: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:386

Returns the last child.

MDN Reference

Inherited from​

CharacterData.lastChild

length​

readonly length: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1021

MDN Reference

Inherited from​

CharacterData.length

lineNumber?​

optional lineNumber: number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:474

Zero based line position inside the parsed source, if the locator was not disabled.

Inherited from​

CharacterData.lineNumber

localName​

localName: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:390

The local part of the qualified name of this node.

Inherited from​

CharacterData.localName

namespaceURI​

readonly namespaceURI: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:406

The namespace URI of this node.

Inherited from​

CharacterData.namespaceURI

nextSibling​

readonly nextSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:412

Returns the next sibling.

MDN Reference

Inherited from​

CharacterData.nextSibling

nodeName​

nodeName: "#text" | "#cdata-section"

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1052

Returns a string appropriate for the type of node.

MDN Reference

Overrides​

CharacterData.nodeName

nodeType​

nodeType: 3 | 4

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1053

Returns the type of node.

MDN Reference

Overrides​

CharacterData.nodeType

nodeValue​

nodeValue: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:426

MDN Reference

Inherited from​

CharacterData.nodeValue

NOTATION_NODE​

readonly NOTATION_NODE: 12

Defined in: node_modules/@xmldom/xmldom/index.d.ts:609

Inherited from​

CharacterData.NOTATION_NODE

ownerDocument​

readonly ownerDocument: Document

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1022

Returns the node document. Returns null for documents.

MDN Reference

Inherited from​

CharacterData.ownerDocument

parentElement​

readonly parentElement: Element | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:444

Returns the parent Node if it is of type Element, otherwise null.

MDN Reference

Inherited from​

CharacterData.parentElement

parentNode​

readonly parentNode: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:438

Returns the parent.

MDN Reference

Inherited from​

CharacterData.parentNode

prefix​

prefix: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:448

The prefix of the namespace for this node.

Inherited from​

CharacterData.prefix

previousSibling​

readonly previousSibling: Node | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:454

Returns the previous sibling.

MDN Reference

Inherited from​

CharacterData.previousSibling

PROCESSING_INSTRUCTION_NODE​

readonly PROCESSING_INSTRUCTION_NODE: 7

Defined in: node_modules/@xmldom/xmldom/index.d.ts:600

node is a ProcessingInstruction node.

Inherited from​

CharacterData.PROCESSING_INSTRUCTION_NODE

TEXT_NODE​

readonly TEXT_NODE: 3

Defined in: node_modules/@xmldom/xmldom/index.d.ts:594

node is a Text node.

Inherited from​

CharacterData.TEXT_NODE

textContent​

textContent: string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:468

The text content of this node and its descendants.

For Element and DocumentFragment nodes, returns the concatenation of the nodeValue of every descendant text node, excluding processing instruction and comment nodes. For all other node types, returns nodeValue.

Setting textContent on an element or document fragment replaces all child nodes with a single text node; on other nodes it sets data, value, and nodeValue directly. MDN Reference

See​

https://dom.spec.whatwg.org/#dom-node-textcontent

Inherited from​

CharacterData.textContent

Methods​

appendChild()​

appendChild(node): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:482

MDN Reference

Parameters​
ParameterType
nodeNode
Returns​

Node

Inherited from​

CharacterData.appendChild

appendData()​

appendData(data): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1024

MDN Reference

Parameters​
ParameterType
datastring
Returns​

void

Inherited from​

CharacterData.appendData

cloneNode()​

cloneNode(deep?): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:533

Returns a copy of node. If deep is true, the copy also includes the node's descendants.

Parameters​
ParameterType
deep?boolean
Returns​

Node

Throws​

May throw a DOMException if operations within Element#setAttributeNode or Node#appendChild (which are potentially invoked in this method) do not meet their specific constraints.

MDN Reference

Inherited from​

CharacterData.cloneNode

compareDocumentPosition()​

compareDocumentPosition(other): number

Defined in: node_modules/@xmldom/xmldom/index.d.ts:540

Returns a bitmask indicating the position of other relative to node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

number

Inherited from​

CharacterData.compareDocumentPosition

contains()​

contains(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:489

Checks whether other is an inclusive descendant of this node.

MDN Reference

Parameters​
ParameterType
otherNode | null | undefined
Returns​

boolean

Inherited from​

CharacterData.contains

deleteData()​

deleteData(offset, count): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1026

MDN Reference

Parameters​
ParameterType
offsetnumber
countnumber
Returns​

void

Inherited from​

CharacterData.deleteData

getRootNode()​

getRootNode(options): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:502

Searches for the root node of this node.

This behavior is slightly different from the one in the specs:

  • ignores options.composed, since ShadowRoots are unsupported, therefore always returning root.

MDN Reference

Parameters​
ParameterType
optionsGetRootNodeOptions
Returns​

Node

See​
Inherited from​

CharacterData.getRootNode

hasChildNodes()​

hasChildNodes(): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:547

Returns whether node has children.

MDN Reference

Returns​

boolean

Inherited from​

CharacterData.hasChildNodes

insertBefore()​

insertBefore(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:550

MDN Reference

Parameters​
ParameterType
nodeNode
childNode | null
Returns​

Node

Inherited from​

CharacterData.insertBefore

insertData()​

insertData(offset, data): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1028

MDN Reference

Parameters​
ParameterType
offsetnumber
datastring
Returns​

void

Inherited from​

CharacterData.insertData

isDefaultNamespace()​

isDefaultNamespace(namespace): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:553

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

boolean

Inherited from​

CharacterData.isDefaultNamespace

isEqualNode()​

isEqualNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:514

Checks whether the given node is equal to this node.

Two nodes are equal when they have the same type, defining characteristics (for the type), and the same childNodes. The comparison is iterative to avoid stack overflows on deeply nested trees. Attribute nodes of each Element pair are also compared iteratively.

Parameters​
ParameterType
otherNode
Returns​

boolean

See​
Inherited from​

CharacterData.isEqualNode

isSameNode()​

isSameNode(other): boolean

Defined in: node_modules/@xmldom/xmldom/index.d.ts:521

Checks whether the given node is this node.

MDN Reference

Parameters​
ParameterType
otherNode
Returns​

boolean

Inherited from​

CharacterData.isSameNode

isSupported()​

isSupported(feature, version): true

Defined in: node_modules/@xmldom/xmldom/index.d.ts:568

Checks whether the DOM implementation implements a specific feature and its version.

Parameters​
ParameterTypeDescription
featurestringThe package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation.
versionstringThis is the version number of the package name to test.
Returns​

true

Deprecated​

Since DOMImplementation.hasFeature is deprecated and always returns true.

Since​

Introduced in DOM Level 2

See​

DOMImplementation.hasFeature

Inherited from​

CharacterData.isSupported

lookupNamespaceURI()​

lookupNamespaceURI(prefix): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:571

MDN Reference

Parameters​
ParameterType
prefixstring | null
Returns​

string | null

Inherited from​

CharacterData.lookupNamespaceURI

lookupPrefix()​

lookupPrefix(namespace): string | null

Defined in: node_modules/@xmldom/xmldom/index.d.ts:574

MDN Reference

Parameters​
ParameterType
namespacestring | null
Returns​

string | null

Inherited from​

CharacterData.lookupPrefix

normalize()​

normalize(): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:582

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.

MDN Reference

Returns​

void

Inherited from​

CharacterData.normalize

removeChild()​

removeChild(child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:585

MDN Reference

Parameters​
ParameterType
childNode
Returns​

Node

Inherited from​

CharacterData.removeChild

replaceChild()​

replaceChild(node, child): Node

Defined in: node_modules/@xmldom/xmldom/index.d.ts:588

MDN Reference

Parameters​
ParameterType
nodeNode
childNode
Returns​

Node

Inherited from​

CharacterData.replaceChild

replaceData()​

replaceData(offset, count, data): void

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1030

MDN Reference

Parameters​
ParameterType
offsetnumber
countnumber
datastring
Returns​

void

Inherited from​

CharacterData.replaceData

splitText()​

splitText(offset): Text

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1059

Splits data at the given offset and returns the remainder as Text node.

MDN Reference

Parameters​
ParameterType
offsetnumber
Returns​

Text

substringData()​

substringData(offset, count): string

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1032

MDN Reference

Parameters​
ParameterType
offsetnumber
countnumber
Returns​

string

Inherited from​

CharacterData.substringData


AdapterOptions<A>​

AdapterOptions<A> = A extends EpubStorageAdapterClass<infer Opts> ? Opts : object

Defined in: libraries/epub/src/adapters/interface.ts:110

Type Parameters​

Type Parameter
A

ArchiveSource​

ArchiveSource = string | Uint8Array | Blob

Defined in: libraries/epub/src/adapters/interface.ts:12


Attr​

Attr = InstanceOf<Attr>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:664

A DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types.

MDN Reference


Document​

Document = InstanceOf<Document>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1188


DocumentType​

DocumentType = InstanceOf<DocumentFragment>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:1431


Element​

Element = InstanceOf<Element>

Defined in: node_modules/@xmldom/xmldom/index.d.ts:842

Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.

MDN Reference


EpubInstanceFor<A>​

EpubInstanceFor<A> = A["capabilities"]["writable"] extends true ? Epub : EpubReader

Defined in: libraries/epub/src/index.tsx:3384

Resolves to Epub for writable adapters, EpubReader for read-only ones.

The conditional pivots on capabilities.writable, which must be a literal true/false on the adapter class (use as const) for inference to work.

Type Parameters​

Type Parameter
A extends EpubStorageAdapterClass

EpubMetadata​

EpubMetadata = MetadataEntry[]

Defined in: libraries/epub/src/index.tsx:136


EpubReader​

EpubReader = Pick<Epub, "storage" | "findMetadataItem" | "findAllMetadataItems" | "resolveHref" | "readFileContents" | "readItemContents" | "readXhtmlItemContents" | "discardAndClose" | Extract<keyof Epub, `get${string}`>> & Disposable

Defined in: libraries/epub/src/index.tsx:234

Read-only view of an EPUB Returned by Epub.using(MemoryAdapter).from(...) and by Epub.from(path, { readonly: true })


EpubStorageKind​

EpubStorageKind = "tmp-dir" | "in-memory" | string & object

Defined in: libraries/epub/src/adapters/interface.ts:10

Pluggable storage backend for an Epub instance

Built-in adapters:

  • TmpFsAdapter extracts the archive to a tmp directory and supports the full read/write/save/upgrade
  • MemoryAdapter keeps an in-memory zip handle and supports reads only

InMemoryEpubReader​

InMemoryEpubReader = EpubReader & object

Defined in: libraries/epub/src/index.tsx:252

Readonly Epub-instance backed by an in-memory zip handle Returned by Epub.using(MemoryAdapter).from(...)

Type Declaration​

storage​

readonly storage: "in-memory"


ManifestItem​

ManifestItem = object

Defined in: libraries/epub/src/index.tsx:119

Properties​

fallback?​

optional fallback: string

Defined in: libraries/epub/src/index.tsx:124

href​

href: string

Defined in: libraries/epub/src/index.tsx:121

id​

id: string

Defined in: libraries/epub/src/index.tsx:120

mediaOverlay?​

optional mediaOverlay: string

Defined in: libraries/epub/src/index.tsx:125

mediaType?​

optional mediaType: string

Defined in: libraries/epub/src/index.tsx:123

properties?​

optional properties: string[]

Defined in: libraries/epub/src/index.tsx:126

title?​

optional title: string

Defined in: libraries/epub/src/index.tsx:122


MetadataEntry​

MetadataEntry = object

Defined in: libraries/epub/src/index.tsx:129

Properties​

id?​

optional id: string

Defined in: libraries/epub/src/index.tsx:130

properties​

properties: Record<string, string>

Defined in: libraries/epub/src/index.tsx:132

type​

type: string

Defined in: libraries/epub/src/index.tsx:131

value​

value: string | undefined

Defined in: libraries/epub/src/index.tsx:133


NavigationList = NavigationItem[]

Defined in: libraries/epub/src/index.tsx:208


Node​

Node = InstanceOf<Node> & object

Defined in: node_modules/@xmldom/xmldom/index.d.ts:368

Type Declaration​

ATTRIBUTE_NODE​

readonly ATTRIBUTE_NODE: 2

CDATA_SECTION_NODE​

readonly CDATA_SECTION_NODE: 4

node is a CDATASection node.

COMMENT_NODE​

readonly COMMENT_NODE: 8

node is a Comment node.

DOCUMENT_FRAGMENT_NODE​

readonly DOCUMENT_FRAGMENT_NODE: 11

node is a DocumentFragment node.

DOCUMENT_NODE​

readonly DOCUMENT_NODE: 9

node is a document.

DOCUMENT_POSITION_CONTAINED_BY​

readonly DOCUMENT_POSITION_CONTAINED_BY: 16

Set when other is a descendant of node.

DOCUMENT_POSITION_CONTAINS​

readonly DOCUMENT_POSITION_CONTAINS: 8

Set when other is an ancestor of node.

DOCUMENT_POSITION_DISCONNECTED​

readonly DOCUMENT_POSITION_DISCONNECTED: 1

Set when node and other are not in the same tree.

DOCUMENT_POSITION_FOLLOWING​

readonly DOCUMENT_POSITION_FOLLOWING: 4

Set when other is following node.

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC​

readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32

DOCUMENT_POSITION_PRECEDING​

readonly DOCUMENT_POSITION_PRECEDING: 2

Set when other is preceding node.

DOCUMENT_TYPE_NODE​

readonly DOCUMENT_TYPE_NODE: 10

node is a doctype.

ELEMENT_NODE​

readonly ELEMENT_NODE: 1

node is an element.

ENTITY_NODE​

readonly ENTITY_NODE: 6

ENTITY_REFERENCE_NODE​

readonly ENTITY_REFERENCE_NODE: 5

NOTATION_NODE​

readonly NOTATION_NODE: 12

PROCESSING_INSTRUCTION_NODE​

readonly PROCESSING_INSTRUCTION_NODE: 7

node is a ProcessingInstruction node.

TEXT_NODE​

readonly TEXT_NODE: 3

node is a Text node.


Text​

**