# StructTreeRoot

## Content

# Class: StructTreeRoot

Represents the logical structure of a document (the structure tree root).

Obtain it from [PdfDocument#structTreeRoot](PdfDocument#structtreeroot).

## Extends

- [`ObjectBase`](ObjectBase)

## Accessors

### children

#### Get Signature

```ts
get children(): StructElementCollection;
```

Gets the collection of nested [StructElement](StructElement) objects (a view over [StructTreeRoot#items](#items)).

##### Returns

[`StructElementCollection`](StructElementCollection)

***

### classMap

#### Get Signature

```ts
get classMap(): ClassMap;
```

Gets the dictionary that maps name objects designating attribute classes to the
corresponding collections of attribute objects. The class map is created if it does not
yet exist.

##### Returns

[`ClassMap`](ClassMap)

***

### hasClassMap

#### Get Signature

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

Gets a value indicating whether this structure tree root has a class map.

##### Returns

`boolean`

***

### hasRoleMap

#### Get Signature

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

Gets a value indicating whether this structure tree root has a role map.

##### Returns

`boolean`

***

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`ObjectBase`](ObjectBase).[`id`](ObjectBase#id)

***

### items

#### Get Signature

```ts
get items(): StructTreeItemCollection;
```

Gets the collection of nested [StructTreeItem](StructTreeItem) objects.

##### Returns

[`StructTreeItemCollection`](StructTreeItemCollection)

***

### namespaces

#### Get Signature

```ts
get namespaces(): NamespaceCollection;
```

Gets the collection of namespaces used within the document.

##### Returns

[`NamespaceCollection`](NamespaceCollection)

***

### om

#### Get Signature

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ObjectBase`](ObjectBase).[`om`](ObjectBase#om)

***

### roleMap

#### Get Signature

```ts
get roleMap(): RoleMap;
```

Gets the dictionary that maps the names of structure types used in a document to their
approximate equivalents in the set of standard structure types. The role map is created
if it does not yet exist.

##### Returns

[`RoleMap`](RoleMap)

## Methods

### clear()

```ts
clear(): void;
```

Clears the collections of the StructTreeRoot: [StructTreeRoot#items](#items),
the class map, and the role map.

#### Returns

`void`

***

### free()

```ts
free(): void;
```

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`free`](ObjectBase#free)

***

### rebind()

```ts
rebind(omTo): void;
```

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`rebind`](ObjectBase#rebind)
