@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();
Link
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
| Parameter | Type | Default value |
|---|---|---|
adapterClass | EpubStorageAdapterClass | undefined |
adapter | EpubStorageAdapter | undefined |
inputPath | string | undefined | undefined |
readonlyOverride | boolean | false |
Returns
Properties
adapter
protectedadapter:EpubStorageAdapter
Defined in: libraries/epub/src/index.tsx:417
adapterClass
protectedadapterClass:EpubStorageAdapterClass
Defined in: libraries/epub/src/index.tsx:416
inputPath
protectedinputPath:string|undefined
Defined in: libraries/epub/src/index.tsx:418
readonlyOverride
protectedreadonlyOverride:boolean=false
Defined in: libraries/epub/src/index.tsx:419
storage
readonlystorage: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
| Parameter | Type |
|---|---|
collection | Collection |
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
| Parameter | Type |
|---|---|
contributor | DcCreator |
index? | number |
Returns
Promise<void>
Link
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
| Parameter | Type | Default value |
|---|---|---|
creator | DcCreator | undefined |
index? | number | undefined |
type? | "creator" | "contributor" | "creator" |
Returns
Promise<void>
Link
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
| Parameter | Type | Description |
|---|---|---|
item | ManifestItem | - |
contents | Document | The 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>
Link
https://www.w3.org/TR/epub-33/#sec-pkg-manifest
Link
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
| Parameter | Type | Description |
|---|---|---|
item | ManifestItem | - |
contents | string | The 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>
Link
https://www.w3.org/TR/epub-33/#sec-pkg-manifest
Link
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
| Parameter | Type | Description |
|---|---|---|
item | ManifestItem | - |
contents | Uint8Array | The new contents. May be either a parsed XML tree or a unicode string, as determined by the as argument. |
Returns
Promise<void>
Link
https://www.w3.org/TR/epub-33/#sec-pkg-manifest
Link
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
| Parameter | Type |
|---|---|
entry | MetadataEntry |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
manifestId | string |
index? | number |
Returns
Promise<void>
Link
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
| Parameter | Type | Description |
|---|---|---|
subject | string | DcSubject | May be a string representing just a schema-less subject name, or a DcSubject object |
Returns
Promise<void>
Link
https://www.w3.org/TR/epub-33/#sec-opf-dcsubject
copy()
copy(
path?):Promise<Epub>
Defined in: libraries/epub/src/index.tsx:512
Parameters
| Parameter | Type |
|---|---|
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
| Parameter | Type | Description |
|---|---|---|
body | Node[] | The XML nodes to place in the body of the document |
head? | Node[] | Optional - the XMl nodes to place in the head |
language? | Locale | Optional - 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
| Parameter | Type | Description |
|---|---|---|
root | Element | The XML node to use as the document element |
Returns
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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
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">
Link
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[]>
Link
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>
Link
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>
Link
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
| Parameter | Type | Default value |
|---|---|---|
type | "creator" | "contributor" | "creator" |
Returns
Promise<DcCreator[]>
Link
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>
Link
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[]>
Link
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
| Parameter | Type |
|---|---|
id | string |
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
| Parameter | Type |
|---|---|
__namedParameters | { resolveToRoot?: boolean; } |
__namedParameters.resolveToRoot? | boolean |
Returns
Promise<Navigation | null>
Link
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>
Link
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">
Link
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>>
Link
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>
Link
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>
Link
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
| Parameter | Type | Default value |
|---|---|---|
lock | boolean | true |
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>>
Link
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>
Link
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
| Parameter | Type |
|---|---|
__namedParameters | { resolveToRoot?: boolean; } |
__namedParameters.resolveToRoot? | boolean |
Returns
Promise<Navigation | null>
Link
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>
Link
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[]>
Link
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[]>
Link
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)[]>
Link
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>
Link
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
| Parameter | Type |
|---|---|
__namedParameters | { resolveToRoot?: boolean; } |
__namedParameters.resolveToRoot? | boolean |
Returns
Promise<Navigation | null>
Link
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
| Parameter | Type | Default value |
|---|---|---|
expanded | boolean | false |
Returns
Promise<string | null>
Link
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[]>
Link
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>
Link
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>
Link
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>
Link
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
| Parameter | Type | Description |
|---|---|---|
href | string | The 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
| Parameter | Type | Description |
|---|---|---|
href | string | The href of the file to retrieve |
relativeTo | string | 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
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the manifest item to retrieve |
Returns
Promise<Uint8Array<ArrayBufferLike>>
Link
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
| Parameter | Type | Description |
|---|---|---|
id | string | The 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>
Link
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
| Parameter | Type | Description |
|---|---|---|
id | string | The 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>
Link
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
| Parameter | Type | Description |
|---|---|---|
id | string | The 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>
Link
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
| Parameter | Type |
|---|---|
index | number |
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
| Parameter | Type |
|---|---|
index | number |
Returns
Promise<void>
Link
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
| Parameter | Type | Default value |
|---|---|---|
index | number | undefined |
type | "creator" | "contributor" | "creator" |
Returns
Promise<void>
Link
https://www.w3.org/TR/epub-33/#sec-opf-dccreator
removeManifestItem()
removeManifestItem(
id):Promise<void>
Defined in: libraries/epub/src/index.tsx:2918
Parameters
| Parameter | Type |
|---|---|
id | string |
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
| Parameter | Type | Description |
|---|---|---|
predicate | (entry) => boolean | Calls predicate once for each metadata entry, removing any for which it returns true |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
index | number |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
index | number |
Returns
Promise<void>
Link
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
| Parameter | Type | Description |
|---|---|---|
predicate | (entry) => boolean | Calls predicate once for each metadata entry, until it finds one where predicate returns true |
entry | MetadataEntry | The new entry to replace the found entry with |
Returns
Promise<void>
Link
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
| Parameter | Type | Description |
|---|---|---|
href | string | The href to resolve |
relativeTo? | string | Optional - 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
| Parameter | Type |
|---|---|
href | string |
data | Uint8Array |
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
| Parameter | Type |
|---|---|
description | string |
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
| Parameter | Type |
|---|---|
identifier | string |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
identifiers | EpubIdentifier[] |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
locale | Locale |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
prefix | string |
uri | string |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
value | string | null |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
date | Date |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
sources | EpubSource[] |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
title | string |
Returns
Promise<void>
Link
https://www.w3.org/TR/epub-33/#sec-opf-dctitle
setTitles()
setTitles(
entries):Promise<void>
Defined in: libraries/epub/src/index.tsx:1904
Parameters
| Parameter | Type |
|---|---|
entries | object[] |
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
| Parameter | Type |
|---|---|
type | string |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
identifier | string |
Returns
Promise<void>
Link
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
| Parameter | Type |
|---|---|
id | string |
newItem | Omit<ManifestItem, "id"> |
Returns
Promise<void>
Link
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
| Parameter | Type | Description |
|---|---|---|
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
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the manifest item to write new contents for |
contents | Uint8Array | The new contents. May be either a utf-8 encoded string or a byte array, as determined by the encoding |
Returns
Promise<void>
Link
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
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the manifest item to write new contents for |
contents | string | The 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>
Link
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
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the manifest item to write new contents for |
contents | Document | The new contents. Must be a parsed XML tree. |
Returns
Promise<void>
Link
https://www.w3.org/TR/epub-33/#sec-xhtml
assertEpub3()
staticassertEpub3(epub):Promise<void>
Defined in: libraries/epub/src/index.tsx:502
Parameters
| Parameter | Type |
|---|---|
epub | Epub |
Returns
Promise<void>
create()
staticcreate(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
| Parameter | Type | Default value | Description |
|---|---|---|---|
path | string | undefined | - |
dublinCore | DublinCore | undefined | Core metadata terms |
additionalMetadata | EpubMetadata | [] | An array of additional metadata entries |
Returns
Promise<Epub>
formatSmilDuration()
staticformatSmilDuration(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
| Parameter | Type |
|---|---|
duration | number |
Returns
string
Link
https://www.w3.org/TR/epub-33/#sec-duration
from()
Call Signature
staticfrom(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
| Parameter | Type |
|---|---|
pathOrData | ArchiveSource |
Returns
Promise<Epub>
Throws
when the archive is not a valid EPUB 3
Call Signature
staticfrom(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
| Parameter | Type |
|---|---|
pathOrData | ArchiveSource |
options | FromOptions & object |
Returns
Promise<EpubReader>
Throws
when the archive is not a valid EPUB 3
Call Signature
staticfrom(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
| Parameter | Type |
|---|---|
pathOrData | ArchiveSource |
options? | FromOptions |
Returns
Promise<Epub | EpubReader>
Throws
when the archive is not a valid EPUB 3
upgrade()
staticupgrade(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
| Parameter | Type |
|---|---|
path | string |
options | Epub2UpgradeOptions |
Returns
Promise<Epub>
using()
staticusing<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
| Parameter | Type |
|---|---|
adapterClass | A |
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
| Parameter | Type |
|---|---|
adapterClass | A |
Returns
EpubFactory<A>
Properties
adapterClass
readonlyadapterClass: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
| Parameter | Type | Default value |
|---|---|---|
path | string | undefined |
__namedParameters | DublinCore | undefined |
additionalMetadata | EpubMetadata | [] |
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
| Parameter | Type |
|---|---|
source | ArchiveSource |
options | FromOptions & 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
| Parameter | Type |
|---|---|
source | ArchiveSource |
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
| Parameter | Type |
|---|---|
source | ArchiveSource |
options | AdapterOptions<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
| Parameter | Type |
|---|---|
path | string |
options | Epub2UpgradeOptions |
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
| Parameter | Type |
|---|---|
message? | string |
Returns
Inherited from
Error.constructor
Constructor
new EpubReadOnlyError(
message?,options?):EpubReadOnlyError
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080
Parameters
| Parameter | Type |
|---|---|
message? | string |
options? | ErrorOptions |
Returns
Inherited from
Error.constructor
Properties
cause?
optionalcause: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?
optionalstack:string
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1076
Inherited from
Error.stack
stackTraceLimit
staticstackTraceLimit: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()
staticcaptureStackTrace(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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTrace
isError()
staticisError(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
| Parameter | Type |
|---|---|
error | unknown |
Returns
error is Error
Inherited from
Error.isError
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
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
| Parameter | Type |
|---|---|
message? | string |
Returns
Inherited from
Error.constructor
Constructor
new EpubVersionError(
message?,options?):EpubVersionError
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1080
Parameters
| Parameter | Type |
|---|---|
message? | string |
options? | ErrorOptions |
Returns
Inherited from
Error.constructor
Properties
cause?
optionalcause: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?
optionalstack:string
Defined in: node_modules/@typescript/old/lib/lib.es5.d.ts:1076
Inherited from
Error.stack
stackTraceLimit
staticstackTraceLimit: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()
staticcaptureStackTrace(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
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTrace
isError()
staticisError(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
| Parameter | Type |
|---|---|
error | unknown |
Returns
error is Error
Inherited from
Error.isError
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
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
readonlystaticcapabilities:object
Defined in: libraries/epub/src/adapters/memory.ts:32
writable
readonlywritable:false=false
kind
readonlystatickind:"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
| Parameter | Type |
|---|---|
entry | string |
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
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
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<boolean>
Implementation of
read()
Call Signature
read(
entry):Promise<Uint8Array<ArrayBufferLike>>
Defined in: libraries/epub/src/adapters/memory.ts:60
Parameters
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<Uint8Array<ArrayBufferLike>>
Implementation of
Call Signature
read(
entry,encoding):Promise<string>
Defined in: libraries/epub/src/adapters/memory.ts:61
Parameters
| Parameter | Type |
|---|---|
entry | string |
encoding | "utf-8" |
Returns
Promise<string>
Implementation of
init()
staticinit(source,opts):Promise<MemoryAdapter>
Defined in: libraries/epub/src/adapters/memory.ts:34
Parameters
| Parameter | Type |
|---|---|
source | ArchiveSource |
opts | MemoryAdapterOptions |
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
readonlystaticcapabilities:object
Defined in: libraries/epub/src/adapters/tmpfs.ts:59
writable
readonlywritable:true=true
kind
readonlystatickind:"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
| Parameter | Type |
|---|---|
entry | string |
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
duplicate()
duplicate():
Promise<TmpFsAdapter>
Defined in: libraries/epub/src/adapters/tmpfs.ts:154
Required for Epub.copy
Returns
Promise<TmpFsAdapter>
Implementation of
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
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<boolean>
Implementation of
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
read()
Call Signature
read(
entry):Promise<Uint8Array<ArrayBufferLike>>
Defined in: libraries/epub/src/adapters/tmpfs.ts:96
Parameters
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<Uint8Array<ArrayBufferLike>>
Implementation of
Call Signature
read(
entry,encoding):Promise<string>
Defined in: libraries/epub/src/adapters/tmpfs.ts:97
Parameters
| Parameter | Type |
|---|---|
entry | string |
encoding | "utf-8" |
Returns
Promise<string>
Implementation of
remove()
remove(
entry):Promise<void>
Defined in: libraries/epub/src/adapters/tmpfs.ts:114
Required for removeManifestItem / setCoverImage replacement
Parameters
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<void>
Implementation of
serialize()
serialize(
targetPath):Promise<void>
Defined in: libraries/epub/src/adapters/tmpfs.ts:165
Required for Epub.saveAndClose
Parameters
| Parameter | Type |
|---|---|
targetPath | string |
Returns
Promise<void>
Implementation of
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
| Parameter | Type |
|---|---|
entry | string |
data | Uint8Array |
Returns
Promise<void>
Implementation of
Call Signature
write(
entry,data,encoding):Promise<void>
Defined in: libraries/epub/src/adapters/tmpfs.ts:103
Parameters
| Parameter | Type |
|---|---|
entry | string |
data | string |
encoding | "utf-8" |
Returns
Promise<void>
Implementation of
init()
staticinit(source):Promise<TmpFsAdapter>
Defined in: libraries/epub/src/adapters/tmpfs.ts:61
Parameters
| Parameter | Type |
|---|---|
source | ArchiveSource |
Returns
Promise<TmpFsAdapter>
initEmpty()
staticinitEmpty():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.
Extends
Properties
ATTRIBUTE_NODE
readonlyATTRIBUTE_NODE:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:592
Inherited from
Node.ATTRIBUTE_NODE
baseURI
readonlybaseURI:"about:blank"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:396
Always returns about:blank currently.
Inherited from
Node.baseURI
CDATA_SECTION_NODE
readonlyCDATA_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
readonlychildNodes:NodeList
Defined in: node_modules/@xmldom/xmldom/index.d.ts:374
Returns the children.
Inherited from
Node.childNodes
columnNumber?
optionalcolumnNumber: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
readonlyCOMMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32
Defined in: node_modules/@xmldom/xmldom/index.d.ts:620
Inherited from
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_PRECEDING
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyELEMENT_NODE:1
Defined in: node_modules/@xmldom/xmldom/index.d.ts:591
node is an element.
Inherited from
Node.ELEMENT_NODE
ENTITY_NODE
readonlyENTITY_NODE:6
Defined in: node_modules/@xmldom/xmldom/index.d.ts:598
Inherited from
Node.ENTITY_NODE
ENTITY_REFERENCE_NODE
readonlyENTITY_REFERENCE_NODE:5
Defined in: node_modules/@xmldom/xmldom/index.d.ts:597
Inherited from
Node.ENTITY_REFERENCE_NODE
firstChild
readonlyfirstChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:380
Returns the first child.
Inherited from
Node.firstChild
isConnected
readonlyisConnected: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.
Inherited from
Node.isConnected
lastChild
readonlylastChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:386
Returns the last child.
Inherited from
Node.lastChild
lineNumber?
optionallineNumber: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
readonlyname:string
Defined in: node_modules/@xmldom/xmldom/index.d.ts:667
namespaceURI
readonlynamespaceURI:string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:669
Overrides
Node.namespaceURI
nextSibling
readonlynextSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:412
Returns the next sibling.
Inherited from
Node.nextSibling
nodeName
readonlynodeName:string
Defined in: node_modules/@xmldom/xmldom/index.d.ts:418
Returns a string appropriate for the type of node.
Inherited from
Node.nodeName
nodeType
readonlynodeType:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:665
Returns the type of node.
Overrides
Node.nodeType
nodeValue
nodeValue:
string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:426
Inherited from
Node.nodeValue
NOTATION_NODE
readonlyNOTATION_NODE:12
Defined in: node_modules/@xmldom/xmldom/index.d.ts:609
Inherited from
Node.NOTATION_NODE
ownerDocument
readonlyownerDocument:Document
Defined in: node_modules/@xmldom/xmldom/index.d.ts:670
Returns the node document. Returns null for documents.
Overrides
Node.ownerDocument
ownerElement
readonlyownerElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:672
parentElement
readonlyparentElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:444
Returns the parent Node if it is of type Element, otherwise null.
Inherited from
Node.parentElement
parentNode
readonlyparentNode:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:438
Returns the parent.
Inherited from
Node.parentNode
prefix
readonlyprefix:string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:674
Overrides
Node.prefix
previousSibling
readonlypreviousSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:454
Returns the previous sibling.
Inherited from
Node.previousSibling
PROCESSING_INSTRUCTION_NODE
readonlyPROCESSING_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
readonlyspecified:true
Defined in: node_modules/@xmldom/xmldom/index.d.ts:679
Deprecated
TEXT_NODE
readonlyTEXT_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
Methods
appendChild()
appendChild(
node):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:482
Parameters
| Parameter | Type |
|---|---|
node | Node |
Returns
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
| Parameter | Type |
|---|---|
deep? | boolean |
Returns
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.
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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.
Parameters
| Parameter | Type |
|---|---|
other | Node | 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, sinceShadowRoots are unsupported, therefore always returning root.
Parameters
| Parameter | Type |
|---|---|
options | GetRootNodeOptions |
Returns
See
- https://dom.spec.whatwg.org/#dom-node-getrootnode
- https://dom.spec.whatwg.org/#concept-shadow-including-root
Inherited from
Node.getRootNode
hasChildNodes()
hasChildNodes():
boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:547
Returns whether node has children.
Returns
boolean
Inherited from
Node.hasChildNodes
insertBefore()
insertBefore(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:550
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node | null |
Returns
Inherited from
Node.insertBefore
isDefaultNamespace()
isDefaultNamespace(
namespace):boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:553
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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
| Parameter | Type |
|---|---|
other | Node |
Returns
boolean
See
- https://dom.spec.whatwg.org/#concept-node-equals
- https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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
| Parameter | Type | Description |
|---|---|---|
feature | string | The package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation. |
version | string | This 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
Parameters
| Parameter | Type |
|---|---|
prefix | string | null |
Returns
string | null
Inherited from
Node.lookupNamespaceURI
lookupPrefix()
lookupPrefix(
namespace):string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:574
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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.
Returns
void
Inherited from
Node.normalize
removeChild()
removeChild(
child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:585
Parameters
| Parameter | Type |
|---|---|
child | Node |
Returns
Inherited from
Node.removeChild
replaceChild()
replaceChild(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:588
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node |
Returns
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?
optionalposition:string
Defined in: libraries/epub/src/index.tsx:198
type?
optionaltype:string
Defined in: libraries/epub/src/index.tsx:197
DcCreator
Defined in: libraries/epub/src/index.tsx:176
Properties
alternateScripts?
optionalalternateScripts:AlternateScript[]
Defined in: libraries/epub/src/index.tsx:181
fileAs?
optionalfileAs:string
Defined in: libraries/epub/src/index.tsx:180
name
name:
string
Defined in: libraries/epub/src/index.tsx:177
role?
optionalrole:string
Defined in: libraries/epub/src/index.tsx:178
roleScheme?
optionalroleScheme: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
readonlyATTRIBUTE_NODE:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:592
Inherited from
Node.ATTRIBUTE_NODE
baseURI
readonlybaseURI:"about:blank"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:396
Always returns about:blank currently.
Inherited from
Node.baseURI
CDATA_SECTION_NODE
readonlyCDATA_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
readonlychildNodes:NodeList
Defined in: node_modules/@xmldom/xmldom/index.d.ts:374
Returns the children.
Inherited from
Node.childNodes
children
readonlychildren:LiveNodeList<Element>
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1226
Returns a live collection of the direct child elements of this document.
See
https://dom.spec.whatwg.org/#dom-parentnode-children
columnNumber?
optionalcolumnNumber: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
readonlyCOMMENT_NODE:8
Defined in: node_modules/@xmldom/xmldom/index.d.ts:602
node is a Comment node.
Inherited from
Node.COMMENT_NODE
contentType
readonlycontentType: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
- https://dom.spec.whatwg.org/#concept-document-content-type
- DOMImplementation
- MIME_TYPE
doctype
readonlydoctype:DocumentType|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1211
DOCUMENT_FRAGMENT_NODE
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32
Defined in: node_modules/@xmldom/xmldom/index.d.ts:620
Inherited from
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_PRECEDING
readonlyDOCUMENT_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
readonlyDOCUMENT_TYPE_NODE:10
Defined in: node_modules/@xmldom/xmldom/index.d.ts:606
node is a doctype.
Inherited from
Node.DOCUMENT_TYPE_NODE
documentElement
readonlydocumentElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1217
Gets a reference to the root node of the document.
ELEMENT_NODE
readonlyELEMENT_NODE:1
Defined in: node_modules/@xmldom/xmldom/index.d.ts:591
node is an element.
Inherited from
Node.ELEMENT_NODE
ENTITY_NODE
readonlyENTITY_NODE:6
Defined in: node_modules/@xmldom/xmldom/index.d.ts:598
Inherited from
Node.ENTITY_NODE
ENTITY_REFERENCE_NODE
readonlyENTITY_REFERENCE_NODE:5
Defined in: node_modules/@xmldom/xmldom/index.d.ts:597
Inherited from
Node.ENTITY_REFERENCE_NODE
firstChild
readonlyfirstChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:380
Returns the first child.
Inherited from
Node.firstChild
implementation
readonlyimplementation:DOMImplementation
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1207
The implementation that created this document.
isConnected
readonlyisConnected: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.
Inherited from
Node.isConnected
lastChild
readonlylastChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:386
Returns the last child.
Inherited from
Node.lastChild
lineNumber?
optionallineNumber: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
readonlynamespaceURI:string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:406
The namespace URI of this node.
Inherited from
Node.namespaceURI
nextSibling
readonlynextSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:412
Returns the next sibling.
Inherited from
Node.nextSibling
nodeName
readonlynodeName:"#document"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1209
Returns a string appropriate for the type of node.
Overrides
Node.nodeName
nodeType
readonlynodeType:9
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1210
Returns the type of node.
Overrides
Node.nodeType
nodeValue
nodeValue:
string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:426
Inherited from
Node.nodeValue
NOTATION_NODE
readonlyNOTATION_NODE:12
Defined in: node_modules/@xmldom/xmldom/index.d.ts:609
Inherited from
Node.NOTATION_NODE
ownerDocument
readonlyownerDocument:Document
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1208
Returns the node document. Returns null for documents.
Overrides
Node.ownerDocument
parentElement
readonlyparentElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:444
Returns the parent Node if it is of type Element, otherwise null.
Inherited from
Node.parentElement
parentNode
readonlyparentNode:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:438
Returns the parent.
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
readonlypreviousSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:454
Returns the previous sibling.
Inherited from
Node.previousSibling
PROCESSING_INSTRUCTION_NODE
readonlyPROCESSING_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
readonlyTEXT_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
readonlytype:"xml"|"html"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1201
See
- https://dom.spec.whatwg.org/#concept-document-type
- DOMImplementation
Methods
appendChild()
appendChild(
node):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:482
Parameters
| Parameter | Type |
|---|---|
node | Node |
Returns
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
| Parameter | Type |
|---|---|
deep? | boolean |
Returns
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.
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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.
Parameters
| Parameter | Type |
|---|---|
other | Node | 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.
Parameters
| Parameter | Type |
|---|---|
localName | string |
Returns
createAttributeNS()
createAttributeNS(
namespace,qualifiedName):Attr
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1236
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
qualifiedName | string |
Returns
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
| Parameter | Type |
|---|---|
data | string |
Returns
CDATASection
Throws
With code INVALID_CHARACTER_ERR if data contains "]]>".
See
- https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
- https://dom.spec.whatwg.org/#dom-document-createcdatasection
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.
Parameters
| Parameter | Type |
|---|---|
data | string |
Returns
Comment
createDocumentFragment()
createDocumentFragment():
DocumentFragment
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1268
Creates a new document.
Returns
DocumentFragment
createElement()
createElement(
tagName):Element
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1270
Parameters
| Parameter | Type |
|---|---|
tagName | string |
Returns
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.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
qualifiedName | string |
Returns
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
| Parameter | Type |
|---|---|
name | string |
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
| Parameter | Type |
|---|---|
target | string |
data | string |
Returns
ProcessingInstruction
See
- https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
- https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
- https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
createTextNode()
createTextNode(
data):Text
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1351
Creates a text string from the specified value.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string | String that specifies the nodeValue property of the text node. MDN Reference |
Returns
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
| Parameter | Type |
|---|---|
elementId | string |
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
| Parameter | Type |
|---|---|
classNames | string |
Returns
LiveNodeList<Element>
See
- https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
- https://dom.spec.whatwg.org/#concept-getelementsbyclassname
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
| Parameter | Type |
|---|---|
qualifiedName | string |
Returns
LiveNodeList<Element>
See
- https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName
- https://dom.spec.whatwg.org/#concept-getelementsbytagname
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.
Parameters
| Parameter | Type |
|---|---|
namespaceURI | string | null |
localName | string |
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, sinceShadowRoots are unsupported, therefore always returning root.
Parameters
| Parameter | Type |
|---|---|
options | GetRootNodeOptions |
Returns
See
- https://dom.spec.whatwg.org/#dom-node-getrootnode
- https://dom.spec.whatwg.org/#concept-shadow-including-root
Inherited from
Node.getRootNode
hasChildNodes()
hasChildNodes():
boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:547
Returns whether node has children.
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.
Type Parameters
| Type Parameter |
|---|
T extends Node |
Parameters
| Parameter | Type |
|---|---|
node | T |
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
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node | null |
Returns
Inherited from
Node.insertBefore
isDefaultNamespace()
isDefaultNamespace(
namespace):boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:553
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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
| Parameter | Type |
|---|---|
other | Node |
Returns
boolean
See
- https://dom.spec.whatwg.org/#concept-node-equals
- https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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
| Parameter | Type | Description |
|---|---|---|
feature | string | The package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation. |
version | string | This 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
Parameters
| Parameter | Type |
|---|---|
prefix | string | null |
Returns
string | null
Inherited from
Node.lookupNamespaceURI
lookupPrefix()
lookupPrefix(
namespace):string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:574
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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.
Returns
void
Inherited from
Node.normalize
removeChild()
removeChild(
child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:585
Parameters
| Parameter | Type |
|---|---|
child | Node |
Returns
Inherited from
Node.removeChild
replaceChild()
replaceChild(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:588
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node |
Returns
Inherited from
Node.replaceChild
DocumentType
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1431
A Node containing a doctype.
Extends
Properties
ATTRIBUTE_NODE
readonlyATTRIBUTE_NODE:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:592
Inherited from
Node.ATTRIBUTE_NODE
baseURI
readonlybaseURI:"about:blank"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:396
Always returns about:blank currently.
Inherited from
Node.baseURI
CDATA_SECTION_NODE
readonlyCDATA_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
readonlychildNodes:NodeList
Defined in: node_modules/@xmldom/xmldom/index.d.ts:374
Returns the children.
Inherited from
Node.childNodes
columnNumber?
optionalcolumnNumber: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
readonlyCOMMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32
Defined in: node_modules/@xmldom/xmldom/index.d.ts:620
Inherited from
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_PRECEDING
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyELEMENT_NODE:1
Defined in: node_modules/@xmldom/xmldom/index.d.ts:591
node is an element.
Inherited from
Node.ELEMENT_NODE
ENTITY_NODE
readonlyENTITY_NODE:6
Defined in: node_modules/@xmldom/xmldom/index.d.ts:598
Inherited from
Node.ENTITY_NODE
ENTITY_REFERENCE_NODE
readonlyENTITY_REFERENCE_NODE:5
Defined in: node_modules/@xmldom/xmldom/index.d.ts:597
Inherited from
Node.ENTITY_REFERENCE_NODE
firstChild
readonlyfirstChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:380
Returns the first child.
Inherited from
Node.firstChild
internalSubset
readonlyinternalSubset: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
readonlyisConnected: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.
Inherited from
Node.isConnected
lastChild
readonlylastChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:386
Returns the last child.
Inherited from
Node.lastChild
lineNumber?
optionallineNumber: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
readonlyname: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
readonlynamespaceURI:string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:406
The namespace URI of this node.
Inherited from
Node.namespaceURI
nextSibling
readonlynextSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:412
Returns the next sibling.
Inherited from
Node.nextSibling
nodeName
readonlynodeName:string
Defined in: node_modules/@xmldom/xmldom/index.d.ts:418
Returns a string appropriate for the type of node.
Inherited from
Node.nodeName
nodeType
readonlynodeType:number
Defined in: node_modules/@xmldom/xmldom/index.d.ts:424
Returns the type of node.
Inherited from
Node.nodeType
nodeValue
nodeValue:
string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:426
Inherited from
Node.nodeValue
NOTATION_NODE
readonlyNOTATION_NODE:12
Defined in: node_modules/@xmldom/xmldom/index.d.ts:609
Inherited from
Node.NOTATION_NODE
ownerDocument
readonlyownerDocument:Document|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:432
Returns the node document. Returns null for documents.
Inherited from
Node.ownerDocument
parentElement
readonlyparentElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:444
Returns the parent Node if it is of type Element, otherwise null.
Inherited from
Node.parentElement
parentNode
readonlyparentNode:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:438
Returns the parent.
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
readonlypreviousSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:454
Returns the previous sibling.
Inherited from
Node.previousSibling
PROCESSING_INSTRUCTION_NODE
readonlyPROCESSING_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
readonlypublicId: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
readonlysystemId: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
readonlyTEXT_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
Parameters
| Parameter | Type |
|---|---|
node | Node |
Returns
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
| Parameter | Type |
|---|---|
deep? | boolean |
Returns
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.
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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.
Parameters
| Parameter | Type |
|---|---|
other | Node | 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, sinceShadowRoots are unsupported, therefore always returning root.
Parameters
| Parameter | Type |
|---|---|
options | GetRootNodeOptions |
Returns
See
- https://dom.spec.whatwg.org/#dom-node-getrootnode
- https://dom.spec.whatwg.org/#concept-shadow-including-root
Inherited from
Node.getRootNode
hasChildNodes()
hasChildNodes():
boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:547
Returns whether node has children.
Returns
boolean
Inherited from
Node.hasChildNodes
insertBefore()
insertBefore(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:550
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node | null |
Returns
Inherited from
Node.insertBefore
isDefaultNamespace()
isDefaultNamespace(
namespace):boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:553
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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
| Parameter | Type |
|---|---|
other | Node |
Returns
boolean
See
- https://dom.spec.whatwg.org/#concept-node-equals
- https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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
| Parameter | Type | Description |
|---|---|---|
feature | string | The package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation. |
version | string | This 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
Parameters
| Parameter | Type |
|---|---|
prefix | string | null |
Returns
string | null
Inherited from
Node.lookupNamespaceURI
lookupPrefix()
lookupPrefix(
namespace):string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:574
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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.
Returns
void
Inherited from
Node.normalize
removeChild()
removeChild(
child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:585
Parameters
| Parameter | Type |
|---|---|
child | Node |
Returns
Inherited from
Node.removeChild
replaceChild()
replaceChild(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:588
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node |
Returns
Inherited from
Node.replaceChild
DublinCore
Defined in: libraries/epub/src/index.tsx:184
Properties
contributors?
optionalcontributors:DcCreator[]
Defined in: libraries/epub/src/index.tsx:191
creators?
optionalcreators:DcCreator[]
Defined in: libraries/epub/src/index.tsx:190
date?
optionaldate: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?
optionalsubjects: (string|DcSubject)[]
Defined in: libraries/epub/src/index.tsx:189
title
title:
string
Defined in: libraries/epub/src/index.tsx:185
type?
optionaltype: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.
Extends
Properties
ATTRIBUTE_NODE
readonlyATTRIBUTE_NODE:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:592
Inherited from
Node.ATTRIBUTE_NODE
attributes
readonlyattributes:NamedNodeMap
Defined in: node_modules/@xmldom/xmldom/index.d.ts:846
baseURI
readonlybaseURI:"about:blank"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:396
Always returns about:blank currently.
Inherited from
Node.baseURI
CDATA_SECTION_NODE
readonlyCDATA_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
readonlychildNodes:NodeList
Defined in: node_modules/@xmldom/xmldom/index.d.ts:374
Returns the children.
Inherited from
Node.childNodes
children
readonlychildren:LiveNodeList<Element>
Defined in: node_modules/@xmldom/xmldom/index.d.ts:861
Returns a live collection of the direct child elements of this element.
See
https://dom.spec.whatwg.org/#dom-parentnode-children
columnNumber?
optionalcolumnNumber: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
readonlyCOMMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32
Defined in: node_modules/@xmldom/xmldom/index.d.ts:620
Inherited from
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_PRECEDING
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyELEMENT_NODE:1
Defined in: node_modules/@xmldom/xmldom/index.d.ts:591
node is an element.
Inherited from
Node.ELEMENT_NODE
ENTITY_NODE
readonlyENTITY_NODE:6
Defined in: node_modules/@xmldom/xmldom/index.d.ts:598
Inherited from
Node.ENTITY_NODE
ENTITY_REFERENCE_NODE
readonlyENTITY_REFERENCE_NODE:5
Defined in: node_modules/@xmldom/xmldom/index.d.ts:597
Inherited from
Node.ENTITY_REFERENCE_NODE
firstChild
readonlyfirstChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:380
Returns the first child.
Inherited from
Node.firstChild
isConnected
readonlyisConnected: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.
Inherited from
Node.isConnected
lastChild
readonlylastChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:386
Returns the last child.
Inherited from
Node.lastChild
lineNumber?
optionallineNumber: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
readonlynamespaceURI:string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:406
The namespace URI of this node.
Inherited from
Node.namespaceURI
nextSibling
readonlynextSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:412
Returns the next sibling.
Inherited from
Node.nextSibling
nodeName
readonlynodeName:string
Defined in: node_modules/@xmldom/xmldom/index.d.ts:418
Returns a string appropriate for the type of node.
Inherited from
Node.nodeName
nodeType
readonlynodeType:1
Defined in: node_modules/@xmldom/xmldom/index.d.ts:843
Returns the type of node.
Overrides
Node.nodeType
nodeValue
nodeValue:
string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:426
Inherited from
Node.nodeValue
NOTATION_NODE
readonlyNOTATION_NODE:12
Defined in: node_modules/@xmldom/xmldom/index.d.ts:609
Inherited from
Node.NOTATION_NODE
ownerDocument
readonlyownerDocument:Document|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:432
Returns the node document. Returns null for documents.
Inherited from
Node.ownerDocument
parentElement
readonlyparentElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:444
Returns the parent Node if it is of type Element, otherwise null.
Inherited from
Node.parentElement
parentNode
readonlyparentNode:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:438
Returns the parent.
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
readonlypreviousSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:454
Returns the previous sibling.
Inherited from
Node.previousSibling
PROCESSING_INSTRUCTION_NODE
readonlyPROCESSING_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
readonlytagName:string
Defined in: node_modules/@xmldom/xmldom/index.d.ts:852
Returns the HTML-uppercased qualified name.
TEXT_NODE
readonlyTEXT_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
Parameters
| Parameter | Type |
|---|---|
node | Node |
Returns
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
| Parameter | Type |
|---|---|
deep? | boolean |
Returns
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.
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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.
Parameters
| Parameter | Type |
|---|---|
other | Node | 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.
Parameters
| Parameter | Type |
|---|---|
qualifiedName | string |
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.
Returns
string[]
getAttributeNode()
getAttributeNode(
qualifiedName):Attr|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:884
Parameters
| Parameter | Type |
|---|---|
qualifiedName | string |
Returns
Attr | null
getAttributeNodeNS()
getAttributeNodeNS(
namespace,localName):Attr|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:886
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
localName | string |
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.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
localName | string |
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
| Parameter | Type |
|---|---|
classNames | string |
Returns
LiveNodeList<Element>
See
- https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByClassName
- https://dom.spec.whatwg.org/#concept-getelementsbyclassname
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
| Parameter | Type |
|---|---|
qualifiedName | string |
Returns
LiveNodeList<Element>
See
- https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName
- https://dom.spec.whatwg.org/#concept-getelementsbytagname
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.
Parameters
| Parameter | Type |
|---|---|
namespaceURI | string | null |
localName | string |
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, sinceShadowRoots are unsupported, therefore always returning root.
Parameters
| Parameter | Type |
|---|---|
options | GetRootNodeOptions |
Returns
See
- https://dom.spec.whatwg.org/#dom-node-getrootnode
- https://dom.spec.whatwg.org/#concept-shadow-including-root
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.
Parameters
| Parameter | Type |
|---|---|
qualifiedName | string |
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.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
localName | string |
Returns
boolean
hasAttributes()
hasAttributes():
boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:963
Returns true if element has attributes, and false otherwise.
Returns
boolean
hasChildNodes()
hasChildNodes():
boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:547
Returns whether node has children.
Returns
boolean
Inherited from
Node.hasChildNodes
insertBefore()
insertBefore(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:550
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node | null |
Returns
Inherited from
Node.insertBefore
isDefaultNamespace()
isDefaultNamespace(
namespace):boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:553
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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
| Parameter | Type |
|---|---|
other | Node |
Returns
boolean
See
- https://dom.spec.whatwg.org/#concept-node-equals
- https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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
| Parameter | Type | Description |
|---|---|---|
feature | string | The package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation. |
version | string | This 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
Parameters
| Parameter | Type |
|---|---|
prefix | string | null |
Returns
string | null
Inherited from
Node.lookupNamespaceURI
lookupPrefix()
lookupPrefix(
namespace):string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:574
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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.
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.
Parameters
| Parameter | Type |
|---|---|
qualifiedName | string |
Returns
void
removeAttributeNode()
removeAttributeNode(
attr):Attr
Defined in: node_modules/@xmldom/xmldom/index.d.ts:977
Parameters
| Parameter | Type |
|---|---|
attr | Attr |
Returns
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.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
localName | string |
Returns
void
removeChild()
removeChild(
child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:585
Parameters
| Parameter | Type |
|---|---|
child | Node |
Returns
Inherited from
Node.removeChild
replaceChild()
replaceChild(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:588
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node |
Returns
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.
Parameters
| Parameter | Type |
|---|---|
qualifiedName | string |
value | string |
Returns
void
setAttributeNode()
setAttributeNode(
attr):Attr|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:996
Parameters
| Parameter | Type |
|---|---|
attr | Attr |
Returns
Attr | null
setAttributeNodeNS()
setAttributeNodeNS(
attr):Attr|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:998
Parameters
| Parameter | Type |
|---|---|
attr | Attr |
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.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
qualifiedName | string |
value | string |
Returns
void
Epub2UpgradeOptions
Defined in: libraries/epub/src/upgrade.tsx:76
Properties
outputPath?
optionaloutputPath: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?
optionalremoveNcx: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?
optionalid:string
Defined in: libraries/epub/src/index.tsx:146
identifierType?
optionalidentifierType:string
Defined in: libraries/epub/src/index.tsx:148
the value of a refining identifier-type meta, if present
scheme?
optionalscheme: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?
optionalid:string
Defined in: libraries/epub/src/index.tsx:155
identifierType?
optionalidentifierType:string
Defined in: libraries/epub/src/index.tsx:157
the value of a refining identifier-type meta, if present
isPageBreakSource?
optionalisPageBreakSource: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?
optionalscheme: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, notOEBPS/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
| Parameter | Type |
|---|---|
entry | string |
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()?
optionalduplicate():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
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<boolean>
list()?
optionallist():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
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<Uint8Array<ArrayBufferLike>>
Call Signature
read(
entry,encoding):Promise<string>
Defined in: libraries/epub/src/adapters/interface.ts:58
Parameters
| Parameter | Type |
|---|---|
entry | string |
encoding | "utf-8" |
Returns
Promise<string>
remove()?
optionalremove(entry):Promise<void>
Defined in: libraries/epub/src/adapters/interface.ts:78
Required for removeManifestItem / setCoverImage replacement
Parameters
| Parameter | Type |
|---|---|
entry | string |
Returns
Promise<void>
serialize()?
optionalserialize(targetPath):Promise<void>
Defined in: libraries/epub/src/adapters/interface.ts:87
Required for Epub.saveAndClose
Parameters
| Parameter | Type |
|---|---|
targetPath | string |
Returns
Promise<void>
write()?
Call Signature
optionalwrite(entry,data):Promise<void>
Defined in: libraries/epub/src/adapters/interface.ts:74
Required for any mutation method on Epub
Parameters
| Parameter | Type |
|---|---|
entry | string |
data | Uint8Array |
Returns
Promise<void>
Call Signature
optionalwrite(entry,data,encoding):Promise<void>
Defined in: libraries/epub/src/adapters/interface.ts:75
Parameters
| Parameter | Type |
|---|---|
entry | string |
data | string |
encoding | "utf-8" |
Returns
Promise<void>
EpubStorageAdapterClass<Opts>
Defined in: libraries/epub/src/adapters/interface.ts:93
Type Parameters
| Type Parameter | Default type |
|---|---|
Opts extends object | object |
Properties
capabilities
readonlycapabilities:EpubStorageCapabilities
Defined in: libraries/epub/src/adapters/interface.ts:95
kind
readonlykind: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
| Parameter | Type |
|---|---|
source | ArchiveSource |
opts? | Opts |
Returns
Promise<EpubStorageAdapter>
initEmpty()?
optionalinitEmpty(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
| Parameter | Type |
|---|---|
opts? | Opts |
Returns
Promise<EpubStorageAdapter>
EpubStorageCapabilities
Defined in: libraries/epub/src/adapters/interface.ts:34
Properties
writable
readonlywritable: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?
optionalreadonly: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?
optionalcache: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?
optionalsignal:AbortSignal
Defined in: libraries/epub/src/adapters/memory.ts:21
Navigation
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?
optionaltitle:string
Defined in: libraries/epub/src/index.tsx:211
NavigationItem
Defined in: libraries/epub/src/index.tsx:201
Properties
children?
optionalchildren:NavigationList
Defined in: libraries/epub/src/index.tsx:205
href?
optionalhref:string
Defined in: libraries/epub/src/index.tsx:203
role?
optionalrole: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
- http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
- https://dom.spec.whatwg.org/#node
Prettierignore
Properties
ATTRIBUTE_NODE
readonlyATTRIBUTE_NODE:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:592
baseURI
readonlybaseURI:"about:blank"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:396
Always returns about:blank currently.
CDATA_SECTION_NODE
readonlyCDATA_SECTION_NODE:4
Defined in: node_modules/@xmldom/xmldom/index.d.ts:596
node is a CDATASection node.
childNodes
readonlychildNodes:NodeList
Defined in: node_modules/@xmldom/xmldom/index.d.ts:374
Returns the children.
columnNumber?
optionalcolumnNumber: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
readonlyCOMMENT_NODE:8
Defined in: node_modules/@xmldom/xmldom/index.d.ts:602
node is a Comment node.
DOCUMENT_FRAGMENT_NODE
readonlyDOCUMENT_FRAGMENT_NODE:11
Defined in: node_modules/@xmldom/xmldom/index.d.ts:608
node is a DocumentFragment node.
DOCUMENT_NODE
readonlyDOCUMENT_NODE:9
Defined in: node_modules/@xmldom/xmldom/index.d.ts:604
node is a document.
DOCUMENT_POSITION_CONTAINED_BY
readonlyDOCUMENT_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
readonlyDOCUMENT_POSITION_CONTAINS:8
Defined in: node_modules/@xmldom/xmldom/index.d.ts:617
Set when other is an ancestor of node.
DOCUMENT_POSITION_DISCONNECTED
readonlyDOCUMENT_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
readonlyDOCUMENT_POSITION_FOLLOWING:4
Defined in: node_modules/@xmldom/xmldom/index.d.ts:615
Set when other is following node.
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
readonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32
Defined in: node_modules/@xmldom/xmldom/index.d.ts:620
DOCUMENT_POSITION_PRECEDING
readonlyDOCUMENT_POSITION_PRECEDING:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:613
Set when other is preceding node.
DOCUMENT_TYPE_NODE
readonlyDOCUMENT_TYPE_NODE:10
Defined in: node_modules/@xmldom/xmldom/index.d.ts:606
node is a doctype.
ELEMENT_NODE
readonlyELEMENT_NODE:1
Defined in: node_modules/@xmldom/xmldom/index.d.ts:591
node is an element.
ENTITY_NODE
readonlyENTITY_NODE:6
Defined in: node_modules/@xmldom/xmldom/index.d.ts:598
ENTITY_REFERENCE_NODE
readonlyENTITY_REFERENCE_NODE:5
Defined in: node_modules/@xmldom/xmldom/index.d.ts:597
firstChild
readonlyfirstChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:380
Returns the first child.
isConnected
readonlyisConnected: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.
lastChild
readonlylastChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:386
Returns the last child.
lineNumber?
optionallineNumber: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
readonlynamespaceURI:string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:406
The namespace URI of this node.
nextSibling
readonlynextSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:412
Returns the next sibling.
nodeName
readonlynodeName:string
Defined in: node_modules/@xmldom/xmldom/index.d.ts:418
Returns a string appropriate for the type of node.
nodeType
readonlynodeType:number
Defined in: node_modules/@xmldom/xmldom/index.d.ts:424
Returns the type of node.
nodeValue
nodeValue:
string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:426
NOTATION_NODE
readonlyNOTATION_NODE:12
Defined in: node_modules/@xmldom/xmldom/index.d.ts:609
ownerDocument
readonlyownerDocument:Document|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:432
Returns the node document. Returns null for documents.
parentElement
readonlyparentElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:444
Returns the parent Node if it is of type Element, otherwise null.
parentNode
readonlyparentNode:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:438
Returns the parent.
prefix
prefix:
string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:448
The prefix of the namespace for this node.
previousSibling
readonlypreviousSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:454
Returns the previous sibling.
PROCESSING_INSTRUCTION_NODE
readonlyPROCESSING_INSTRUCTION_NODE:7
Defined in: node_modules/@xmldom/xmldom/index.d.ts:600
node is a ProcessingInstruction node.
TEXT_NODE
readonlyTEXT_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
Parameters
| Parameter | Type |
|---|---|
node | Node |
Returns
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
| Parameter | Type |
|---|---|
deep? | boolean |
Returns
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.
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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.
Parameters
| Parameter | Type |
|---|---|
other | Node | 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, sinceShadowRoots are unsupported, therefore always returning root.
Parameters
| Parameter | Type |
|---|---|
options | GetRootNodeOptions |
Returns
See
- https://dom.spec.whatwg.org/#dom-node-getrootnode
- https://dom.spec.whatwg.org/#concept-shadow-including-root
hasChildNodes()
hasChildNodes():
boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:547
Returns whether node has children.
Returns
boolean
insertBefore()
insertBefore(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:550
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node | null |
Returns
isDefaultNamespace()
isDefaultNamespace(
namespace):boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:553
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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
| Parameter | Type |
|---|---|
other | Node |
Returns
boolean
See
- https://dom.spec.whatwg.org/#concept-node-equals
- https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode
isSameNode()
isSameNode(
other):boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:521
Checks whether the given node is this node.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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
| Parameter | Type | Description |
|---|---|---|
feature | string | The package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation. |
version | string | This 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
Parameters
| Parameter | Type |
|---|---|
prefix | string | null |
Returns
string | null
lookupPrefix()
lookupPrefix(
namespace):string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:574
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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.
Returns
void
removeChild()
removeChild(
child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:585
Parameters
| Parameter | Type |
|---|---|
child | Node |
Returns
replaceChild()
replaceChild(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:588
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node |
Returns
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.
Extends
CharacterData
Properties
ATTRIBUTE_NODE
readonlyATTRIBUTE_NODE:2
Defined in: node_modules/@xmldom/xmldom/index.d.ts:592
Inherited from
CharacterData.ATTRIBUTE_NODE
baseURI
readonlybaseURI:"about:blank"
Defined in: node_modules/@xmldom/xmldom/index.d.ts:396
Always returns about:blank currently.
Inherited from
CharacterData.baseURI
CDATA_SECTION_NODE
readonlyCDATA_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
readonlychildNodes:NodeList
Defined in: node_modules/@xmldom/xmldom/index.d.ts:374
Returns the children.
Inherited from
CharacterData.childNodes
columnNumber?
optionalcolumnNumber: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
readonlyCOMMENT_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
Inherited from
CharacterData.data
DOCUMENT_FRAGMENT_NODE
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32
Defined in: node_modules/@xmldom/xmldom/index.d.ts:620
Inherited from
CharacterData.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_PRECEDING
readonlyDOCUMENT_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
readonlyDOCUMENT_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
readonlyELEMENT_NODE:1
Defined in: node_modules/@xmldom/xmldom/index.d.ts:591
node is an element.
Inherited from
CharacterData.ELEMENT_NODE
ENTITY_NODE
readonlyENTITY_NODE:6
Defined in: node_modules/@xmldom/xmldom/index.d.ts:598
Inherited from
CharacterData.ENTITY_NODE
ENTITY_REFERENCE_NODE
readonlyENTITY_REFERENCE_NODE:5
Defined in: node_modules/@xmldom/xmldom/index.d.ts:597
Inherited from
CharacterData.ENTITY_REFERENCE_NODE
firstChild
readonlyfirstChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:380
Returns the first child.
Inherited from
CharacterData.firstChild
isConnected
readonlyisConnected: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.
Inherited from
CharacterData.isConnected
lastChild
readonlylastChild:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:386
Returns the last child.
Inherited from
CharacterData.lastChild
length
readonlylength:number
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1021
Inherited from
CharacterData.length
lineNumber?
optionallineNumber: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
readonlynamespaceURI:string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:406
The namespace URI of this node.
Inherited from
CharacterData.namespaceURI
nextSibling
readonlynextSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:412
Returns the next sibling.
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.
Overrides
CharacterData.nodeName
nodeType
nodeType:
3|4
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1053
Returns the type of node.
Overrides
CharacterData.nodeType
nodeValue
nodeValue:
string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:426
Inherited from
CharacterData.nodeValue
NOTATION_NODE
readonlyNOTATION_NODE:12
Defined in: node_modules/@xmldom/xmldom/index.d.ts:609
Inherited from
CharacterData.NOTATION_NODE
ownerDocument
readonlyownerDocument:Document
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1022
Returns the node document. Returns null for documents.
Inherited from
CharacterData.ownerDocument
parentElement
readonlyparentElement:Element|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:444
Returns the parent Node if it is of type Element, otherwise null.
Inherited from
CharacterData.parentElement
parentNode
readonlyparentNode:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:438
Returns the parent.
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
readonlypreviousSibling:Node|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:454
Returns the previous sibling.
Inherited from
CharacterData.previousSibling
PROCESSING_INSTRUCTION_NODE
readonlyPROCESSING_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
readonlyTEXT_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
Parameters
| Parameter | Type |
|---|---|
node | Node |
Returns
Inherited from
CharacterData.appendChild
appendData()
appendData(
data):void
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1024
Parameters
| Parameter | Type |
|---|---|
data | string |
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
| Parameter | Type |
|---|---|
deep? | boolean |
Returns
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.
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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.
Parameters
| Parameter | Type |
|---|---|
other | Node | null | undefined |
Returns
boolean
Inherited from
CharacterData.contains
deleteData()
deleteData(
offset,count):void
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1026
Parameters
| Parameter | Type |
|---|---|
offset | number |
count | number |
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, sinceShadowRoots are unsupported, therefore always returning root.
Parameters
| Parameter | Type |
|---|---|
options | GetRootNodeOptions |
Returns
See
- https://dom.spec.whatwg.org/#dom-node-getrootnode
- https://dom.spec.whatwg.org/#concept-shadow-including-root
Inherited from
CharacterData.getRootNode
hasChildNodes()
hasChildNodes():
boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:547
Returns whether node has children.
Returns
boolean
Inherited from
CharacterData.hasChildNodes
insertBefore()
insertBefore(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:550
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node | null |
Returns
Inherited from
CharacterData.insertBefore
insertData()
insertData(
offset,data):void
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1028
Parameters
| Parameter | Type |
|---|---|
offset | number |
data | string |
Returns
void
Inherited from
CharacterData.insertData
isDefaultNamespace()
isDefaultNamespace(
namespace):boolean
Defined in: node_modules/@xmldom/xmldom/index.d.ts:553
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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
| Parameter | Type |
|---|---|
other | Node |
Returns
boolean
See
- https://dom.spec.whatwg.org/#concept-node-equals
- https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode
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.
Parameters
| Parameter | Type |
|---|---|
other | Node |
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
| Parameter | Type | Description |
|---|---|---|
feature | string | The package name of the feature to test. This is the same name that can be passed to the method hasFeature on DOMImplementation. |
version | string | This 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
Parameters
| Parameter | Type |
|---|---|
prefix | string | null |
Returns
string | null
Inherited from
CharacterData.lookupNamespaceURI
lookupPrefix()
lookupPrefix(
namespace):string|null
Defined in: node_modules/@xmldom/xmldom/index.d.ts:574
Parameters
| Parameter | Type |
|---|---|
namespace | string | 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.
Returns
void
Inherited from
CharacterData.normalize
removeChild()
removeChild(
child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:585
Parameters
| Parameter | Type |
|---|---|
child | Node |
Returns
Inherited from
CharacterData.removeChild
replaceChild()
replaceChild(
node,child):Node
Defined in: node_modules/@xmldom/xmldom/index.d.ts:588
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node |
Returns
Inherited from
CharacterData.replaceChild
replaceData()
replaceData(
offset,count,data):void
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1030
Parameters
| Parameter | Type |
|---|---|
offset | number |
count | number |
data | string |
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.
Parameters
| Parameter | Type |
|---|---|
offset | number |
Returns
substringData()
substringData(
offset,count):string
Defined in: node_modules/@xmldom/xmldom/index.d.ts:1032
Parameters
| Parameter | Type |
|---|---|
offset | number |
count | number |
Returns
string
Inherited from
CharacterData.substringData
AdapterOptions<A>
AdapterOptions<
A> =AextendsEpubStorageAdapterClass<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.
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.
EpubInstanceFor<A>
EpubInstanceFor<
A> =A["capabilities"]["writable"] extendstrue?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<keyofEpub,`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
readonlystorage:"in-memory"
ManifestItem
ManifestItem =
object
Defined in: libraries/epub/src/index.tsx:119
Properties
fallback?
optionalfallback: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?
optionalmediaOverlay:string
Defined in: libraries/epub/src/index.tsx:125
mediaType?
optionalmediaType:string
Defined in: libraries/epub/src/index.tsx:123
properties?
optionalproperties:string[]
Defined in: libraries/epub/src/index.tsx:126
title?
optionaltitle:string
Defined in: libraries/epub/src/index.tsx:122
MetadataEntry
MetadataEntry =
object
Defined in: libraries/epub/src/index.tsx:129
Properties
id?
optionalid: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
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
readonlyATTRIBUTE_NODE:2
CDATA_SECTION_NODE
readonlyCDATA_SECTION_NODE:4
node is a CDATASection node.
COMMENT_NODE
readonlyCOMMENT_NODE:8
node is a Comment node.
DOCUMENT_FRAGMENT_NODE
readonlyDOCUMENT_FRAGMENT_NODE:11
node is a DocumentFragment node.
DOCUMENT_NODE
readonlyDOCUMENT_NODE:9
node is a document.
DOCUMENT_POSITION_CONTAINED_BY
readonlyDOCUMENT_POSITION_CONTAINED_BY:16
Set when other is a descendant of node.
DOCUMENT_POSITION_CONTAINS
readonlyDOCUMENT_POSITION_CONTAINS:8
Set when other is an ancestor of node.
DOCUMENT_POSITION_DISCONNECTED
readonlyDOCUMENT_POSITION_DISCONNECTED:1
Set when node and other are not in the same tree.
DOCUMENT_POSITION_FOLLOWING
readonlyDOCUMENT_POSITION_FOLLOWING:4
Set when other is following node.
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
readonlyDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32
DOCUMENT_POSITION_PRECEDING
readonlyDOCUMENT_POSITION_PRECEDING:2
Set when other is preceding node.
DOCUMENT_TYPE_NODE
readonlyDOCUMENT_TYPE_NODE:10
node is a doctype.
ELEMENT_NODE
readonlyELEMENT_NODE:1
node is an element.
ENTITY_NODE
readonlyENTITY_NODE:6
ENTITY_REFERENCE_NODE
readonlyENTITY_REFERENCE_NODE:5
NOTATION_NODE
readonlyNOTATION_NODE:12
PROCESSING_INSTRUCTION_NODE
readonlyPROCESSING_INSTRUCTION_NODE:7
node is a ProcessingInstruction node.
TEXT_NODE
readonlyTEXT_NODE:3
node is a Text node.
Text
**