# Interface FiveInjectionTypes

监听者模式

#### Example

    new Subscribe<{
    "foo": [arg1: number, arg2: string],
    "bar": [arg: boolean],
    }>()

interface FiveInjectionTypes {
cameraDirection: Vector3;
cameraRaycaster: Raycaster;
currentObserver: WorkObserver;
currentState: State;
getPixels: {
<
T extends
Uint8Array<ArrayBufferLike>
| Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>,
>(
x: number,
y: number,
width: number,
height: number,
pixelRatio?: number,
flipY?: boolean,
buffer?: T,
): T;
<
T extends
Uint8Array<ArrayBufferLike>
| Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>,
>(
options: {
buffer?: T;
flipY?: boolean;
height: number;
helperVisible?: boolean;
pixelRatio?: number;
skipPanorama?: boolean;
width: number;
x: number;
y: number;
},
): T;
};
helperVisible: boolean
| undefined;
intersectRaycaster: (
raycaster: Raycaster,
target?: Intersection[],
) => Intersection[];
loadWork: (
inputWork:
| string
| string[]
| LooseWork
| Work
| Work[]
| LooseWork[]
| LooseWorkWithExtrinsics[]
| Promise<
LooseWork
| Work
| Work[]
| LooseWork[]
| LooseWorkWithExtrinsics[],
>,
state?: "initial" | "inherit" | Partial<State>,
options?: number | FiveLoadOptions,
userAction?: boolean,
) => Promise<void>;
model: Model;
modelReadyState: "Empty" | "Loaded" | undefined;
models: Models;
needsRender: () => void;
preloadPano: (
pano: number | Pano | `${string}[${number}]`,
callback?: (costs: number) => void,
) => Promise<number>;
project2d: (vector: Vector3, testModel?: boolean) => Vector2 | null;
render: (callback?: () => void) => void;
scene: Scene;
setState: (
state: Partial<State>,
immediately?: boolean,
userAction?: boolean,
) => void;
showFloor: (floorIndex?: number) => void;
shownFloor: number | null | undefined;
state: State;
toggleHelperVisible: (visible: boolean) => void;
unsafe__fiveInstance: Five;
updateCamera: (
pose: Partial<Pose>,
duration: number,
userAction?: boolean,
) => Promise<void>;
work: Work;
works: Works;
emit<
K extends
| "dispose"
| "error"
| "render"
| "gesture.pan"
| "gesture.tap"
| "gesture.dbltap"
| "gesture.press"
| "gesture.pinch"
| "gesture.mousewheel"
| "gesture.mousemove"
| "gesture.momentum"
| "gesture.fire"
| "initAnimation.start"
| "initAnimation.end"
| "camera.update"
| "intersect.update"
| "pano.select"
| "pano.request"
| "pano.prepare"
| "pano.moveTo"
| "pano.moving"
| "pano.arrived"
| "pano.cancel"
| "pano.error"
| "pano.texture.load"
| "pano.texture.progress"
| "pano.texture.success"
| "pano.texture.error"
| "pano.texture.abort"
| "xr.session.end"
| "xr.session.start"
| "xr.gesture.tap"
| "xr.gesture.press"
| "xr.gesture.buttonUp"
| "xr.gesture.buttonDown"
| "xr.controller.update"
| (keyof LegacyEventType)
| "works.request"
| "works.load"
| "works.ready"
| "state.set"
| "state.change"
| "state.synced"
| "currentState.change"
| "model.request"
| "model.load"
| "model.error"
| "model.changeShownFloor"
| "models.load"
| "models.refined"
| "models.tileLoad"
| "models.tileUnload"
| "render.prepare"
| "mode.change.request"
| "mode.change"
| "helpers.visible"
| "network.resource"
| "fps",
>(
name: K,
...data: Parameters<EventTypes[K]>,
): boolean;
hasListener(
name:
| "dispose"
| "error"
| "render"
| "gesture.pan"
| "gesture.tap"
| "gesture.dbltap"
| "gesture.press"
| "gesture.pinch"
| "gesture.mousewheel"
| "gesture.mousemove"
| "gesture.momentum"
| "gesture.fire"
| "initAnimation.start"
| "initAnimation.end"
| "camera.update"
| "intersect.update"
| "pano.select"
| "pano.request"
| "pano.prepare"
| "pano.moveTo"
| "pano.moving"
| "pano.arrived"
| "pano.cancel"
| "pano.error"
| "pano.texture.load"
| "pano.texture.progress"
| "pano.texture.success"
| "pano.texture.error"
| "pano.texture.abort"
| "xr.session.end"
| "xr.session.start"
| "xr.gesture.tap"
| "xr.gesture.press"
| "xr.gesture.buttonUp"
| "xr.gesture.buttonDown"
| "xr.controller.update"
| (keyof LegacyEventType)
| "works.request"
| "works.load"
| "works.ready"
| "state.set"
| "state.change"
| "state.synced"
| "currentState.change"
| "model.request"
| "model.load"
| "model.error"
| "model.changeShownFloor"
| "models.load"
| "models.refined"
| "models.tileLoad"
| "models.tileUnload"
| "render.prepare"
| "mode.change.request"
| "mode.change"
| "helpers.visible"
| "network.resource"
| "fps",
): boolean;
off<
K extends
| "dispose"
| "error"
| "render"
| "gesture.pan"
| "gesture.tap"
| "gesture.dbltap"
| "gesture.press"
| "gesture.pinch"
| "gesture.mousewheel"
| "gesture.mousemove"
| "gesture.momentum"
| "gesture.fire"
| "initAnimation.start"
| "initAnimation.end"
| "camera.update"
| "intersect.update"
| "pano.select"
| "pano.request"
| "pano.prepare"
| "pano.moveTo"
| "pano.moving"
| "pano.arrived"
| "pano.cancel"
| "pano.error"
| "pano.texture.load"
| "pano.texture.progress"
| "pano.texture.success"
| "pano.texture.error"
| "pano.texture.abort"
| "xr.session.end"
| "xr.session.start"
| "xr.gesture.tap"
| "xr.gesture.press"
| "xr.gesture.buttonUp"
| "xr.gesture.buttonDown"
| "xr.controller.update"
| (keyof LegacyEventType)
| "works.request"
| "works.load"
| "works.ready"
| "state.set"
| "state.change"
| "state.synced"
| "currentState.change"
| "model.request"
| "model.load"
| "model.error"
| "model.changeShownFloor"
| "models.load"
| "models.refined"
| "models.tileLoad"
| "models.tileUnload"
| "render.prepare"
| "mode.change.request"
| "mode.change"
| "helpers.visible"
| "network.resource"
| "fps",
>(
name?: K,
callback?: (
...args: Parameters<EventTypes[K]>,
) => ReturnType<EventTypes[K]>,
): void;
on<
K extends
| "dispose"
| "error"
| "render"
| "gesture.pan"
| "gesture.tap"
| "gesture.dbltap"
| "gesture.press"
| "gesture.pinch"
| "gesture.mousewheel"
| "gesture.mousemove"
| "gesture.momentum"
| "gesture.fire"
| "initAnimation.start"
| "initAnimation.end"
| "camera.update"
| "intersect.update"
| "pano.select"
| "pano.request"
| "pano.prepare"
| "pano.moveTo"
| "pano.moving"
| "pano.arrived"
| "pano.cancel"
| "pano.error"
| "pano.texture.load"
| "pano.texture.progress"
| "pano.texture.success"
| "pano.texture.error"
| "pano.texture.abort"
| "xr.session.end"
| "xr.session.start"
| "xr.gesture.tap"
| "xr.gesture.press"
| "xr.gesture.buttonUp"
| "xr.gesture.buttonDown"
| "xr.controller.update"
| (keyof LegacyEventType)
| "works.request"
| "works.load"
| "works.ready"
| "state.set"
| "state.change"
| "state.synced"
| "currentState.change"
| "model.request"
| "model.load"
| "model.error"
| "model.changeShownFloor"
| "models.load"
| "models.refined"
| "models.tileLoad"
| "models.tileUnload"
| "render.prepare"
| "mode.change.request"
| "mode.change"
| "helpers.visible"
| "network.resource"
| "fps",
>(
name: K,
callback: (
this: this,
...args: Parameters<EventTypes[K]>,
) => ReturnType<EventTypes[K]>,
once?: boolean,
): () => void;
once<
K extends
| "dispose"
| "error"
| "render"
| "gesture.pan"
| "gesture.tap"
| "gesture.dbltap"
| "gesture.press"
| "gesture.pinch"
| "gesture.mousewheel"
| "gesture.mousemove"
| "gesture.momentum"
| "gesture.fire"
| "initAnimation.start"
| "initAnimation.end"
| "camera.update"
| "intersect.update"
| "pano.select"
| "pano.request"
| "pano.prepare"
| "pano.moveTo"
| "pano.moving"
| "pano.arrived"
| "pano.cancel"
| "pano.error"
| "pano.texture.load"
| "pano.texture.progress"
| "pano.texture.success"
| "pano.texture.error"
| "pano.texture.abort"
| "xr.session.end"
| "xr.session.start"
| "xr.gesture.tap"
| "xr.gesture.press"
| "xr.gesture.buttonUp"
| "xr.gesture.buttonDown"
| "xr.controller.update"
| (keyof LegacyEventType)
| "works.request"
| "works.load"
| "works.ready"
| "state.set"
| "state.change"
| "state.synced"
| "currentState.change"
| "model.request"
| "model.load"
| "model.error"
| "model.changeShownFloor"
| "models.load"
| "models.refined"
| "models.tileLoad"
| "models.tileUnload"
| "render.prepare"
| "mode.change.request"
| "mode.change"
| "helpers.visible"
| "network.resource"
| "fps",
>(
name: K,
callback: (
this: this,
...args: Parameters<EventTypes[K]>,
) => ReturnType<EventTypes[K]>,
): () => void;
waitUntil<
K extends
| "dispose"
| "error"
| "render"
| "gesture.pan"
| "gesture.tap"
| "gesture.dbltap"
| "gesture.press"
| "gesture.pinch"
| "gesture.mousewheel"
| "gesture.mousemove"
| "gesture.momentum"
| "gesture.fire"
| "initAnimation.start"
| "initAnimation.end"
| "camera.update"
| "intersect.update"
| "pano.select"
| "pano.request"
| "pano.prepare"
| "pano.moveTo"
| "pano.moving"
| "pano.arrived"
| "pano.cancel"
| "pano.error"
| "pano.texture.load"
| "pano.texture.progress"
| "pano.texture.success"
| "pano.texture.error"
| "pano.texture.abort"
| "xr.session.end"
| "xr.session.start"
| "xr.gesture.tap"
| "xr.gesture.press"
| "xr.gesture.buttonUp"
| "xr.gesture.buttonDown"
| "xr.controller.update"
| (keyof LegacyEventType)
| "works.request"
| "works.load"
| "works.ready"
| "state.set"
| "state.change"
| "state.synced"
| "currentState.change"
| "model.request"
| "model.load"
| "model.error"
| "model.changeShownFloor"
| "models.load"
| "models.refined"
| "models.tileLoad"
| "models.tileUnload"
| "render.prepare"
| "mode.change.request"
| "mode.change"
| "helpers.visible"
| "network.resource"
| "fps",
>(
name: K,
filter?: (...args: Parameters<EventTypes[K]>) => boolean | void,
): Promise<Parameters<EventTypes[K]>>;
}

