UNPKG

spatial-controls

Version:

Configurable 3D movement controls.

87 lines (86 loc) 2.25 kB
import { EventDispatcher } from "three"; import { KeyCode } from "../input/KeyCode.js"; import { PointerButton } from "../input/PointerButton.js"; import { Bindings } from "./Bindings.js"; import { GeneralSettings } from "./GeneralSettings.js"; import { PointerSettings } from "./PointerSettings.js"; import { RotationSettings } from "./RotationSettings.js"; import { SettingsEventMap } from "./SettingsEventMap.js"; import { TranslationSettings } from "./TranslationSettings.js"; import { ZoomSettings } from "./ZoomSettings.js"; /** * Control settings. * * @group Settings */ export declare class Settings extends EventDispatcher<SettingsEventMap> { /** * Triggers when the settings are changed. * * @event */ static readonly EVENT_CHANGE = "change"; /** * Key bindings. * * This collection maps {@linkplain KeyCode key codes} to {@linkplain Action actions}. */ readonly keyBindings: Bindings<KeyCode>; /** * Pointer bindings. * * This collection maps {@linkplain PointerButton pointer buttons} to {@linkplain Action actions}. */ readonly pointerBindings: Bindings<PointerButton>; /** * General settings. */ readonly general: GeneralSettings; /** * Pointer settings. */ readonly pointer: PointerSettings; /** * Rotation settings. */ readonly rotation: RotationSettings; /** * Translation settings. */ readonly translation: TranslationSettings; /** * Zoom settings. */ readonly zoom: ZoomSettings; /** * Constructs new settings. */ constructor(); /** * Copies the given settings. * * @param settings - Settings. * @return This instance. */ copy(settings: Settings): Settings; /** * Clones these settings. * * @return The cloned settings. */ clone(): Settings; /** * Copies the given JSON data. * * @param json - The JSON data string. * @return This instance. */ fromJSON(json: string): Settings; /** * Exports these settings as a data blob. * * @return The settings blob. */ toBlob(): Blob; toJSON(): Record<string, unknown>; }