Back to Website
Show / Hide Table of Contents

Interface IListService

Service for performing basic operations with lists.

Package: @aurigma/design-atoms-text

Methods

actualizeStyleManager()

Actualize all list styles (by name) in the style sheet manager.

Declaration
actualizeStyleManager(): void;
Returns
Type Description
void
Remarks

The actual list styles are the styles in TextWhizz.

addListItem(newListItemIndex, existingListItemIndex)

Adds a new list item to an existing list by the paragraph index.

Declaration
addListItem(newListItemIndex: number, existingListItemIndex: number): void;
Parameters
Type Name Description
number newListItemIndex

index of the new list item.

number existingListItemIndex

the index of the existing (previous) list item.

Returns
Type Description
void
Remarks

there must be no other items of the same list between the current index and the index of the previous list item.

applyListType(paragraphIndexes, listType)

Applies a list type to paragraphs by their indexes.

Declaration
applyListType(paragraphIndexes: number[], listType: ListType): void;
Parameters
Type Name Description
number[] paragraphIndexes

paragraph indexes.

ListType listType

list type.

Returns
Type Description
void

createBulletedListItem(paragraphIndex, bulletCharCode)

Creates a new top-level bulleted list item.

Declaration
createBulletedListItem(paragraphIndex: number, bulletCharCode: number): void;
Parameters
Type Name Description
number paragraphIndex

paragraph index.

number bulletCharCode

character code used as 'bullet' (e.g., code 8225 used for “‡“).

Returns
Type Description
void

createNumberedListItem(paragraphIndex, format)

Creates a new top-level numbered list item.

Declaration
createNumberedListItem(paragraphIndex: number, format: NumberingFormatType): void;
Parameters
Type Name Description
number paragraphIndex

paragraph index.

NumberingFormatType format

numbering format.

Returns
Type Description
void

decreaseListItemIndent(paragraphIndex)

Decreases the nesting level of the list item by the paragraph index.

Declaration
decreaseListItemIndent(paragraphIndex: number): void;
Parameters
Type Name Description
number paragraphIndex

paragraph index.

Returns
Type Description
void

deleteListItem(paragraphIndex)

Removes the existing list item by the paragraph index.

Declaration
deleteListItem(paragraphIndex: number): void;
Parameters
Type Name Description
number paragraphIndex

the paragraph index of the list item to remove.

Returns
Type Description
void
Remarks

only list item is removed, paragraph text is not removed.

findItemToContinueBulletedList(paragraphIndex, bulletCharCode)

Finds the previous list item to continue bulleted list.

Declaration
findItemToContinueBulletedList(paragraphIndex: number, bulletCharCode: number): number | null;
Parameters
Type Name Description
number paragraphIndex

index of the current paragraph.

number bulletCharCode

character code used as 'bullet' (e.g., code 8225 used for “‡“). the paragraph index of the found list item (if it was found).

Returns
Type Description
number | null

findItemToContinueNumberedList(paragraphIndex, format, itemNumber)

Finds the previous list item to continue bulleted list.

Declaration
findItemToContinueNumberedList(paragraphIndex: number, format: NumberingFormatType, itemNumber: number): number | null;
Parameters
Type Name Description
number paragraphIndex

index of the current paragraph.

NumberingFormatType format

numbering format.

number itemNumber

list item number (from 1). the paragraph index of the found list item (if it was found).

Returns
Type Description
number | null

getListItemStyle(paragraphIndex)

Returns the style of the list item by the paragraph index.

Declaration
getListItemStyle(paragraphIndex: number): IListStyle | null;
Parameters
Type Name Description
number paragraphIndex

paragraph index.

Returns
Type Description
IListStyle | null
Remarks

if the list item is not found, null is returned.

increaseListItemIndent(paragraphIndex)

Increases the nesting level of the list item by the paragraph index.

Declaration
increaseListItemIndent(paragraphIndex: number): void;
Parameters
Type Name Description
number paragraphIndex

paragraph index.

Returns
Type Description
void

isParagraphAListItem(paragraphIndex)

Indicates if a paragraph is a list item.

Declaration
isParagraphAListItem(paragraphIndex: number): boolean;
Parameters
Type Name Description
number paragraphIndex

paragraph index.

Returns
Type Description
boolean

returns true if the paragraph is a list item, false otherwise.

isParagraphsTheSameList(paragraphIndexes)

Indicates if the paragraphs are the same list.

Declaration
isParagraphsTheSameList(paragraphIndexes: number[]): boolean;
Parameters
Type Name Description
number[] paragraphIndexes

paragraph indexes.

Returns
Type Description
boolean
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback