# Interface EventMap

插件基本事件

interface EventMap {
click: (index: number) => void;
dataChange: (data: PluginDataItem, prevData?: PluginDataItem) => void;
dataLoaded: (data: PluginDataItem) => void;
disable: (event: { userAction: boolean }) => void;
dispose: () => void;
enable: (event: { userAction: boolean }) => void;
historyLengthChange: (historyStackLength: number) => void;
stateChange: (
params: StateChangeParams<BackgroundPluginType.State>,
) => void;
}

#### Hierarchy (View Summary)

- BasePlugin.EventMap<BackgroundPluginType.State, BackgroundPluginType.PluginData>
  - EventMap

- Defined in lib/plugins/BackgroundPlugin/typings.ts:26

##### Index

### Properties

click
dataChange
dataLoaded
disable
dispose
enable
historyLengthChange
stateChange

## Properties

### click

click: (index: number) => void

- Defined in lib/plugins/BackgroundPlugin/typings.ts:42

### dataChange

dataChange: (data: PluginDataItem, prevData?: PluginDataItem) => void

数据变更

Inherited from BasePlugin.EventMap.dataChange

- Defined in lib/plugins/BasePlugin/index.ts:59

### dataLoaded

dataLoaded: (data: PluginDataItem) => void

数据加载完成

Inherited from BasePlugin.EventMap.dataLoaded

- Defined in lib/plugins/BasePlugin/index.ts:61

### disable

disable: (event: { userAction: boolean }) => void

#### Type Declaration

- - (event: { userAction: boolean }): void

  - #### Parameters

    - event: { userAction: boolean }

      event.userAction是否是用户操作

    #### Returns void

#### Description

enabled 从 true 到 false 的回调

- Defined in lib/plugins/BackgroundPlugin/typings.ts:37

### dispose

dispose: () => void

#### Description

插件 dispose

Overrides BasePlugin.EventMap.dispose

- Defined in lib/plugins/BackgroundPlugin/typings.ts:41

### enable

enable: (event: { userAction: boolean }) => void

#### Type Declaration

- - (event: { userAction: boolean }): void

  - #### Parameters

    - event: { userAction: boolean }

      event.userAction是否是用户操作

    #### Returns void

#### Description

enabled 从 false 到 true 的回调

- Defined in lib/plugins/BackgroundPlugin/typings.ts:31

### historyLengthChange

historyLengthChange: (historyStackLength: number) => void

#### Type Declaration

- - (historyStackLength: number): void

  - #### Parameters

    - historyStackLength: number

      历史堆栈当前数量

    #### Returns void

#### Description

历史堆栈更新

- Defined in lib/plugins/BackgroundPlugin/typings.ts:47

### stateChange

stateChange: (params: StateChangeParams<BackgroundPluginType.State>) => void

插件状态变化

Inherited from BasePlugin.EventMap.stateChange

- Defined in lib/plugins/BasePlugin/index.ts:57