Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • IEpubCfiResolvedTarget

Index

Properties

ast

The EpubCFI AST that was used to resolve this instance

indirectionErrors

indirectionErrors: IEpubCfiIndirection[]

List of indirection errors that occured

parentPath

The parent path to the target. If rangeStartPath and rangeEndPath are null, this path is the full path to the intended target if no range components were defined for the epubcfi.

If the range components are non-null, this path is a common path for both rangeStartPath and rangeEndPath. Note that it may not be the "deepest" common path for the range.

rangeEndPath

rangeEndPath: IEpubCfiResolvedPath

If not null, it defines the end of a target range.

rangeStartPath

rangeStartPath: IEpubCfiResolvedPath

If not null, it defines the start of a target range.

Methods

createDomRange

  • createDomRange(): Range
  • Creates a DOM Range from this instance. The created Range will be collapsed if this instance does not have any range path components.

    If this instance has a range that start and end in different Documents, the range will be collapsed to range start.

    Returns Range

getElementCharacterOffsets

getParserErrors

getResolverErrors

getSideBias

getSpatialOffsets

getTargetElement

  • getTargetElement(): Element
  • Returns the target element, if this instance is targeting a single element. If this instance targets several elements in a range, null is returned. If this instance is targeting a virtual element, null is returned.

    Returns Element

getTemporalOffsets

hasElementOffsets

  • hasElementOffsets(): boolean
  • If this instance has spatial, temporal or element character offsets.

    Returns boolean

hasErrors

  • hasErrors(): boolean
  • Returns true if any parse errors or resolver errors were encountered. To detect all parse errors, ensure to run EpubCfiValidator on the AST.

    Resolver errors include:

    • Targeting OPF element
    • Parent path is null
    • Exactly one of rangeStart or rangeEnd is null
    • There were parser errors
    • All steps and offsets were not parsed.
    • All steps were not resolved.
    • character offsets were out of bounds

    Returns boolean

hasParentPathOrRangePaths

  • hasParentPathOrRangePaths(): boolean
  • Returns boolean

hasRangePaths

  • hasRangePaths(): boolean
  • If this instance has both rangeStart and rangeEnd defined.

    Returns boolean

hasWarnings

  • hasWarnings(): boolean
  • Returns true if:

    • an element with an ID did not have an XML ID assertion in the corresponding step.
    • A step had the wrong step value and was "repaired" using an XML ID assertion.

    Returns boolean

isDomRange

  • isDomRange(): boolean
  • If this instance represents a DOM Range. If this method returns false, createDomRange() will returned a collapsed Range instance.

    Returns boolean

isEveryIndirectionResolved

  • isEveryIndirectionResolved(): boolean
  • Returns true if all indirections were resolved

    Returns boolean

isEveryStepAndOffsetParsed

  • isEveryStepAndOffsetParsed(): boolean
  • Returns true if the parser parsed all path steps and offsets.

    Returns boolean

isEveryStepResolved

  • isEveryStepResolved(): boolean
  • Returns true if all steps and indirections were resolved.

    Returns boolean

isMissingXmlIdAssertions

  • isMissingXmlIdAssertions(): boolean
  • Returns true if an element id was found in a path but the epubcfi was missing the correct XML id assertion.

    Returns boolean

isOwnedBySingleDocument

  • isOwnedBySingleDocument(): boolean
  • Always true for non-range instances. Only true for ranges if both start target node and end target node has the same ownerDocument.

    Returns boolean

isRepairedWithXmlIdAssertions

  • isRepairedWithXmlIdAssertions(): boolean
  • A path was repaired using an XML id assertion

    Returns boolean

isSomeCharacterOffsetOutOfBounds

  • isSomeCharacterOffsetOutOfBounds(): boolean
  • Returns boolean

isTargetingElement

  • isTargetingElement(): boolean
  • If this instance is targeting a single element.

    Returns boolean

isTargetingOpfDocument

  • isTargetingOpfDocument(): boolean
  • If this instance is targeting the OPF document instead of a content document. Will return true if no indirection took place at all (i.e. still inside the OPF document)

    If this method returns true, methods such as getTargetElement() and createDomRange() will return null.

    Returns boolean

Generated using TypeDoc