#### Hierarchy (View Summary)

- Subscribe<EventTypes>
  - FiveInjectionTypes

- Defined in lib/react/withFive.ts:328

##### Index

### Properties

cameraDirection
cameraRaycaster
currentObserver
currentState
getPixels
helperVisible
intersectRaycaster
loadWork
model
modelReadyState
models
needsRender
preloadPano
project2d
render
scene
setState
showFloor
shownFloor
state
toggleHelperVisible
unsafe__fiveInstance
updateCamera
work
works

### Methods

emit
hasListener
off
on
once
waitUntil

## Properties

### cameraDirection

cameraDirection: Vector3

Five React Inject: Five cameraDirection

- Defined in lib/react/withFive.ts:386

### cameraRaycaster

cameraRaycaster: Raycaster

Five React Inject: Five cameraRaycaster

- Defined in lib/react/withFive.ts:391

### currentObserver

currentObserver: WorkObserver

Five React Inject: Five currentState

- Defined in lib/react/withFive.ts:381

### currentState

currentState: State

Five React Inject: Five 的当前状态

#### Description

    five 设置了以下状态

    - mode: Mode
    - panoId: string
    - panoIndex: number
    - longitude: number
    - latitude: number
    - fov: number
    - offset: THREE.Vector3

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

- Defined in lib/react/withFive.ts:376

