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

# TreeConverter

> [`TreeConverter`](#abstract-treeconverter)

## Classes

### `abstract` TreeConverter

#### Constructors

##### Constructor

```ts
new TreeConverter(): TreeConverter;
```

###### Returns

#### Methods

##### convert()

```ts
convert(markup): string;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `markup` | `string` |

###### Returns

`string`

##### dictToStyle()

```ts
static dictToStyle(styles): string;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `styles` | \{ \[`id`: `string`\]: `string`; \} |

###### Returns

`string`

##### letterSpacingToTracking()

```ts
static letterSpacingToTracking(letterSpacing): number;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `letterSpacing` | `string` |

###### Returns

`number`

##### stringToBoolean()

```ts
static stringToBoolean(value): boolean;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

###### Returns

`boolean`

##### stringToNumber()

```ts
static stringToNumber(
   value, 
   units?, 
   defaultValue?): number;
```

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `value` | `string` | `undefined` |
| `units` | `string` | `""` |
| `defaultValue` | `number` | `0` |

###### Returns

`number`

##### stringToTextAlignment()

```ts
static stringToTextAlignment(value): TextAlignment;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

###### Returns

`TextAlignment`

##### stringToTextAlignmentForHtml()

```ts
static stringToTextAlignmentForHtml(value): TextAlignment;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

###### Returns

`TextAlignment`

##### styleToDict()

```ts
static styleToDict(xmlStyle): object;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `xmlStyle` | `String` |

###### Returns

`object`

##### textAlignmentToHtmlString()

```ts
static textAlignmentToHtmlString(value): string;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `TextAlignment` |

###### Returns

`string`

##### textAlignmentToXmlString()

```ts
static textAlignmentToXmlString(value): string;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `TextAlignment` |

###### Returns

`string`

##### trackingToLetterSpacing()

```ts
static trackingToLetterSpacing(tracking): string;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tracking` | `number` |

###### Returns

`string`
