Skip to main content

ListService

Classes​

ListService​

Service for performing basic operations with lists.

Remarks​

the TextWhizz is used as a text engine.

Implements​

Constructors​

Constructor​
new ListService(): ListService;
Returns​

ListService

Accessors​

isInitialized​
Get Signature​
get isInitialized(): boolean;

Indicates if the service has been initialized.

Returns​

boolean

Methods​

actualizeStyleManager()​
actualizeStyleManager(): void;

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

Returns​

void

Remarks​

The actual list styles are the styles in TextWhizz.

Implementation of​

IListService.actualizeStyleManager

addListItem()​
addListItem(newListItemIndex, existingListItemIndex): void;

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

Parameters​
ParameterTypeDescription
newListItemIndexnumberindex of the new list item.
existingListItemIndexnumberthe index of the existing (previous) list item.
Returns​

void

Remarks​

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

Implementation of​

IListService.addListItem

applyListType()​
applyListType(paragraphIndexes, listType): void;

Applies a list type to paragraphs by their indexes.

Parameters​
ParameterTypeDescription
paragraphIndexesnumber[]paragraph indexes.
listTypeListTypelist type.
Returns​

void

Implementation of​

IListService.applyListType

createBulletedListItem()​
createBulletedListItem(paragraphIndex, bulletCharCode): void;

Creates a new top-level bulleted list item.

Parameters​
ParameterTypeDescription
paragraphIndexnumberparagraph index.
bulletCharCodenumbercharacter code used as 'bullet' (e.g., code 8225 used for “‡“).
Returns​

void

Implementation of​

IListService.createBulletedListItem

createNumberedListItem()​
createNumberedListItem(paragraphIndex, format): void;

Creates a new top-level numbered list item.

Parameters​
ParameterTypeDescription
paragraphIndexnumberparagraph index.
formatNumberingFormatTypenumbering format.
Returns​

void

Implementation of​

IListService.createNumberedListItem

decreaseListItemIndent()​
decreaseListItemIndent(paragraphIndex): void;

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

Parameters​
ParameterTypeDescription
paragraphIndexnumberparagraph index.
Returns​

void

Implementation of​

IListService.decreaseListItemIndent

deleteListItem()​
deleteListItem(paragraphIndex): void;

Removes the existing list item by the paragraph index.

Parameters​
ParameterTypeDescription
paragraphIndexnumberthe paragraph index of the list item to remove.
Returns​

void

Remarks​

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

Implementation of​

IListService.deleteListItem

findItemToContinueBulletedList()​
findItemToContinueBulletedList(paragraphIndex, bulletCharCode): number;

Finds the previous list item to continue bulleted list.

Parameters​
ParameterTypeDescription
paragraphIndexnumberindex of the current paragraph.
bulletCharCodenumbercharacter code used as 'bullet' (e.g., code 8225 used for “‡“).
Returns​

number

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

Implementation of​

IListService.findItemToContinueBulletedList

findItemToContinueNumberedList()​
findItemToContinueNumberedList(
paragraphIndex,
format,
itemNumber): number;

Finds the previous list item to continue bulleted list.

Parameters​
ParameterTypeDescription
paragraphIndexnumberindex of the current paragraph.
formatNumberingFormatTypenumbering format.
itemNumbernumberlist item number (from 1).
Returns​

number

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

Implementation of​

IListService.findItemToContinueNumberedList

getListItemStyle()​
getListItemStyle(paragraphIndex): IListStyle;

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

Parameters​
ParameterTypeDescription
paragraphIndexnumberparagraph index.
Returns​

IListStyle

Remarks​

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

Implementation of​

IListService.getListItemStyle

increaseListItemIndent()​
increaseListItemIndent(paragraphIndex): void;

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

Parameters​
ParameterTypeDescription
paragraphIndexnumberparagraph index.
Returns​

void

Implementation of​

IListService.increaseListItemIndent

initialize()​
initialize(initData): void;

Initializes the list manager.

Parameters​
ParameterTypeDescription
initDataIListServiceInitDatadata required for initialization.
Returns​

void

isParagraphAListItem()​
isParagraphAListItem(paragraphIndex): boolean;

Indicates if a paragraph is a list item.

Parameters​
ParameterTypeDescription
paragraphIndexnumberparagraph index.
Returns​

boolean

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

Implementation of​

IListService.isParagraphAListItem

isParagraphsTheSameList()​
isParagraphsTheSameList(paragraphIndexes): boolean;

Indicates if the paragraphs are the same list.

Parameters​
ParameterTypeDescription
paragraphIndexesnumber[]paragraph indexes.
Returns​

boolean

Implementation of​

IListService.isParagraphsTheSameList

Was this page helpful?