Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Interface IUnresolvedContentLocation

    Represents a location within a ReaderPublication and methods to extract information related to that location. An UnresolvedContentLocation can be a position in the publication content, or a range across publication content.

    In contrast to ContentLocation, an UnresolvedContentLocation does only know the ReaderDocument of the location, but not its position within the ReaderDocument content. Therefore, the following methods are asynchronous in UnresolvedContentLocation:

    • contains()
    • equals()
    • intersects()
    • isAfter()
    • isBefore()

    If you only need to get the ReaderDocument for a Locator, ReaderPublication.fetchUnresolvedContentLocation() should be preferred as it is more performant than ReaderPublication.fetchContentLocation().

    An UnresolvedContentLocation, can be converted into a ContentLocation by calling resolve().

    interface IUnresolvedContentLocation {
        collapseToEnd(): Promise<IUnresolvedContentLocation>;
        collapseToStart(): Promise<IUnresolvedContentLocation>;
        contains(
            otherLocation:
                | ILocator
                | ILocatorData
                | IContentLocation
                | IUnresolvedContentLocation,
        ): Promise<boolean>;
        createRangeTo(
            otherLocation:
                | ILocator
                | ILocatorData
                | IContentLocation
                | IUnresolvedContentLocation,
        ): Promise<IUnresolvedContentLocation>;
        equals(
            otherLocation:
                | ILocator
                | ILocatorData
                | IContentLocation
                | IUnresolvedContentLocation,
        ): Promise<boolean>;
        fetchContentBlockTargets(
            fetchMode: ContentBlockTargetFetchMode,
        ): Promise<IContentBlockTarget[]>;
        fetchContentResolver(): Promise<IContentLocationContentResolver>;
        fetchNavigationItemReferences(
            options: IFetchNavigationItemReferencesOptions,
        ): Promise<IFetchNavigationItemReferencesResult>;
        getLocator(): Locator;
        getReaderDocuments(): IReaderDocument[];
        getReaderPublication(): IReaderPublication;
        intersects(
            otherLocation:
                | ILocator
                | ILocatorData
                | IContentLocation
                | IUnresolvedContentLocation,
        ): Promise<boolean>;
        isAfter(
            otherLocation:
                | ILocator
                | ILocatorData
                | IContentLocation
                | IUnresolvedContentLocation,
        ): Promise<boolean>;
        isBefore(
            otherLocation:
                | ILocator
                | ILocatorData
                | IContentLocation
                | IUnresolvedContentLocation,
        ): Promise<boolean>;
        isRange(): Promise<boolean>;
        resolve(): Promise<IContentLocation>;
        toJSON(): ISimpleLocatorData;
    }

    Methods

    • If this UnresolvedContentLocation represents a range, it creates a new UnresolvedContentLocation by collapsing to its end position. If this UnresolvedContentLocation does not represent a range, the instance itself is returned.

      Returns Promise<IUnresolvedContentLocation>

    • If this UnresolvedContentLocation represents a range, it creates a new UnresolvedContentLocation by collapsing to its start position. If this UnresolvedContentLocation does not represent a range, the instance itself is returned.

      Returns Promise<IUnresolvedContentLocation>

    • Get the ResourceTarget used to create this instance

      Returns Locator

      in 4.0.0.

    • Returns true if this location represents a range.

      Returns Promise<boolean>

    • Further resolves the UnresolvedContentLocation into a ContentLocation allowing synchronous methods for several operations.

      Returns Promise<IContentLocation>

    • Return a serializable version of the Locator that was used to create this instance. This is the same as calling getLocator().toJSON().

      Returns ISimpleLocatorData