import { ClientConnection } from 'message-event-channel'; import { HandlerContainer } from './handler-container'; import { IDevice } from './interfaces/settings'; export declare const KEY = "visualization-sdk:device"; export declare enum DEVICE_EVENTS { GET = "visualization-sdk:device:get", CHANGE = "visualization-sdk:device:change" } export declare type DeviceModel = IDevice; export declare type DeviceChangeHandler = (device: DeviceModel) => void; export declare type DeviceChangeDispose = () => void; /** * Device class allows you to get the currently selected device in the form and watch for changes to asynchronously update your application */ export declare class Device { connection: ClientConnection; changeHandlerContainer: HandlerContainer; constructor(connection: ClientConnection); /** * Get the current device selected * * ### Example * * ```typescript * const value = await visualization.device.get(); * * console.log(value) * ``` */ get(): Promise; /** * Sets up a listener for when the visualization device changes. * * @param cb - callback function to be called when the visualization device changes. * * @returns a dispose function which removes the listener * * ### Example * * ```typescript * const dispose = visualization.device.changed((model) => { * // handle device change * }) * ``` */ changed(cb: DeviceChangeHandler): DeviceChangeDispose; }