interface AnnotListType {
    destroy: () => Promise<void>;
    getAnnotByDict: (
        pageIndex: number,
        annotDict: PDFDictionaryType,
    ) => Promise<null | AnnotType>;
    getAt: (index: number) => Promise<null | AnnotType>;
    getCount: () => Promise<number>;
    getDoc: () => Promise<null | DocType>;
    getIndex: (annot: AnnotType) => Promise<number>;
    getPage: () => Promise<null | PageType>;
    insert: (annot: AnnotType, index?: number) => Promise<void>;
    moveTo: (index: number, newIndex: number) => Promise<void>;
    moveToFirst: (index: number) => Promise<void>;
    moveToLast: (index: number) => Promise<void>;
    options: Options;
    remove: (index: number) => Promise<void>;
    removeAll: () => Promise<void>;
    replace: (index: number, annot: AnnotType) => Promise<void>;
}

Implemented by

Properties

destroy: () => Promise<void>

Destroys an annotation list.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

getAnnotByDict: (
    pageIndex: number,
    annotDict: PDFDictionaryType,
) => Promise<null | AnnotType>

Get the annot by specified dictionary.

Type declaration

getAt: (index: number) => Promise<null | AnnotType>

Gets an annotation at specified position.

Type declaration

    • (index: number): Promise<null | AnnotType>
    • Parameters

      • index: number

        The zero-based index in the annotation list.

      Returns Promise<null | AnnotType>

getCount: () => Promise<number>

Gets the count of annotations in the annotation list.

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

      • The count of annotations in the annotation list.
getDoc: () => Promise<null | DocType>

Gets the PDF document.

Type declaration

    • (): Promise<null | DocType>
    • Returns Promise<null | DocType>

      • The PDF document
getIndex: (annot: AnnotType) => Promise<number>

Gets the annotation's index.

Type declaration

    • (annot: AnnotType): Promise<number>
    • Parameters

      Returns Promise<number>

      • The zero-based index in the annotation list.
getPage: () => Promise<null | PageType>

Get the PDF Page.

Type declaration

insert: (annot: AnnotType, index?: number) => Promise<void>

Inserts BEFORE the index, if index equals to current count, then append.

Type declaration

    • (annot: AnnotType, index?: number): Promise<void>
    • Parameters

      • annot: AnnotType
      • Optionalindex: number

        The zero-based index to insert before.

      Returns Promise<void>

moveTo: (index: number, newIndex: number) => Promise<void>

Moves an annotation to specified position.

Type declaration

    • (index: number, newIndex: number): Promise<void>
    • Parameters

      • index: number

        The annotation of position wanna to move

      • newIndex: number

        The new position to move to

      Returns Promise<void>

moveToFirst: (index: number) => Promise<void>

Moves an annotation to the first of the annotation list.

Type declaration

    • (index: number): Promise<void>
    • Parameters

      • index: number

        The zero-based index of the annotation to be moved.

      Returns Promise<void>

moveToLast: (index: number) => Promise<void>

Moves an annotation to the last of the annotation list.

Type declaration

    • (index: number): Promise<void>
    • Parameters

      • index: number

        The zero-based index of the annotation to be moved.

      Returns Promise<void>

options: Options
remove: (index: number) => Promise<void>

Removes an annotation.

Type declaration

    • (index: number): Promise<void>
    • Parameters

      • index: number

        The zero-based index of the annotation to be removed.

      Returns Promise<void>

removeAll: () => Promise<void>

Removes all the annotation.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

replace: (index: number, annot: AnnotType) => Promise<void>

Replaces the specified position with a new annotation.

Type declaration

    • (index: number, annot: AnnotType): Promise<void>
    • Parameters

      • index: number

        The zero-based index in the annotation list.

      • annot: AnnotType

        The new annotation.

      Returns Promise<void>