---
title: "ListService | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ListService/"
---

# ListService

> Service for performing basic operations with lists.

## Classes

### ListService

#### Remarks

the TextWhizz is used as a text engine.

#### Implements

- [`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice)

#### Constructors

##### Constructor

```ts
new ListService(): ListService;
```

###### Returns

[`ListService`](#listservice)

#### Accessors

##### isInitialized

###### Get Signature

```ts
get isInitialized(): boolean;
```

Indicates if the service has been initialized.

###### Returns

`boolean`

#### Methods

##### actualizeStyleManager()

```ts
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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`actualizeStyleManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#actualizestylemanager)

##### addListItem()

```ts
addListItem(newListItemIndex, existingListItemIndex): void;
```

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

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `newListItemIndex` | `number` | index of the new list item. |
| `existingListItemIndex` | `number` | the 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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`addListItem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#addlistitem)

##### applyListType()

```ts
applyListType(paragraphIndexes, listType): void;
```

Applies a list type to paragraphs by their indexes.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndexes` | `number`[] | paragraph indexes. |
| `listType` | [`ListType`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ListType.md#listtype) | list type. |

###### Returns

`void`

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`applyListType`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#applylisttype)

##### createBulletedListItem()

```ts
createBulletedListItem(paragraphIndex, bulletCharCode): void;
```

Creates a new top-level bulleted list item.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | paragraph index. |
| `bulletCharCode` | `number` | character code used as 'bullet' (e.g., code 8225 used for “‡“). |

###### Returns

`void`

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`createBulletedListItem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#createbulletedlistitem)

##### createNumberedListItem()

```ts
createNumberedListItem(paragraphIndex, format): void;
```

Creates a new top-level numbered list item.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | paragraph index. |
| `format` | [`NumberingFormatType`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/NumberingFormatType.md#numberingformattype) | numbering format. |

###### Returns

`void`

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`createNumberedListItem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#createnumberedlistitem)

##### decreaseListItemIndent()

```ts
decreaseListItemIndent(paragraphIndex): void;
```

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

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | paragraph index. |

###### Returns

`void`

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`decreaseListItemIndent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#decreaselistitemindent)

##### deleteListItem()

```ts
deleteListItem(paragraphIndex): void;
```

Removes the existing list item by the paragraph index.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | the paragraph index of the list item to remove. |

###### Returns

`void`

###### Remarks

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

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`deleteListItem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#deletelistitem)

##### findItemToContinueBulletedList()

```ts
findItemToContinueBulletedList(paragraphIndex, bulletCharCode): number;
```

Finds the previous list item to continue bulleted list.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | index of the current paragraph. |
| `bulletCharCode` | `number` | character 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`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`findItemToContinueBulletedList`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#finditemtocontinuebulletedlist)

##### findItemToContinueNumberedList()

```ts
findItemToContinueNumberedList(
   paragraphIndex, 
   format, 
   itemNumber): number;
```

Finds the previous list item to continue bulleted list.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | index of the current paragraph. |
| `format` | [`NumberingFormatType`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/NumberingFormatType.md#numberingformattype) | numbering format. |
| `itemNumber` | `number` | list item number (from 1). |

###### Returns

`number`

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

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`findItemToContinueNumberedList`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#finditemtocontinuenumberedlist)

##### getListItemStyle()

```ts
getListItemStyle(paragraphIndex): IListStyle;
```

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

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | paragraph index. |

###### Returns

[`IListStyle`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListStyle.md#iliststyle)

###### Remarks

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

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`getListItemStyle`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#getlistitemstyle)

##### increaseListItemIndent()

```ts
increaseListItemIndent(paragraphIndex): void;
```

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

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | paragraph index. |

###### Returns

`void`

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`increaseListItemIndent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#increaselistitemindent)

##### initialize()

```ts
initialize(initData): void;
```

Initializes the list manager.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `initData` | [`IListServiceInitData`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListServiceInitData.md#ilistserviceinitdata) | data required for initialization. |

###### Returns

`void`

##### isParagraphAListItem()

```ts
isParagraphAListItem(paragraphIndex): boolean;
```

Indicates if a paragraph is a list item.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndex` | `number` | paragraph index. |

###### Returns

`boolean`

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

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`isParagraphAListItem`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#isparagraphalistitem)

##### isParagraphsTheSameList()

```ts
isParagraphsTheSameList(paragraphIndexes): boolean;
```

Indicates if the paragraphs are the same list.

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `paragraphIndexes` | `number`[] | paragraph indexes. |

###### Returns

`boolean`

###### Implementation of

[`IListService`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#ilistservice).[`isParagraphsTheSameList`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IListService.md#isparagraphsthesamelist)
