# Class Controller<PluginState, PluginEventMap, PluginServerData, PluginData>`Abstract`

plugin 的基本控制器

#### Type Parameters

- PluginState extends BasePlugin.State
- PluginEventMap extends BasePlugin.EventMap<PluginState, PluginData>
- PluginServerData
- PluginData

#### Hierarchy (View Summary)

- Controller
  - ItemMaskController
  - OrientationPluginController
  - BackgroundPluginController
  - TrajectoryController
  - PanoAnimeController
  - DynamicPathLinePluginController
  - CSS3DPluginController
  - CSS2DPluginController
  - Object3DHelperController
  - GaussianSplattingEntranceAnimationController

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

##### Index

### Constructors

constructor

### Properties

five
hooks
state
staticPrefix

### Methods

absoluteUrl
appendTo?
disable
dispose
enable
getCurrentState
hide?
load?
setState?
show?

## Constructors

### constructor

- new Controller<
  PluginState extends BasePlugin.State,
  PluginEventMap extends BasePlugin.EventMap<PluginState, PluginData>,
  PluginServerData,
  PluginData,
  >(
  five: Five,
  config?: BasePlugin.Config,
  ): Controller<PluginState, PluginEventMap, PluginServerData, PluginData>

  #### Type Parameters

  - PluginState extends BasePlugin.State
  - PluginEventMap extends BasePlugin.EventMap<PluginState, PluginData>
  - PluginServerData
  - PluginData

  #### Parameters

  - five: Five
  - `Optional` config: BasePlugin.Config

  #### Returns Controller<PluginState, PluginEventMap, PluginServerData, PluginData>

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

## Properties

### five

five: Five

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

### hooks

hooks: Subscribe<PluginEventMap> = ...

#### Description

插件事件钩子

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

### `Abstract` state

state: PluginState

当前状态

#### Description

    可以通过 plugin.state 和 plugin.setState 来获取和设置。
    通过 state 设置后，plugin 会通过合适的动画运动来达到设置的效果。
    来迎合一些通过数据驱动的场景。

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

### `Readonly` staticPrefix

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

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

## Methods

### absoluteUrl

- absoluteUrl(url: string): string

  #### Parameters

  - url: string

  #### Returns string

  #### Description

  获取静态资源的url

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

### `Optional` appendTo

- appendTo?(wrapper: Element): void

  插件自身DOM添加到父容器

  #### Parameters

  - wrapper: Element

    Element元素

  #### Returns void

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

### `Abstract` disable

- disable(options?: BaseOptions): void

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

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

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

### `Abstract` dispose

- dispose(): void

  插件进行销毁

  #### Returns void

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

### `Abstract` enable

- enable(options?: BaseOptions): void

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

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

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

### getCurrentState

- getCurrentState(): PluginState

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

  #### Returns PluginState

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

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

### `Optional` `Abstract` load

- load?(
  serverData: PluginServerData,
  state?: PluginState,
  userAction?: boolean,
  ): Promise<void>

  加载插件依赖数据

  #### Parameters

  - serverData: PluginServerData

    插件数据

  - `Optional` state: PluginState

    插件 State

  - `Optional` userAction: boolean

  #### Returns Promise<void>

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

### `Optional` setState

- setState?(state: Partial<PluginState>, options?: BaseOptions): void

  设置state

  #### Parameters

  - state: Partial<PluginState>

    插件的目标状态

  - `Optional` options: BaseOptions

    配置项

  #### Returns void

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

### `Optional` show

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

  展示UI

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void | Promise<void>

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