papi-dts
    Preparing search index...

    Provides functions related to scroll groups and Scripture references at those scroll groups

    interface IScrollGroupService {
        onDidChangeReferenceHistory: PlatformEvent<ReferenceHistoryUpdateInfo>;
        onDidUpdateScrRef: PlatformEvent<ScrollGroupUpdateInfo>;
        getReferenceHistory(scrollGroupId: number): Promise<ReferenceHistory>;
        getScrRef(scrollGroupId?: number): Promise<SerializedVerseRef>;
        getScrRefForProject(
            scrollGroupId: undefined | number,
            projectId: string,
        ): Promise<SerializedVerseRef>;
        navigateReferenceHistory(
            scrollGroupId: number,
            offset: number,
        ): Promise<boolean>;
        setScrRef(
            scrollGroupId: undefined | number,
            scrRef: SerializedVerseRef,
            sourceProjectId?: string,
        ): Promise<boolean>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    onDidChangeReferenceHistory: PlatformEvent<ReferenceHistoryUpdateInfo>

    Event that emits when a scroll group's reference history changes

    onDidUpdateScrRef: PlatformEvent<ScrollGroupUpdateInfo>

    Event that emits with information about a changed Scripture Reference for a scroll group. The emitted scrRef is in the source project's versification (see ScrollGroupUpdateInfo.sourceProjectId); a consumer that needs it in a specific project's versification should call getScrRefForProject for that project.

    Methods

    • Get the SerializedVerseRef associated with the provided scroll group, in the versification of whichever project last set it (see ScrollGroupUpdateInfo.sourceProjectId).

      NOTE: this returns the raw stored reference without versification conversion. If your consumer displays or navigates in a specific project's versification, use getScrRefForProject instead so mixed-versification projects land on the right verse.

      Parameters

      • OptionalscrollGroupId: number

        Scroll group whose Scripture reference to get. Defaults to 0

      Returns Promise<SerializedVerseRef>

      Scripture reference associated with the provided scroll group, in its source project's versification

    • Get the SerializedVerseRef associated with the provided scroll group, converted into the versification of projectId. The scroll group stores its reference in the versification of whichever project last set it; this converts it into projectId's versification so any consumer gets a reference it can use directly. Returns the raw reference when no conversion is needed.

      Parameters

      • scrollGroupId: undefined | number

        Scroll group whose Scripture reference to get. If undefined, defaults to 0

      • projectId: string

        Project into whose versification to convert the reference

      Returns Promise<SerializedVerseRef>

      Scripture reference in projectId's versification

    • Experimental

      Navigate within the reference history of the provided scroll group, browser-history.go style: negative offset = back that many steps, positive = forward that many steps.

      Parameters

      • scrollGroupId: number

        Scroll group whose history to navigate

      • offset: number

        Signed number of steps. -1 = back one, +1 = forward one

      Returns Promise<boolean>

      true if navigation happened; false if the offset was 0 or out of range

    • Sets the SerializedVerseRef associated with the provided scroll group

      Parameters

      • scrollGroupId: undefined | number

        Scroll group whose Scripture reference to get. If undefined, defaults to 0

      • scrRef: SerializedVerseRef

        Scripture reference to which to set the scroll group

      • OptionalsourceProjectId: string

        Project whose versification scrRef is expressed in. undefined = unknown

      Returns Promise<boolean>

      true if the scroll group's reference or its versification source changed. false otherwise