### getPixels

getPixels: {
<
T extends
Uint8Array<ArrayBufferLike>
| Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>,
>(
x: number,
y: number,
width: number,
height: number,
pixelRatio?: number,
flipY?: boolean,
buffer?: T,
): T;
<
T extends
Uint8Array<ArrayBufferLike>
| Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>,
>(
options: {
buffer?: T;
flipY?: boolean;
height: number;
helperVisible?: boolean;
pixelRatio?: number;
skipPanorama?: boolean;
width: number;
x: number;
y: number;
},
): T;
}

获取画面中的像素颜色

#### Type Declaration

- - <
    T extends
    Uint8Array<ArrayBufferLike>
    | Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>,
    >(
    x: number,
    y: number,
    width: number,
    height: number,
    pixelRatio?: number,
    flipY?: boolean,
    buffer?: T,
    ): T

  - 获取画面中的像素颜色

    #### Type Parameters

    - T extends Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>

    #### Parameters

    - x: number

      获取像素区域的起始坐标 x

    - y: number

      获取像素区域的起始坐标 y

    - width: number

      获取像素区域的宽度

    - height: number

      获取像素区域的高度

    - `Optional` pixelRatio: number

      获取区域的像素比

    - `Optional` flipY: boolean

      是否Y轴翻转

    - `Optional` buffer: T

      存储数组

    #### Returns T

    rgba颜色平铺的 Uint8Array

  - <
    T extends
    Uint8Array<ArrayBufferLike>
    | Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>,
    >(
    options: {
    buffer?: T;
    flipY?: boolean;
    height: number;
    helperVisible?: boolean;
    pixelRatio?: number;
    skipPanorama?: boolean;
    width: number;
    x: number;
    y: number;
    },
    ): T

  - 获取画面中的像素颜色

    #### Type Parameters

    - T extends Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> = Uint8Array<ArrayBufferLike>

    #### Parameters

    - options: {
      buffer?: T;
      flipY?: boolean;
      height: number;
      helperVisible?: boolean;
      pixelRatio?: number;
      skipPanorama?: boolean;
      width: number;
      x: number;
      y: number;
      }

      参数

      - ##### `Optional` buffer?: T

        存储数组

      - ##### `Optional` flipY?: boolean

        是否Y轴翻转

      - ##### height: number

        获取像素区域的高度

      - ##### `Optional` helperVisible?: boolean

      - ##### `Optional` pixelRatio?: number

        获取区域的像素比

      - ##### `Optional` skipPanorama?: boolean

      - ##### width: number

        获取像素区域的宽度

      - ##### x: number

        获取像素区域的起始坐标 x

      - ##### y: number

        获取像素区域的起始坐标 y

    #### Returns T

#### Param: x

获取像素区域的起始坐标 x

#### Param: y

获取像素区域的起始坐标 y

#### Param: width

获取像素区域的宽度

#### Param: height

获取像素区域的高度

#### Param: pixelRatio

获取区域的像素比

#### Returns

rgba颜色平铺的 Uint8Array

- Defined in lib/react/withFive.ts:506

### helperVisible

helperVisible: boolean | undefined

Five React Inject: Five helperVisible

- Defined in lib/react/withFive.ts:432

### intersectRaycaster

intersectRaycaster: (
raycaster: Raycaster,
target?: Intersection[],
) => Intersection[]

计算模型射线碰撞检测

#### Type Declaration

- - (raycaster: Raycaster, target?: Intersection[]): Intersection[]

  - 计算模型射线碰撞检测

    #### Parameters

    - raycaster: Raycaster

      THREE 射线对象

    - `Optional` target: Intersection[]

      返回碰撞

    #### Returns Intersection[]

    返回碰撞

#### Param: raycaster

THREE 射线对象

#### Param: floor

和某一楼层做碰撞检测， 不传为和所有楼层做碰撞检测

#### Returns

返回碰撞

- Defined in lib/react/withFive.ts:474

### loadWork

loadWork: (
inputWork:
| string
| string[]
| LooseWork
| Work
| Work[]
| LooseWork[]
| LooseWorkWithExtrinsics[]
| Promise<
LooseWork
| Work
| Work[]
| LooseWork[]
| LooseWorkWithExtrinsics[],
>,
state?: "initial" | "inherit" | Partial<State>,
options?: number | FiveLoadOptions,
userAction?: boolean,
) => Promise<void>

加载 Work 数据

#### Type Declaration

- - (
    inputWork:
    | string
    | string[]
    | LooseWork
    | Work
    | Work[]
    | LooseWork[]
    | LooseWorkWithExtrinsics[]
    | Promise<
    LooseWork
    | Work
    | Work[]
    | LooseWork[]
    | LooseWorkWithExtrinsics[],
    >,
    state?: "initial" | "inherit" | Partial<State>,
    options?: number | FiveLoadOptions,
    userAction?: boolean,
    ): Promise<void>

  - 加载 Work 数据

    #### Parameters

    - inputWork:
      | string
      | string[]
      | LooseWork
      | Work
      | Work[]
      | LooseWork[]
      | LooseWorkWithExtrinsics[]
      | Promise<
      LooseWork
      | Work
      | Work[]
      | LooseWork[]
      | LooseWorkWithExtrinsics[],
      >

      Work 数据

    - `Optional` state: "initial" | "inherit" | Partial<State>

      初始化姿态

      - "inherit" 使用当前姿态
      - "initial" 使用 Work 数据中的 initial 姿态
      - State 自定义姿态
    - `Optional` options: number | FiveLoadOptions

      切换时间, 切换效果

    - userAction: boolean = true

    #### Returns Promise<void>

