# Instance

## ApplicationPrototype. Instance

#### new Instance()

Source:
  - dictionary.d.js, line 5

### Methods

#### bind(event, callbackopt, listenersConfigopt) → {string}

Source:
  - dictionary.d.js, line 40

returns listener Id

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`event` | string | function |  | event name of function with name
`callback` | function | ApplicationPrototype.Instance.BindListenerConfig | <optional> | function that will listen data
`listenersConfig` | ApplicationPrototype.Instance.BindListenerConfig | string | <optional> | of lis event name of function with name

##### Returns:

Type
  string

#### crudEvents(context, publicMethods, privateMethods) → {ApplicationPrototype.Instance}

Source:
  - dictionary.d.js, line 69

returns listener Id

##### Parameters:

Name | Type | Description
--- | --- | ---
`context` | Object.<string, any> | will be used as a base for ApplicationPrototype instance that will be returned
`publicMethods` | Object.<string, function()> | list of public methods available from returned instance
`privateMethods` | Object.<string, function()> | list of private methods available only for instance's methods

##### Returns:

Type
  ApplicationPrototype.Instance

#### emit(event, argsopt, trackopt, noSkipStopReturnopt)

Source:
  - dictionary.d.js, line 50

emits an application event

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`event` | string |  |  | event name
`args` | Array.<any> | <optional> |  | arguments passed with event
`track` | boolean | <optional> | `false` | indicate if to use tracked handler or internal
`noSkipStopReturn` | boolean | <optional> | `false` | indicate if event flow can be stopped by a `false` return

#### off(event, specifiedEventIdopt) → {boolean}

Source:
  - dictionary.d.js, line 60

remove all event listeners

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`event` | string |  | event or events names separated by comma
`specifiedEventId` | string | <optional> | event name of function with name

##### Returns:

Type
  boolean

#### on(event, callbackopt, specifiedEventIdopt) → {string}

Source:
  - dictionary.d.js, line 20

returns listener Id

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`event` | string | function |  | event name of function with name
`callback` | function | <optional> | function that will listen data
`specifiedEventId` | string | <optional> | event name of function with name

##### Returns:

Type
  string

#### once(event, callbackopt, specifiedEventIdopt) → {string}

Source:
  - dictionary.d.js, line 30

returns listener Id

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`event` | string | function |  | event name of function with name
`callback` | function | <optional> | function that will listen data
`specifiedEventId` | string | <optional> | event name of function with name

##### Returns:

Type
  string

#### property(propertyName, getter, setteropt, configopt)

Source:
  - dictionary.d.js, line 88

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`propertyName` | string |  |
`getter` | ApplicationPrototype.Instance.PropertyHandler |  |
`setter` | ApplicationPrototype.Instance.PropertyHandler | <optional> |

`config`

object

<optional>

###### Properties

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`configurable` | boolean | <optional> | `true` |
`enumerable` | boolean | <optional> | `true` |

##### Fires:

- ApplicationPrototype.Instance.event:__onSet
- ApplicationPrototype.Instance.event:__onGet
- ApplicationPrototype.Instance.event:__afterGet
- ApplicationPrototype.Instance.event:__afterGet
- ApplicationPrototype.Instance.event:__onSet::propName
- ApplicationPrototype.Instance.event:__onGet::propName
- ApplicationPrototype.Instance.event:__afterGet::propName
- ApplicationPrototype.Instance.event:__afterGet::propName

#### property(getter, setteropt, configopt)

Source:
  - dictionary.d.js, line 88

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`getter` | ApplicationPrototype.PropertyHandler |  | function with name
`setter` | ApplicationPrototype.PropertyHandler | <optional> |

`config`

object

<optional>

###### Properties

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`configurable` | boolean | <optional> | `true` |
`enumerable` | boolean | <optional> | `true` |

### Type Definitions

#### BindListenerConfig

Source:
  - dictionary.d.js, line 11

##### Properties:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`listenedBefore` | boolean | <optional> | `true` | allow listeners before method call
`listenedOn` | boolean | <optional> | `true` | allow listeners on method call ( is after )
`listenedAfter` | boolean | <optional> | `true` | allow listeners after method call ( is after small delay )
`allowInterruption` | boolean | <optional> | `true` |

configuration for bind listeners

##### Type:

- object

#### PropertyHandler(value, lastValue, isSetter)

Source:
  - dictionary.d.js, line 79

returns listener Id

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | any | is undefined when `isSetter = true`
`lastValue` | any |
`isSetter` | boolean |

### Events

#### __afterGet

Source:
  - dictionary.d.js, line 131

##### Properties:

Name | Type | Description
--- | --- | ---
`propName` | string |
`value` | any |
`lastValue` | any |

##### Type:

- object

#### __afterGet::propName

Source:
  - dictionary.d.js, line 162

##### Properties:

Name | Type | Description
--- | --- | ---
`value` | any |
`lastValue` | any |

##### Type:

- object

#### __afterSet

Source:
  - dictionary.d.js, line 139

##### Properties:

Name | Type | Description
--- | --- | ---
`propName` | string |
`value` | any |
`lastValue` | any |

##### Type:

- object

#### __afterSet::propName

Source:
  - dictionary.d.js, line 169

##### Properties:

Name | Type | Description
--- | --- | ---
`value` | any |
`lastValue` | any |

##### Type:

- object

#### __onGet

Source:
  - dictionary.d.js, line 115

##### Properties:

Name | Type | Description
--- | --- | ---
`propName` | string |
`value` | any |
`lastValue` | any |

##### Type:

- object

#### __onGet::propName

Source:
  - dictionary.d.js, line 148

##### Properties:

Name | Type | Description
--- | --- | ---
`value` | any |
`lastValue` | any |

##### Type:

- object

#### __onSet

Source:
  - dictionary.d.js, line 123

##### Properties:

Name | Type | Description
--- | --- | ---
`propName` | string |
`value` | any |
`lastValue` | any |

##### Type:

- object

#### __onSet::propName

Source:
  - dictionary.d.js, line 155

##### Properties:

Name | Type | Description
--- | --- | ---
`value` | any |
`lastValue` | any |

##### Type:

- object