---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md
  - https://yandex.ru/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/IOptionManager.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/jsapi-v2-1/doc/en/llms.txt

# IOptionManager

Extends [IChild](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChild.md), [IEventEmitter](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md), [IFreezable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md).

Interface for the options manager. The options manager lets you set option values, build an options inheritance hierarchy, and resolve option values in the context of the existing inheritance hierarchy.

[Constructor](#constructor-summary) | [Fields](#properties-summary) | [Events](#events-summary) | [Methods](#methods-summary)

## Constructor {#constructor-summary}

```javascript
IOptionManager()
```

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [events](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#events) | [IEventManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md) | Event manager for the object.

Inherited from [IFreezable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#events). ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [change](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#event-change) | Changes to the option. ||
|| [parentchange](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChild.md#event-parentchange) | The parent object reference changed.

Data fields:

- oldParent - Old parent.
- newParent - New parent.

Inherited from [IChild](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChild.md#event-parentchange). ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [freeze](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#freeze)() | [IFreezable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md) | Switches the object to "frozen" mode.

Inherited from [IFreezable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#freeze). ||
|| [get](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#get)([key](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#get-param-key)[, [defaultValue](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#get-param-defaultValue)]) | | Returns the value of the specified option in the context of the existing options inheritance hierarchy. When this method is called, first values are searched for in the current options manager, then, if the value is not defined, the search continues in the hierarchy of parent managers. ||
|| [getAll](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#getAll)() | Object | Returns a reference to the internal hash that stores option values. ||
|| [getName](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#getName)() | String | Returns name of the options manager. ||
|| [getNative](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#getNative)([key](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#getNative-param-key)) | Object | Returns the value of the specified option that is defined for the given level of the options hierarchy, i.e. in this manager. ||
|| [getParent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#getParent)() | [IOptionManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md)\|null | Returns parent options manager. ||
|| [isFrozen](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#isFrozen)() | Boolean | Returns true if the object is in "frozen" mode, otherwise false.

Inherited from [IFreezable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#isFrozen). ||
|| [resolve](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#resolve)([key](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#resolve-param-key)[, [name](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#resolve-param-name)]) | Object | Method intended to be called by child options managers. ||
|| [setName](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#setName)([name](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#setName-param-name)) | | Sets the name of the options manager. ||
|| [setParent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#setParent)([parent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md#setParent-param-parent)) | [IChild](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IChild.md) | Sets the parent options manager. ||
|| [unfreeze](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#unfreeze)() | [IFreezable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md) | Switches the object to active mode.

Inherited from [IFreezable](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#unfreeze). ||
|#

## Events details {#event_detail}

### change {#change}

Changes to the option.

## Methods details {#method_detail}

### get {#get}

```javascript
{} get(key[, defaultValue])
```

**Returns** the value of the specified option in the context of the existing options inheritance hierarchy. When this method is called, first values are searched for in the current options manager, then, if the value is not defined, the search continues in the hierarchy of parent managers.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`key`](#get-param-key)[*](*star) | — | Type: String

Name of the option. ||
|| [`defaultValue`](#get-param-defaultValue) | — | Type: Object

Default value. ||
|#

\* Mandatory parameter/option.

### getAll {#getAll}

```javascript
{Object} getAll()
```

**Returns** a reference to the internal hash that stores option values.

### getName {#getName}

```javascript
{String} getName()
```

**Returns** name of the options manager.

### getNative {#getNative}

```javascript
{Object} getNative(key)
```

**Returns** the value of the specified option that is defined for the given level of the options hierarchy, i.e. in this manager.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`key`](#getNative-param-key)[*](*star) | — | Type: String

Name of the option. ||
|#

\* Mandatory parameter/option.

### getParent {#getParent}

```javascript
{IOptionManager|null} getParent()
```

**Returns** parent options manager.

### resolve {#resolve}

```javascript
{Object} resolve(key[, name])
```

Method intended to be called by child options managers.

**Returns** the option's value in the parent context.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`key`](#resolve-param-key)[*](*star) | — | Type: String

Name of the option. ||
|| [`name`](#resolve-param-name) | — | Type: String

Name of the child options manager. ||
|#

\* Mandatory parameter/option.

### setName {#setName}

```javascript
{} setName(name)
```

Sets the name of the options manager.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`name`](#setName-param-name)[*](*star) | — | Type: String

Name of the options manager. ||
|#

\* Mandatory parameter/option.

### setParent {#setParent}

```javascript
{IChild} setParent(parent)
```

Sets the parent options manager.

**Returns** self-reference.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`parent`](#setParent-param-parent)[*](*star) | — | Type: [IOptionManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md)\|null

Parent options manager. ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.