Interface: ISidebarService
molecule.ISidebarService
Hierarchy
Implemented by
Properties
state
• Protected
Abstract
state: ISidebar
Inherited from
Defined in
Methods
add
▸ add(pane
, isActive?
): void
Add a new Sidebar pane
Parameters
Name | Type | Description |
---|---|---|
pane | ISidebarPane | |
isActive? | boolean | Whether to activate the current pane |
Returns
void
Defined in
services/workbench/sidebarService.ts:25
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
Inherited from
Defined in
emit
▸ emit(name
, ...args
): void
Emit the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
...args | any | Arguments |
Returns
void
Inherited from
Defined in
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Inherited from
Defined in
get
▸ get(id
): undefined
| ISidebarPane
Get a specific pane via id
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
undefined
| ISidebarPane
Defined in
services/workbench/sidebarService.ts:19
getState
▸ getState(): ISidebar
Get the Component state
Returns
Inherited from
Defined in
onUpdateState
▸ onUpdateState(listener
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
listener | (prevState : ISidebar , nextState : ISidebar ) => void |
Returns
void
Inherited from
Defined in
remove
▸ remove(id
): void
Remove a pane
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
void
Defined in
services/workbench/sidebarService.ts:35
removeOnUpdateState
▸ removeOnUpdateState(listener?
): void
Remove the Component update event listening, default is remove all, also you can remove one by pass the listener
Parameters
Name | Type |
---|---|
listener? | Function |
Returns
void
Inherited from
Defined in
render
▸ render(nextState?
): void
Initiative notify the component to render the view by the state
Parameters
Name | Type |
---|---|
nextState? | ISidebar |
Returns
void
Inherited from
Defined in
reset
▸ reset(): void
Reset the sidebar data
Returns
void
Defined in
services/workbench/sidebarService.ts:44
setActive
▸ setActive(id?
): void
Set the specific pane as active
Parameters
Name | Type |
---|---|
id? | UniqueId |
Returns
void
Defined in
services/workbench/sidebarService.ts:40
setState
▸ setState(values
, callback?
): void
Set the state values, and notify the view component to re render
Parameters
Name | Type | Description |
---|---|---|
values | Partial <ISidebar > | update target state values |
callback? | (prevState : ISidebar , nextState : ISidebar ) => void | - |
Returns
void
Inherited from
Defined in
subscribe
▸ subscribe(name
, listener
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
listener | Function | Listener function |
Returns
void
Inherited from
Defined in
unsubscribe
▸ unsubscribe(name
, listener?
): void
Unsubscribe the specific event and the listener function
Parameters
Name | Type | Description |
---|---|---|
name | any | The event name |
listener? | Function | optional, it unsubscribes events via name if not pass the listener function |
Returns
void
Inherited from
Defined in
update
▸ update(pane
): void
Update a specific pane
Parameters
Name | Type |
---|---|
pane | ISidebarPane |
Returns
void