ComPDFKit Web SDK
    Preparing search index...

    Interface SortStrategy

    A sort strategy of the notes panel, registered with UI.addSortStrategy.

    interface SortStrategy {
        getSeparatorContent?: (
            prevNote: Core.Annotations.Annotation | undefined,
            currNote: Core.Annotations.Annotation,
            options: SortOptions,
            documentViewerKey?: number,
        ) => string | number | null | undefined;
        getSortedNotes(
            notes: Core.Annotations.Annotation[],
            options: SortOptions,
        ): Core.Annotations.Annotation[];
        name?: string;
        shouldRenderSeparator?: (
            prevNote: Core.Annotations.Annotation,
            currNote: Core.Annotations.Annotation,
            options: SortOptions,
            documentViewerKey?: number,
        ) => boolean;
    }
    Index
    getSeparatorContent?: (
        prevNote: Core.Annotations.Annotation | undefined,
        currNote: Core.Annotations.Annotation,
        options: SortOptions,
        documentViewerKey?: number,
    ) => string | number | null | undefined

    Returns the title of the separator that starts a group; also called for the first note to title the first group.

    Type Declaration

      • (
            prevNote: Core.Annotations.Annotation | undefined,
            currNote: Core.Annotations.Annotation,
            options: SortOptions,
            documentViewerKey?: number,
        ): string | number | null | undefined
      • Parameters

        Returns string | number | null | undefined

        The title; undefined or null shows an empty title.

    name?: string

    Name of the strategy, used by UI.setNotesPanelSortStrategy; a built-in strategy with the same name is replaced. Required by UI.addSortStrategy.

    shouldRenderSeparator?: (
        prevNote: Core.Annotations.Annotation,
        currNote: Core.Annotations.Annotation,
        options: SortOptions,
        documentViewerKey?: number,
    ) => boolean

    Decides whether a separator starts before a note. Separators are only drawn when getSeparatorContent is given too.

    Type Declaration