# Interface ItemMaskController

plugin 的基本控制器

interface ItemMaskController {
data?: ItemMaskPluginType.PluginData;
five: Five;
hooks: Subscribe<ItemMaskPluginType.EventMap>;
state: ItemMaskPluginType.State;
staticPrefix: string;
get config(): {};
absoluteUrl(url: string): string;
appendTo?(wrapper: Element): void;
disable(options?: BaseOptions): void;
dispose(): void;
enable(options?: BaseOptions): void;
getCurrentState(): ItemMaskPluginType.State;
hide?(options?: BaseOptions): void | Promise<void>;
load(data: ItemMaskPluginType.ServerData): Promise<void>;
select(name?: string, options?: { userAction: boolean }): void;
selectAll(bool?: boolean): void;
setMode(mode: "box" | "mask"): void;
setState(
state: Partial<ItemMaskPluginType.State>,
options?: BaseOptions,
): void;
show?(options?: BaseOptions): void | Promise<void>;
}

#### Hierarchy (View Summary)

- Controller<
  ItemMaskPluginType.State,
  ItemMaskPluginType.EventMap,
  ItemMaskPluginType.ServerData,
  ItemMaskPluginType.PluginData,
  >
  - ItemMaskController

- Defined in lib/plugins/ItemMaskPlugin/Controller.ts:80

##### Index

### Properties

data?
five
hooks
state
staticPrefix

### Accessors

config

### Methods

absoluteUrl
appendTo?
disable
dispose
enable
getCurrentState
hide?
load
select
selectAll
setMode
setState
show?

## Properties

### `Optional` data

data?: ItemMaskPluginType.PluginData

当前使用的数据

Overrides BasePlugin.Controller.data

- Defined in lib/plugins/ItemMaskPlugin/Controller.ts:83

### five

five: Five

Inherited from Controller.five

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

### hooks

hooks: Subscribe<ItemMaskPluginType.EventMap> = ...

#### Description

插件事件钩子

Inherited from Controller.hooks

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

### state

state: ItemMaskPluginType.State

插件当前状态

Overrides Controller.state

- Defined in lib/plugins/ItemMaskPlugin/Controller.ts:86

### `Readonly` staticPrefix

staticPrefix: string = '//vr-image-4.realsee-cdn.cn'

Inherited from Controller.staticPrefix

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

## Accessors

### config

- get config(): {}

  #### Returns {}

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:91

## Methods

### absoluteUrl

- absoluteUrl(url: string): string

  #### Parameters

  - url: string

  #### Returns string

  #### Description

  获取静态资源的url

  Inherited from Controller.absoluteUrl

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

### `Optional` appendTo

- appendTo?(wrapper: Element): void

  插件自身DOM添加到父容器

  #### Parameters

  - wrapper: Element

    Element元素

  #### Returns void

  Inherited from Controller.appendTo

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

### disable

- disable(options?: BaseOptions): void

  禁用插件，让插件停止响应交互

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.disable

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:426

### dispose

- dispose(): void

  销毁插件，移除所有副作用，销毁后将不响应任何 API

  #### Returns void

  Overrides Controller.dispose

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:434

### enable

- enable(options?: BaseOptions): void

  启用插件，让插件能够响应交互

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.enable

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:415

### getCurrentState

- getCurrentState(): ItemMaskPluginType.State

  获取当前的插件状态，如果当初插件内存在需要通过动画变更的 state 值，则通过此方法可以得到中间状态

  #### Returns ItemMaskPluginType.State

  Inherited from Controller.getCurrentState

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

### `Optional` hide

- hide?(options?: BaseOptions): void | Promise<void>

  隐藏UI

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void | Promise<void>

  Inherited from Controller.hide

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

### load

- load(data: ItemMaskPluginType.ServerData): Promise<void>

  加载插件依赖数据

  #### Parameters

  - data: ItemMaskPluginType.ServerData

  #### Returns Promise<void>

  Overrides Controller.load

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:184

### select

- select(name?: string, options?: { userAction: boolean }): void

  #### Parameters

  - `Optional` name: string
  - `Optional` options: { userAction: boolean }

  #### Returns void

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:379

### selectAll

- selectAll(bool?: boolean): void

  #### Parameters

  - bool: boolean = true

  #### Returns void

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:387

### setMode

- setMode(mode: "box" | "mask"): void

  #### Parameters

  - mode: "box" | "mask"

  #### Returns void

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:363

### setState

- setState(state: Partial<ItemMaskPluginType.State>, options?: BaseOptions): void

  更改插件 State

  #### Parameters

  - state: Partial<ItemMaskPluginType.State>
  - options: BaseOptions = {}

  #### Returns void

  Overrides Controller.setState

  - Defined in lib/plugins/ItemMaskPlugin/Controller.ts:352

### `Optional` show

- show?(options?: BaseOptions): void | Promise<void>

  展示UI

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void | Promise<void>

  Inherited from Controller.show

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