#### Param: inputWork

Work 数据

#### Param: state

初始化姿态

- "inherit" 使用当前姿态
- "initial" 使用 Work 数据中的 initial 姿态
- State 自定义姿态

#### Param: duration

切换时间

- Defined in lib/react/withFive.ts:466

### model

model: Model

Five React Inject: Five model

- Defined in lib/react/withFive.ts:406

### modelReadyState

modelReadyState: "Empty" | "Loaded" | undefined

Five React Inject: Five modelReadyState

- Defined in lib/react/withFive.ts:421

### models

models: Models

Five React Inject: Five models

- Defined in lib/react/withFive.ts:411

### needsRender

needsRender: () => void

下一帧渲染

#### Description

调用 `render()` 和设置 `needsRender()` 均可在按需渲染时，使得画面渲染一次 区别在于：

- `needsRender()` 为在下帧渲染画面
- `render()` 在当前帧渲染画面 推荐使用 `needsRender()`, 可以更加流畅。但是如果需要截图等同步操作，可以使用 `render()`

- Defined in lib/react/withFive.ts:531

### preloadPano

preloadPano: (
pano: number | Pano | `${string}[${number}]`,
callback?: (costs: number) => void,
) => Promise<number>

预加载点位图片资源

#### Type Declaration

- - (
    pano: number | Pano | `${string}[${number}]`,
    callback?: (costs: number) => void,
    ): Promise<number>

  - 预加载点位图片资源

    #### Parameters

    - pano: number | Pano | `${string}[${number}]`

      观察点序号

    - callback: (costs: number) => void = noop

      加载完成回调, 并传递加载用时。

    #### Returns Promise<number>

    加载完成的 Promise 参数同 callback

#### Param: panoId

观察点

#### Param: callback

加载完成回调, 并传递加载用时。

#### Returns

加载完成的 Promise 参数同 callback

- Defined in lib/react/withFive.ts:539

### project2d

project2d: (vector: Vector3, testModel?: boolean) => Vector2 | null

计算三维坐标对应到屏幕的二维坐标

#### Type Declaration

- - (vector: Vector3, testModel?: boolean): Vector2 | null

  - 计算三维坐标对应到屏幕的二维坐标

    #### Parameters

    - vector: Vector3

      三维坐标

    - testModel: boolean = false

      是否计算模型遮挡

    #### Returns Vector2 | null

    二维坐标 或者 null

    #### Description

    如果三维坐标不在屏幕中，则返回 null

#### Description

如果三维坐标不在屏幕中，则返回 null

#### Param: vector

三维坐标

#### Param: testModel

是否计算模型遮挡

#### Returns

二维坐标 或者 null

- Defined in lib/react/withFive.ts:484

### render

render: (callback?: () => void) => void

强制渲染

#### Type Declaration

- - (callback?: () => void): void

  - 强制渲染

    #### Parameters

    - `Optional` callback: () => void

      渲染完成回调

    #### Returns void

    #### Description

    调用 `five.render()` 和设置 `five.needsRender = true` 均可在按需渲染时，使得画面渲染一次 区别在于：

    - `five.needsRender = true` 为在下帧渲染画面
    - `five.render()` 在当前帧渲染画面 推荐使用 `five.needsRender = true`, 可以更加流畅。但是如果需要截图等同步操作，可以使用 `five.render()`

#### Description

调用 `render()` 和设置 `needsRender()` 均可在按需渲染时，使得画面渲染一次 区别在于：

- `needsRender()` 为在下帧渲染画面
- `render()` 在当前帧渲染画面 推荐使用 `needsRender()`, 可以更加流畅。但是如果需要截图等同步操作，可以使用 `render()`

#### Param: callback

渲染完成回调

- Defined in lib/react/withFive.ts:519

### scene

scene: Scene

Five React Inject: Five models

- Defined in lib/react/withFive.ts:416

### setState

setState: (
state: Partial<State>,
immediately?: boolean,
userAction?: boolean,
) => void

设置 State

#### Type Declaration

- - (state: Partial<State>, immediately?: boolean, userAction?: boolean): void

  - 设置 State

    #### Parameters

    - state: Partial<State>

      目标状态

    - immediately: boolean = false

      是否马上转换，马上转换会尽快达到目标状态，尽量减少中间状态，更少动画。

    - userAction: boolean = true

      是否是用户触发的动作

    #### Returns void

    #### Description

        five 设置了以下状态

        - mode: Mode
        - panoIndex: number
        - longitude: number
        - latitude: number
        - distance: number
        - fov: number
        - offset: THREE.Vector3

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

#### Description

    five 设置了以下状态

    - mode: Mode
    - panoId: string
    - panoIndex: number
    - longitude: number
    - latitude: number
    - fov: number
    - offset: THREE.Vector3

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

#### Param: state

目标状态

#### Param: immediately

是否马上转换，马上转换会尽快达到目标状态，尽量减少中间状态，更少动画。

- Defined in lib/react/withFive.ts:455

### showFloor

showFloor: (floorIndex?: number) => void

显示楼层

#### Type Declaration

- - (floorIndex?: number): void

  - #### Parameters

    - `Optional` floorIndex: number

      楼层，如果不传则都显示

    #### Returns void

- Defined in lib/react/withFive.ts:545

### shownFloor

shownFloor: number | null | undefined

Five React Inject: Five shownFloor

- Defined in lib/react/withFive.ts:427

### state

state: State

