import { DeviceType } from "./deviceEnums"; import type { Nullable } from "../../types"; import { Observable } from "../../Misc/observable"; import type { DeviceSource } from "./deviceSource"; import type { IObservableManager, DeviceSourceType } from "../internalDeviceSourceManager"; import type { IDisposable } from "../../scene"; import type { AbstractEngine } from "../../Engines/abstractEngine"; import type { IUIEvent } from "../../Events/deviceInputEvents"; /** * Class to keep track of devices */ export declare class DeviceSourceManager implements IDisposable, IObservableManager { /** * Observable to be triggered when after a device is connected, any new observers added will be triggered against already connected devices */ readonly onDeviceConnectedObservable: Observable; /** * Observable to be triggered when after a device is disconnected */ readonly onDeviceDisconnectedObservable: Observable; private _engine; private _onDisposeObserver; private readonly _devices; private readonly _firstDevice; /** * Gets a DeviceSource, given a type and slot * @param deviceType - Type of Device * @param deviceSlot - Slot or ID of device * @returns DeviceSource */ getDeviceSource(deviceType: T, deviceSlot?: number): Nullable>; /** * Gets an array of DeviceSource objects for a given device type * @param deviceType - Type of Device * @returns All available DeviceSources of a given type */ getDeviceSources(deviceType: T): ReadonlyArray>; /** * Default constructor * @param engine - Used to get canvas (if applicable) */ constructor(engine: AbstractEngine); /** * Dispose of DeviceSourceManager */ dispose(): void; /** * @param deviceSource - Source to add * @internal */ _addDevice(deviceSource: DeviceSourceType): void; /** * @param deviceType - DeviceType * @param deviceSlot - DeviceSlot * @internal */ _removeDevice(deviceType: DeviceType, deviceSlot: number): void; /** * @param deviceType - DeviceType * @param deviceSlot - DeviceSlot * @param eventData - Event * @internal */ _onInputChanged(deviceType: T, deviceSlot: number, eventData: IUIEvent): void; private _updateFirstDevices; }