UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

98 lines (95 loc) 3.33 kB
/** * DevExtreme (core/devices.d.ts) * Version: 21.1.4 * Build date: Mon Jun 21 2021 * * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ /** * The device object defines the device on which the application is running. * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ export interface Device { /** * Indicates whether or not the device platform is Android. */ android?: boolean; /** * Specifies the type of the device on which the application is running. */ deviceType?: 'phone' | 'tablet' | 'desktop'; /** * Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic &apos;light&apos; or &apos;dark&apos; theme. */ generic?: boolean; /** * Specifies a performance grade of the current device. */ grade?: 'A' | 'B' | 'C'; /** * Indicates whether or not the device platform is iOS. */ ios?: boolean; /** * Indicates whether or not the device type is &apos;phone&apos;. */ phone?: boolean; /** * Specifies the platform of the device on which the application is running. */ platform?: 'android' | 'ios' | 'generic'; /** * Indicates whether or not the device type is &apos;tablet&apos;. */ tablet?: boolean; /** * Specifies an array with the major and minor versions of the device platform. */ version?: Array<number>; } /** * An object that serves as a namespace for the methods and events specifying information on the current device. */ declare class DevicesObject { constructor(options: { window?: Window }); /** * Gets information on the current device. */ current(): Device; /** * Overrides actual device information to force the application to operate as if it was running on a specified device. */ current(deviceName: string | Device): void; /** * Detaches all event handlers from a single event. */ off(eventName: string): this; /** * Detaches a particular event handler from a single event. */ off(eventName: string, eventHandler: Function): this; /** * Subscribes to an event. */ on(eventName: string, eventHandler: Function): this; /** * Subscribes to events. */ on(events: any): this; /** * Returns the current device orientation. */ orientation(): string; /** * Returns real information about the current device regardless of the value passed to the DevExpress.devices.current(deviceName) method. */ real(): Device; isSimulator(): boolean; } /** * * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ declare const devices: DevicesObject; export default devices;