Five React Inject: Five 的目标状态

#### Description

    five 设置了以下状态

    - mode: Mode
    - panoId: string
    - panoIndex: number
    - longitude: number
    - latitude: number
    - fov: number
    - offset: THREE.Vector3

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

- Defined in lib/react/withFive.ts:355

### toggleHelperVisible

toggleHelperVisible: (visible: boolean) => void

帮助元素的隐藏/显示

#### Type Declaration

- - (visible: boolean): void

  - #### Parameters

    - visible: boolean

      隐藏/显示

    #### Returns void

- Defined in lib/react/withFive.ts:551

### unsafe__fiveInstance

unsafe__fiveInstance: Five

Five React Inject: 获取 five 实例

#### Description

不到万不得已，并不推荐直接使用。

#### Deprecated

不到万不得已，并不推荐直接使用。

- Defined in lib/react/withFive.ts:334

### updateCamera

updateCamera: (
pose: Partial<Pose>,
duration: number,
userAction?: boolean,
) => Promise<void>

移动相机。（不触发点位移动）

#### Type Declaration

- - (pose: Partial<Pose>, duration: number, userAction?: boolean): Promise<void>

  - 移动相机。（不触发点位移动）

    #### Parameters

    - pose: Partial<Pose>

      相机目标位置

    - duration: number

      动画触发的时常

    - userAction: boolean = true

      是否用户触发

    #### Returns Promise<void>

    Promise 是否移动成功

    #### Description

    如果动画中途被打断（用户触发行为，或者调用 setState, load, changeMode）的等 会 Promise.reject。运动完成则 Promise.resolve

#### Description

如果动画中途被打断（用户触发行为，或者调用 setState, load, changeMode）的等 会 Promise.reject。运动完成则 Promise.resolve

#### Param: pose

相机目标位置

#### Param: duration

动画触发的时常

#### Returns

Promise 是否移动成功

- Defined in lib/react/withFive.ts:495

### work

work: Work

Five React Inject: Five Work

- Defined in lib/react/withFive.ts:396

### works

works: Works

Five React Inject: Five Work

- Defined in lib/react/withFive.ts:401

## Methods

### emit

- emit<
  K extends
  | "dispose"
  | "error"
  | "render"
  | "gesture.pan"
  | "gesture.tap"
  | "gesture.dbltap"
  | "gesture.press"
  | "gesture.pinch"
  | "gesture.mousewheel"
  | "gesture.mousemove"
  | "gesture.momentum"
  | "gesture.fire"
  | "initAnimation.start"
  | "initAnimation.end"
  | "camera.update"
  | "intersect.update"
  | "pano.select"
  | "pano.request"
  | "pano.prepare"
  | "pano.moveTo"
  | "pano.moving"
  | "pano.arrived"
  | "pano.cancel"
  | "pano.error"
  | "pano.texture.load"
  | "pano.texture.progress"
  | "pano.texture.success"
  | "pano.texture.error"
  | "pano.texture.abort"
  | "xr.session.end"
  | "xr.session.start"
  | "xr.gesture.tap"
  | "xr.gesture.press"
  | "xr.gesture.buttonUp"
  | "xr.gesture.buttonDown"
  | "xr.controller.update"
  | (keyof LegacyEventType)
  | "works.request"
  | "works.load"
  | "works.ready"
  | "state.set"
  | "state.change"
  | "state.synced"
  | "currentState.change"
  | "model.request"
  | "model.load"
  | "model.error"
  | "model.changeShownFloor"
  | "models.load"
  | "models.refined"
  | "models.tileLoad"
  | "models.tileUnload"
  | "render.prepare"
  | "mode.change.request"
  | "mode.change"
  | "helpers.visible"
  | "network.resource"
  | "fps",
  >(
  name: K,
  ...data: Parameters<EventTypes[K]>,
  ): boolean

  触发事件

  #### Type Parameters

  - K extends
    | "dispose"
    | "error"
    | "render"
    | "gesture.pan"
    | "gesture.tap"
    | "gesture.dbltap"
    | "gesture.press"
    | "gesture.pinch"
    | "gesture.mousewheel"
    | "gesture.mousemove"
    | "gesture.momentum"
    | "gesture.fire"
    | "initAnimation.start"
    | "initAnimation.end"
    | "camera.update"
    | "intersect.update"
    | "pano.select"
    | "pano.request"
    | "pano.prepare"
    | "pano.moveTo"
    | "pano.moving"
    | "pano.arrived"
    | "pano.cancel"
    | "pano.error"
    | "pano.texture.load"
    | "pano.texture.progress"
    | "pano.texture.success"
    | "pano.texture.error"
    | "pano.texture.abort"
    | "xr.session.end"
    | "xr.session.start"
    | "xr.gesture.tap"
    | "xr.gesture.press"
    | "xr.gesture.buttonUp"
    | "xr.gesture.buttonDown"
    | "xr.controller.update"
    | (keyof LegacyEventType)
    | "works.request"
    | "works.load"
    | "works.ready"
    | "state.set"
    | "state.change"
    | "state.synced"
    | "currentState.change"
    | "model.request"
    | "model.load"
    | "model.error"
    | "model.changeShownFloor"
    | "models.load"
    | "models.refined"
    | "models.tileLoad"
    | "models.tileUnload"
    | "render.prepare"
    | "mode.change.request"
    | "mode.change"
    | "helpers.visible"
    | "network.resource"
    | "fps"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - ...data: Parameters<EventTypes[K]>

    触发事件的数据

  #### Returns boolean

  canceled 是否被触发取消

  Inherited from Subscribe.emit

  - Defined in lib/five/utils/subscribe.ts:131

### hasListener

