跳到主要内容
版本:0.9.0-beta.2

Class: SidebarService

molecule.SidebarService

Hierarchy​

Implements​

Constructors​

constructor​

• new SidebarService()

Overrides​

Component.constructor

Defined in​

src/services/workbench/sidebarService.ts:53

Properties​

state​

• Protected state: ISidebar

Implementation of​

ISidebarService.state

Overrides​

Component.state

Defined in​

src/services/workbench/sidebarService.ts:51

Methods​

add​

▸ add(data, isActive?): void

Add a new Sidebar pane

Parameters​

NameTypeDefault value
dataISidebarPaneundefined
isActivebooleanfalse

Returns​

void

Implementation of​

ISidebarService.add

Defined in​

src/services/workbench/sidebarService.ts:69


count​

▸ count(name): number

Count the service event

Parameters​

NameTypeDescription
namestringEvent name

Returns​

number

Implementation of​

ISidebarService.count

Inherited from​

Component.count

Defined in​

src/common/event/eventBus.ts:28


emit​

▸ emit(name, ...args): void

Emit the service event

Parameters​

NameTypeDescription
namestringEvent name
...argsanyArguments

Returns​

void

Implementation of​

ISidebarService.emit

Inherited from​

Component.emit

Defined in​

src/common/event/eventBus.ts:20


forceUpdate​

▸ forceUpdate(): void

Force to update the Component

Returns​

void

Implementation of​

ISidebarService.forceUpdate

Inherited from​

Component.forceUpdate

Defined in​

src/react/component.ts:79


get​

▸ get(id): undefined | ISidebarPane

Get a specific pane via id

Parameters​

NameType
idUniqueId

Returns​

undefined | ISidebarPane

Implementation of​

ISidebarService.get

Defined in​

src/services/workbench/sidebarService.ts:64


getPane​

▸ Private getPane(id): undefined | ISidebarPane

Parameters​

NameType
idUniqueId

Returns​

undefined | ISidebarPane

Defined in​

src/services/workbench/sidebarService.ts:58


getState​

▸ getState(): ISidebar

Get the Component state

Returns​

ISidebar

Implementation of​

ISidebarService.getState

Inherited from​

Component.getState

Defined in​

src/react/component.ts:83


onUpdateState​

▸ onUpdateState(callback): void

Listen to the Component state update event

Parameters​

NameType
callback(prevState: ISidebar, nextState: ISidebar) => void

Returns​

void

Implementation of​

ISidebarService.onUpdateState

Inherited from​

Component.onUpdateState

Defined in​

src/react/component.ts:71


remove​

▸ remove(id): void

Remove a pane

Parameters​

NameType
idUniqueId

Returns​

void

Implementation of​

ISidebarService.remove

Defined in​

src/services/workbench/sidebarService.ts:104


removeOnUpdateState​

▸ removeOnUpdateState(): void

Remove the Component update event listening

Returns​

void

Implementation of​

ISidebarService.removeOnUpdateState

Inherited from​

Component.removeOnUpdateState

Defined in​

src/react/component.ts:75


render​

▸ render(nextState?): void

Initiative notify the component to render the view by the state

Parameters​

NameType
nextState?ISidebar

Returns​

void

Implementation of​

ISidebarService.render

Inherited from​

Component.render

Defined in​

src/react/component.ts:67


reset​

▸ reset(): void

Reset the sidebar data

Returns​

void

Implementation of​

ISidebarService.reset

Defined in​

src/services/workbench/sidebarService.ts:142


setActive​

▸ setActive(id?): void

Set the specific pane as active

Parameters​

NameType
id?UniqueId

Returns​

void

Implementation of​

ISidebarService.setActive

Defined in​

src/services/workbench/sidebarService.ts:125


setState​

▸ setState(values, callback?): void

Set the state values, and notify the view component to re render

Parameters​

NameTypeDescription
valuesPartial<ISidebar>update target state values
callback?(prevState: ISidebar, nextState: ISidebar) => void-

Returns​

void

Implementation of​

ISidebarService.setState

Inherited from​

Component.setState

Defined in​

src/react/component.ts:54


subscribe​

▸ subscribe(name, callback): void

Subscribe the service event

Parameters​

NameTypeDescription
namestring | string[]Event name
callbackFunctionCallback function

Returns​

void

Implementation of​

ISidebarService.subscribe

Inherited from​

Component.subscribe

Defined in​

src/common/event/eventBus.ts:11


unsubscribe​

▸ unsubscribe(name): void

Unsubscribe the specific event

Parameters​

NameTypeDescription
nameanyThe event name

Returns​

void

Implementation of​

ISidebarService.unsubscribe

Inherited from​

Component.unsubscribe

Defined in​

src/common/event/eventBus.ts:37


update​

▸ update(pane): void

Update a specific pane

Parameters​

NameType
paneISidebarPane

Returns​

void

Implementation of​

ISidebarService.update

Defined in​

src/services/workbench/sidebarService.ts:90