Manager abstract base class

### Hierarchy

- ManagerBase

## Index

### Properties

- _models

### Accessors

- comm_target_name
- version_comm_target_name

### Methods

- _create_comm
- _get_comm_info
- callbacks
- clear_state
- create_view
- display_model
- display_view
- filterViewOptions
- get_model
- get_state
- handle_comm_open
- new_model
- new_widget
- require_error
- setViewOptions
- set_state
- validateVersion

## Properties

### Private _models

_models: any = Object.create(null)

- Defined in manager-base.ts:442

Dictionary of model ids and model instance promises

## Accessors

### comm_target_name

- get comm_target_name(): string

- - Defined in manager-base.ts:77

  The comm target name to register.

  #### Returns string

### version_comm_target_name

- get version_comm_target_name(): string

- - Defined in manager-base.ts:84

  The version comm target name to register.

  #### Returns string

## Methods

### _create_comm

- _create_comm(comm_target_name: any, model_id: any, data?: any): Promise<any>

- - Defined in manager-base.ts:435

  #### Parameters

  - ##### comm_target_name: any

  - ##### model_id: any

  - ##### Optional data: any

  #### Returns Promise<any>

### _get_comm_info

- _get_comm_info(): any

- - Defined in manager-base.ts:437

  #### Returns any

### callbacks

- callbacks(view: any): object

- - Defined in manager-base.ts:163

  callback handlers specific to a view

  #### Parameters

  - ##### view: any

  #### Returns object

### clear_state

- clear_state(commlessOnly: boolean): Promise<void>

- - Defined in manager-base.ts:308

  Close all widgets and empty the widget state.

  #### Parameters

  - ##### commlessOnly: boolean

    should only commless widgets be removed

  #### Returns Promise<void>

  promise that resolves when the widget state is cleared.

### create_view

- create_view(model: any, options: any): any

- - Defined in manager-base.ts:132

  Creates a promise for a view of a given model

  Make sure the view creation is not out of order with any state updates.

  #### Parameters

  - ##### model: any

  - ##### options: any

  #### Returns any

### display_model

- display_model(msg: any, model: any, options: any): any

- - Defined in manager-base.ts:91

  Display a view for a particular model.

  #### Parameters

  - ##### msg: any

  - ##### model: any

  - ##### options: any

  #### Returns any

### display_view

- display_view(msg: any, view: any, options: any): any

- - Defined in manager-base.ts:106

  Display a view.

  #### Notes

  This must be implemented by a subclass.

  #### Parameters

  - ##### msg: any

  - ##### view: any

  - ##### options: any

  #### Returns any

### filterViewOptions

- filterViewOptions(options: any): object

- - Defined in manager-base.ts:367

  Returns the keys of view options that must be stored in the serialized widget manager state.

  This is meant to be overloaded in custom managers, which may register the cell index.

  #### Parameters

  - ##### options: any

  #### Returns object

### get_model

- get_model(model_id: any): any

- - Defined in manager-base.ts:170

  Get a promise for a model by model id.

  #### Parameters

  - ##### model_id: any

  #### Returns any

### get_state

- get_state(options: StateOptions): Promise<any>

- - Defined in manager-base.ts:327

  Asynchronously get the state of the widget manager.

  This includes all of the widget models.

  #### Parameters

  - ##### options: StateOptions

    The options for what state to return.

  #### Returns Promise<any>

  Promise for a state dictionary

### handle_comm_open

- handle_comm_open(comm: any, msg: any): Promise<any>

- - Defined in manager-base.ts:177

  Handle when a comm is opened.

  #### Parameters

  - ##### comm: any

  - ##### msg: any

  #### Returns Promise<any>

### new_model

- new_model(options: ModelOptions, serialized_state?: any): Promise<any>

- - Defined in manager-base.ts:268

  Create and return a promise for a new widget model

  Minimally, one must provide the model_name and widget_class parameters to create a model from Javascript.

  example

    widget_manager.new_model({ model_name: 'WidgetModel', widget_class: 'Jupyter.IntSlider' }) .then((model) => { console.log('Create success!', model); }, (err) => {console.error(err)});

  #### Parameters

  - ##### options: ModelOptions

    the options for creating the model.

  - ##### Default value serialized_state: any = {}

    attribute values for the model.

  #### Returns Promise<any>

### new_widget

- new_widget(options: ModelOptions, serialized_state: any): Promise<WidgetModel>

- - Defined in manager-base.ts:191

  Create a comm and new widget model.

  #### Parameters

  - ##### options: ModelOptions

    same options as new_model but, comm is not required and additional options are available.

  - ##### serialized_state: any

    serialized model attributes.

  #### Returns Promise<WidgetModel>

### require_error

- require_error(success_callback: any): (Anonymous function)

- - Defined in manager-base.ts:120

  Takes a requirejs success handler and returns a requirejs error handler. The default implementation just throws the original error.

  #### Parameters

  - ##### success_callback: any

  #### Returns (Anonymous function)

### setViewOptions

- setViewOptions(options: any): any

- - Defined in manager-base.ts:112

  Modifies view options. Generally overloaded in custom widget manager implementations.

  #### Parameters

  - ##### options: any

  #### Returns any

### set_state

- set_state(state: any, displayOptions: any): any

- - Defined in manager-base.ts:378

  Set the widget manager state.

  Reconstructs all of the widget models in the state, merges that with the current manager state, and then attempts to redisplay the widgets in the state.

  #### Parameters

  - ##### state: any

  - ##### displayOptions: any

  #### Returns any

### validateVersion

- validateVersion(): Promise<boolean>

- - Defined in manager-base.ts:230

  Validate the version of the Javascript against the version requested by the backend.

  #### Returns Promise<boolean>

  Whether or not the versions are okay

Generated using TypeDoc