- hasListener(
  name:
  | "dispose"
  | "error"
  | "render"
  | "gesture.pan"
  | "gesture.tap"
  | "gesture.dbltap"
  | "gesture.press"
  | "gesture.pinch"
  | "gesture.mousewheel"
  | "gesture.mousemove"
  | "gesture.momentum"
  | "gesture.fire"
  | "initAnimation.start"
  | "initAnimation.end"
  | "camera.update"
  | "intersect.update"
  | "pano.select"
  | "pano.request"
  | "pano.prepare"
  | "pano.moveTo"
  | "pano.moving"
  | "pano.arrived"
  | "pano.cancel"
  | "pano.error"
  | "pano.texture.load"
  | "pano.texture.progress"
  | "pano.texture.success"
  | "pano.texture.error"
  | "pano.texture.abort"
  | "xr.session.end"
  | "xr.session.start"
  | "xr.gesture.tap"
  | "xr.gesture.press"
  | "xr.gesture.buttonUp"
  | "xr.gesture.buttonDown"
  | "xr.controller.update"
  | (keyof LegacyEventType)
  | "works.request"
  | "works.load"
  | "works.ready"
  | "state.set"
  | "state.change"
  | "state.synced"
  | "currentState.change"
  | "model.request"
  | "model.load"
  | "model.error"
  | "model.changeShownFloor"
  | "models.load"
  | "models.refined"
  | "models.tileLoad"
  | "models.tileUnload"
  | "render.prepare"
  | "mode.change.request"
  | "mode.change"
  | "helpers.visible"
  | "network.resource"
  | "fps",
  ): boolean

  判断是否注册了事件

  #### Parameters

  - name:
    | "dispose"
    | "error"
    | "render"
    | "gesture.pan"
    | "gesture.tap"
    | "gesture.dbltap"
    | "gesture.press"
    | "gesture.pinch"
    | "gesture.mousewheel"
    | "gesture.mousemove"
    | "gesture.momentum"
    | "gesture.fire"
    | "initAnimation.start"
    | "initAnimation.end"
    | "camera.update"
    | "intersect.update"
    | "pano.select"
    | "pano.request"
    | "pano.prepare"
    | "pano.moveTo"
    | "pano.moving"
    | "pano.arrived"
    | "pano.cancel"
    | "pano.error"
    | "pano.texture.load"
    | "pano.texture.progress"
    | "pano.texture.success"
    | "pano.texture.error"
    | "pano.texture.abort"
    | "xr.session.end"
    | "xr.session.start"
    | "xr.gesture.tap"
    | "xr.gesture.press"
    | "xr.gesture.buttonUp"
    | "xr.gesture.buttonDown"
    | "xr.controller.update"
    | (keyof LegacyEventType)
    | "works.request"
    | "works.load"
    | "works.ready"
    | "state.set"
    | "state.change"
    | "state.synced"
    | "currentState.change"
    | "model.request"
    | "model.load"
    | "model.error"
    | "model.changeShownFloor"
    | "models.load"
    | "models.refined"
    | "models.tileLoad"
    | "models.tileUnload"
    | "render.prepare"
    | "mode.change.request"
    | "mode.change"
    | "helpers.visible"
    | "network.resource"
    | "fps"

    事件类型

  #### Returns boolean

  Inherited from Subscribe.hasListener

  - Defined in lib/five/utils/subscribe.ts:44

### off

- off<
  K extends
  | "dispose"
  | "error"
  | "render"
  | "gesture.pan"
  | "gesture.tap"
  | "gesture.dbltap"
  | "gesture.press"
  | "gesture.pinch"
  | "gesture.mousewheel"
  | "gesture.mousemove"
  | "gesture.momentum"
  | "gesture.fire"
  | "initAnimation.start"
  | "initAnimation.end"
  | "camera.update"
  | "intersect.update"
  | "pano.select"
  | "pano.request"
  | "pano.prepare"
  | "pano.moveTo"
  | "pano.moving"
  | "pano.arrived"
  | "pano.cancel"
  | "pano.error"
  | "pano.texture.load"
  | "pano.texture.progress"
  | "pano.texture.success"
  | "pano.texture.error"
  | "pano.texture.abort"
  | "xr.session.end"
  | "xr.session.start"
  | "xr.gesture.tap"
  | "xr.gesture.press"
  | "xr.gesture.buttonUp"
  | "xr.gesture.buttonDown"
  | "xr.controller.update"
  | (keyof LegacyEventType)
  | "works.request"
  | "works.load"
  | "works.ready"
  | "state.set"
  | "state.change"
  | "state.synced"
  | "currentState.change"
  | "model.request"
  | "model.load"
  | "model.error"
  | "model.changeShownFloor"
  | "models.load"
  | "models.refined"
  | "models.tileLoad"
  | "models.tileUnload"
  | "render.prepare"
  | "mode.change.request"
  | "mode.change"
  | "helpers.visible"
  | "network.resource"
  | "fps",
  >(
  name?: K,
  callback?: (
  ...args: Parameters<EventTypes[K]>,
  ) => ReturnType<EventTypes[K]>,
  ): void

  解除事件

  如果 name 不传的话解除对应所有事件 如果 name, callback 不传的话解除所有name的所有事件

  #### Type Parameters

  - K extends
    | "dispose"
    | "error"
    | "render"
    | "gesture.pan"
    | "gesture.tap"
    | "gesture.dbltap"
    | "gesture.press"
    | "gesture.pinch"
    | "gesture.mousewheel"
    | "gesture.mousemove"
    | "gesture.momentum"
    | "gesture.fire"
    | "initAnimation.start"
    | "initAnimation.end"
    | "camera.update"
    | "intersect.update"
    | "pano.select"
    | "pano.request"
    | "pano.prepare"
    | "pano.moveTo"
    | "pano.moving"
    | "pano.arrived"
    | "pano.cancel"
    | "pano.error"
    | "pano.texture.load"
    | "pano.texture.progress"
    | "pano.texture.success"
    | "pano.texture.error"
    | "pano.texture.abort"
    | "xr.session.end"
    | "xr.session.start"
    | "xr.gesture.tap"
    | "xr.gesture.press"
    | "xr.gesture.buttonUp"
    | "xr.gesture.buttonDown"
    | "xr.controller.update"
    | (keyof LegacyEventType)
    | "works.request"
    | "works.load"
    | "works.ready"
    | "state.set"
    | "state.change"
    | "state.synced"
    | "currentState.change"
    | "model.request"
    | "model.load"
    | "model.error"
    | "model.changeShownFloor"
    | "models.load"
    | "models.refined"
    | "models.tileLoad"
    | "models.tileUnload"
    | "render.prepare"
    | "mode.change.request"
    | "mode.change"
    | "helpers.visible"
    | "network.resource"
    | "fps"

    预设的监听事件名称

  #### Parameters

  - `Optional` name: K

    事件类型

  - `Optional` callback: (...args: Parameters<EventTypes[K]>) => ReturnType<EventTypes[K]>

    事件回调函数

  #### Returns void

  Inherited from Subscribe.off

  - Defined in lib/five/utils/subscribe.ts:97

