Manager abstract base class

### Type parameters

- #### T

### Hierarchy

- ManagerBase
  - EmbedManager

## 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:445

Dictionary of model ids and model instance promises

## Accessors

### comm_target_name

- get comm_target_name(): string

- - Defined in manager-base.ts:83

  The comm target name to register.

  #### Returns string

### version_comm_target_name

- get version_comm_target_name(): string

- - Defined in manager-base.ts:90

  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:438

  #### 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:440

  #### Returns any

### callbacks

- callbacks(view: any): object

- - Defined in manager-base.ts:167

  callback handlers specific to a view

  #### Parameters

  - ##### view: any

  #### Returns object

### clear_state

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

- - Defined in manager-base.ts:311

  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:139

  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: IKernelMessage, model: Model, options: any): Promise<T>

- - Defined in manager-base.ts:97

  Display a view for a particular model.

  #### Parameters

  - ##### msg: IKernelMessage

  - ##### model: Model

  - ##### options: any

  #### Returns Promise<T>

### display_view

- display_view(msg: IKernelMessage, view: View<Model>, options: any): Promise<T>

- - Defined in manager-base.ts:113

  Display a view.

  #### Notes

  This must be implemented by a subclass. The implementation must trigger the view's displayed event after the view is on the page: `view.trigger('displayed')`

  #### Parameters

  - ##### msg: IKernelMessage

  - ##### view: View<Model>

  - ##### options: any

  #### Returns Promise<T>

### filterViewOptions

- filterViewOptions(options: any): object

- - Defined in manager-base.ts:370

  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: string): Promise<Model>

- - Defined in manager-base.ts:174

  Get a promise for a model by model id.

  #### Parameters

  - ##### model_id: string

  #### Returns Promise<Model>

### get_state

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

- - Defined in manager-base.ts:330

  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: Comm, msg: IKernelIOPubCommOpenMessage): Promise<Model>

- - Defined in manager-base.ts:181

  Handle when a comm is opened.

  #### Parameters

  - ##### comm: Comm

  - ##### msg: IKernelIOPubCommOpenMessage

  #### Returns Promise<Model>

### new_model

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

- - Defined in manager-base.ts:271

  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:195

  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:127

  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:119

  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:381

  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:233

  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