Class: TextComparisonInstance

PSPDFKit.TextComparisonInstance

A mounted text comparison instance.

You can generate an instance for text comparison by using PSPDFKit.loadTextComparison.

Methods




Methods

addEventListener(action, listener) → {void}

Add an event listener to the text comparison instance.

Parameters:
Name Type Description
action
listener
Returns:
Type
void

getChanges() → {Array.<TextComparisonChange>}

Get the changes for the text comparison instance.

Returns:

The changes.

Type
Array.<TextComparisonChange>

getComparisonVisibility() → {boolean}

Get the visibility state for the text comparison changes.

Returns:

The visibility state for the text comparison changes.

Type
boolean

getCurrentChangeIndex() → {number}

Get the current change index for the text comparison instance.

Returns:

The current change index.

Type
number

getInnerToolbarItems() → {Array.<TextComparisonInnerToolbarItem>}

Get the inner toolbar items for the text comparison instances.

Returns:

The toolbar items.

Type
Array.<TextComparisonInnerToolbarItem>

getScrollLock() → {boolean}

Get the scroll lock state for the text comparison instance.

Returns:

The scroll lock state.

Type
boolean

getToolbarItems() → {Array.<TextComparisonToolbarItem>}

Get the toolbar items for the text comparison instance.

Returns:

The toolbar items.

Type
Array.<TextComparisonToolbarItem>

goToNextChange() → {number}

Go to the next change in the text comparison instance.

Returns:

The index of the new change.

Type
number

goToPreviousChange() → {number}

Go to the previous change in the text comparison instance.

Returns:

The index of the new change.

Type
number

jumpToChange(changeIndex) → {number}

Jump to a specific change in the text comparison instance.

Parameters:
Name Type Description
changeIndex number

The index of the change to jump to.

Returns:

The index of the new change.

Type
number

removeEventListener(action, listener) → {void}

Remove an event listener from the text comparison instance.

Parameters:
Name Type Description
action
listener
Returns:
Type
void

setComparisonSidebarConfig(comparisonSidebarConfig) → {Promise.<void>}

Set the comparison sidebar configuration for the text comparison instance.

Parameters:
Name Type Description
comparisonSidebarConfig
Returns:
Type
Promise.<void>

setComparisonVisibility(flag) → {void}

Set the visibility of comparison changes for the text comparison instance.

Parameters:
Name Type Description
flag boolean

if isComparisonVisible is true, the comparison changes are visible.

Returns:
Type
void

setCurrentChangeIndex(changeIndex) → {void}

Set the current change index for the text comparison instance.

Parameters:
Name Type Description
changeIndex number

The index of the change to set.

Returns:
Type
void

setInnerToolbarItems(toolbarItemsCallback) → {void}

Set the toolbar items for the text comparison instance.

Parameters:
Name Type Description
toolbarItemsCallback Array.<TextComparisonInnerToolbarItem> | SetToolbarItemsFunction

The toolbar items to set.

Returns:
Type
void

setScrollLock(flag) → {void}

Set the scroll lock for the text comparison instance.

Parameters:
Name Type Description
flag boolean

scrollLockEnabled if true, scrolling is locked.

Returns:
Type
void

setToolbarItems(toolbarItemsCallback) → {void}

Set the toolbar items for the text comparison instance.

Parameters:
Name Type Description
toolbarItemsCallback Array.<TextComparisonToolbarItem> | SetToolbarItemsFunction

The toolbar items to set.

Returns:
Type
void

unload() → {void}

Unload the text comparison instance.

Returns:
Type
void