### on

- on<
  K extends
  | "dispose"
  | "error"
  | "render"
  | "gesture.pan"
  | "gesture.tap"
  | "gesture.dbltap"
  | "gesture.press"
  | "gesture.pinch"
  | "gesture.mousewheel"
  | "gesture.mousemove"
  | "gesture.momentum"
  | "gesture.fire"
  | "initAnimation.start"
  | "initAnimation.end"
  | "camera.update"
  | "intersect.update"
  | "pano.select"
  | "pano.request"
  | "pano.prepare"
  | "pano.moveTo"
  | "pano.moving"
  | "pano.arrived"
  | "pano.cancel"
  | "pano.error"
  | "pano.texture.load"
  | "pano.texture.progress"
  | "pano.texture.success"
  | "pano.texture.error"
  | "pano.texture.abort"
  | "xr.session.end"
  | "xr.session.start"
  | "xr.gesture.tap"
  | "xr.gesture.press"
  | "xr.gesture.buttonUp"
  | "xr.gesture.buttonDown"
  | "xr.controller.update"
  | (keyof LegacyEventType)
  | "works.request"
  | "works.load"
  | "works.ready"
  | "state.set"
  | "state.change"
  | "state.synced"
  | "currentState.change"
  | "model.request"
  | "model.load"
  | "model.error"
  | "model.changeShownFloor"
  | "models.load"
  | "models.refined"
  | "models.tileLoad"
  | "models.tileUnload"
  | "render.prepare"
  | "mode.change.request"
  | "mode.change"
  | "helpers.visible"
  | "network.resource"
  | "fps",
  >(
  name: K,
  callback: (
  this: this,
  ...args: Parameters<EventTypes[K]>,
  ) => ReturnType<EventTypes[K]>,
  once?: boolean,
  ): () => void

  注册事件

  #### Type Parameters

  - K extends
    | "dispose"
    | "error"
    | "render"
    | "gesture.pan"
    | "gesture.tap"
    | "gesture.dbltap"
    | "gesture.press"
    | "gesture.pinch"
    | "gesture.mousewheel"
    | "gesture.mousemove"
    | "gesture.momentum"
    | "gesture.fire"
    | "initAnimation.start"
    | "initAnimation.end"
    | "camera.update"
    | "intersect.update"
    | "pano.select"
    | "pano.request"
    | "pano.prepare"
    | "pano.moveTo"
    | "pano.moving"
    | "pano.arrived"
    | "pano.cancel"
    | "pano.error"
    | "pano.texture.load"
    | "pano.texture.progress"
    | "pano.texture.success"
    | "pano.texture.error"
    | "pano.texture.abort"
    | "xr.session.end"
    | "xr.session.start"
    | "xr.gesture.tap"
    | "xr.gesture.press"
    | "xr.gesture.buttonUp"
    | "xr.gesture.buttonDown"
    | "xr.controller.update"
    | (keyof LegacyEventType)
    | "works.request"
    | "works.load"
    | "works.ready"
    | "state.set"
    | "state.change"
    | "state.synced"
    | "currentState.change"
    | "model.request"
    | "model.load"
    | "model.error"
    | "model.changeShownFloor"
    | "models.load"
    | "models.refined"
    | "models.tileLoad"
    | "models.tileUnload"
    | "render.prepare"
    | "mode.change.request"
    | "mode.change"
    | "helpers.visible"
    | "network.resource"
    | "fps"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - callback: (this: this, ...args: Parameters<EventTypes[K]>) => ReturnType<EventTypes[K]>

    事件回调函数

  - `Optional` once: boolean

    是否只执行一次

  #### Returns () => void

  解除事件

  Inherited from Subscribe.on

  - Defined in lib/five/utils/subscribe.ts:58

### once

- once<
  K extends
  | "dispose"
  | "error"
  | "render"
  | "gesture.pan"
  | "gesture.tap"
  | "gesture.dbltap"
  | "gesture.press"
  | "gesture.pinch"
  | "gesture.mousewheel"
  | "gesture.mousemove"
  | "gesture.momentum"
  | "gesture.fire"
  | "initAnimation.start"
  | "initAnimation.end"
  | "camera.update"
  | "intersect.update"
  | "pano.select"
  | "pano.request"
  | "pano.prepare"
  | "pano.moveTo"
  | "pano.moving"
  | "pano.arrived"
  | "pano.cancel"
  | "pano.error"
  | "pano.texture.load"
  | "pano.texture.progress"
  | "pano.texture.success"
  | "pano.texture.error"
  | "pano.texture.abort"
  | "xr.session.end"
  | "xr.session.start"
  | "xr.gesture.tap"
  | "xr.gesture.press"
  | "xr.gesture.buttonUp"
  | "xr.gesture.buttonDown"
  | "xr.controller.update"
  | (keyof LegacyEventType)
  | "works.request"
  | "works.load"
  | "works.ready"
  | "state.set"
  | "state.change"
  | "state.synced"
  | "currentState.change"
  | "model.request"
  | "model.load"
  | "model.error"
  | "model.changeShownFloor"
  | "models.load"
  | "models.refined"
  | "models.tileLoad"
  | "models.tileUnload"
  | "render.prepare"
  | "mode.change.request"
  | "mode.change"
  | "helpers.visible"
  | "network.resource"
  | "fps",
  >(
  name: K,
  callback: (
  this: this,
  ...args: Parameters<EventTypes[K]>,
  ) => ReturnType<EventTypes[K]>,
  ): () => void

  注册事件(是否只执行一次)

  #### Type Parameters

  - K extends
    | "dispose"
    | "error"
    | "render"
    | "gesture.pan"
    | "gesture.tap"
    | "gesture.dbltap"
    | "gesture.press"
    | "gesture.pinch"
    | "gesture.mousewheel"
    | "gesture.mousemove"
    | "gesture.momentum"
    | "gesture.fire"
    | "initAnimation.start"
    | "initAnimation.end"
    | "camera.update"
    | "intersect.update"
    | "pano.select"
    | "pano.request"
    | "pano.prepare"
    | "pano.moveTo"
    | "pano.moving"
    | "pano.arrived"
    | "pano.cancel"
    | "pano.error"
    | "pano.texture.load"
    | "pano.texture.progress"
    | "pano.texture.success"
    | "pano.texture.error"
    | "pano.texture.abort"
    | "xr.session.end"
    | "xr.session.start"
    | "xr.gesture.tap"
    | "xr.gesture.press"
    | "xr.gesture.buttonUp"
    | "xr.gesture.buttonDown"
    | "xr.controller.update"
    | (keyof LegacyEventType)
    | "works.request"
    | "works.load"
    | "works.ready"
    | "state.set"
    | "state.change"
    | "state.synced"
    | "currentState.change"
    | "model.request"
    | "model.load"
    | "model.error"
    | "model.changeShownFloor"
    | "models.load"
    | "models.refined"
    | "models.tileLoad"
    | "models.tileUnload"
    | "render.prepare"
    | "mode.change.request"
    | "mode.change"
    | "helpers.visible"
    | "network.resource"
    | "fps"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - callback: (this: this, ...args: Parameters<EventTypes[K]>) => ReturnType<EventTypes[K]>

    事件回调函数

  #### Returns () => void

  解除事件

  Inherited from Subscribe.once

  - Defined in lib/five/utils/subscribe.ts:81

### waitUntil

- waitUntil<
  K extends
  | "dispose"
  | "error"
  | "render"
  | "gesture.pan"
  | "gesture.tap"
  | "gesture.dbltap"
  | "gesture.press"
  | "gesture.pinch"
  | "gesture.mousewheel"
  | "gesture.mousemove"
  | "gesture.momentum"
  | "gesture.fire"
  | "initAnimation.start"
  | "initAnimation.end"
  | "camera.update"
  | "intersect.update"
  | "pano.select"
  | "pano.request"
  | "pano.prepare"
  | "pano.moveTo"
  | "pano.moving"
  | "pano.arrived"
  | "pano.cancel"
  | "pano.error"
  | "pano.texture.load"
  | "pano.texture.progress"
  | "pano.texture.success"
  | "pano.texture.error"
  | "pano.texture.abort"
  | "xr.session.end"
  | "xr.session.start"
  | "xr.gesture.tap"
  | "xr.gesture.press"
  | "xr.gesture.buttonUp"
  | "xr.gesture.buttonDown"
  | "xr.controller.update"
  | (keyof LegacyEventType)
  | "works.request"
  | "works.load"
  | "works.ready"
  | "state.set"
  | "state.change"
  | "state.synced"
  | "currentState.change"
  | "model.request"
  | "model.load"
  | "model.error"
  | "model.changeShownFloor"
  | "models.load"
  | "models.refined"
  | "models.tileLoad"
  | "models.tileUnload"
  | "render.prepare"
  | "mode.change.request"
  | "mode.change"
  | "helpers.visible"
  | "network.resource"
  | "fps",
  >(
  name: K,
  filter?: (...args: Parameters<EventTypes[K]>) => boolean | void,
  ): Promise<Parameters<EventTypes[K]>>

  等待事件

  #### Type Parameters

  - K extends
    | "dispose"
    | "error"
    | "render"
    | "gesture.pan"
    | "gesture.tap"
    | "gesture.dbltap"
    | "gesture.press"
    | "gesture.pinch"
    | "gesture.mousewheel"
    | "gesture.mousemove"
    | "gesture.momentum"
    | "gesture.fire"
    | "initAnimation.start"
    | "initAnimation.end"
    | "camera.update"
    | "intersect.update"
    | "pano.select"
    | "pano.request"
    | "pano.prepare"
    | "pano.moveTo"
    | "pano.moving"
    | "pano.arrived"
    | "pano.cancel"
    | "pano.error"
    | "pano.texture.load"
    | "pano.texture.progress"
    | "pano.texture.success"
    | "pano.texture.error"
    | "pano.texture.abort"
    | "xr.session.end"
    | "xr.session.start"
    | "xr.gesture.tap"
    | "xr.gesture.press"
    | "xr.gesture.buttonUp"
    | "xr.gesture.buttonDown"
    | "xr.controller.update"
    | (keyof LegacyEventType)
    | "works.request"
    | "works.load"
    | "works.ready"
    | "state.set"
    | "state.change"
    | "state.synced"
    | "currentState.change"
    | "model.request"
    | "model.load"
    | "model.error"
    | "model.changeShownFloor"
    | "models.load"
    | "models.refined"
    | "models.tileLoad"
    | "models.tileUnload"
    | "render.prepare"
    | "mode.change.request"
    | "mode.change"
    | "helpers.visible"
    | "network.resource"
    | "fps"

    预设的监听事件名称

  #### Parameters

  - name: K

    事件类型

  - `Optional` filter: (...args: Parameters<EventTypes[K]>) => boolean | void

    事件类型

  #### Returns Promise<Parameters<EventTypes[K]>>

  触发事件的数据

  Inherited from Subscribe.waitUntil

  - Defined in lib/five/utils/subscribe.ts:155