eye-analysis
Version:
Eye Analysis - Browser-based eye tracking and screen recording library for research and experiments
77 lines • 2.44 kB
TypeScript
import type { ScreenInfo, WindowInfo } from "./types";
export interface ScreenDetailed {
availLeft: number;
availTop: number;
availWidth: number;
availHeight: number;
left: number;
top: number;
width: number;
height: number;
isPrimary: boolean;
isInternal: boolean;
devicePixelRatio: number;
label?: string;
}
export interface ScreenDetails {
screens: ScreenDetailed[];
currentScreen: ScreenDetailed;
}
/**
* Get current browser window information
*/
export declare const getBrowserWindowInfo: () => WindowInfo;
/**
* Get current screen information
*/
export declare const getScreenInfo: () => ScreenInfo;
/**
* Check if Window Management API is supported
*/
export declare const isWindowManagementAPISupported: () => boolean;
/**
* Get screen details using Window Management API
*/
export declare const getScreenDetails: () => Promise<ScreenDetails | null>;
/**
* Get the screen that contains the current window
*/
export declare const getCurrentScreen: () => Promise<ScreenDetailed | null>;
/**
* Convert screen coordinates to window coordinates
* Uses Window Management API when available to get proper screen-relative coordinates
*/
export declare const screenToWindowCoordinates: (screenX: number, screenY: number, windowInfo: WindowInfo) => Promise<{
windowX: number;
windowY: number;
}>;
/**
* Synchronous version of screenToWindowCoordinates for backward compatibility
*/
export declare const screenToWindowCoordinatesSync: (screenX: number, screenY: number, windowInfo: WindowInfo) => {
windowX: number;
windowY: number;
};
/**
* Convert window coordinates to screen coordinates
* Uses Window Management API when available to get proper desktop coordinates
*/
export declare const windowToScreenCoordinates: (windowX: number, windowY: number, windowInfo: WindowInfo) => Promise<{
screenX: number;
screenY: number;
}>;
/**
* Synchronous version of windowToScreenCoordinates for backward compatibility
*/
export declare const windowToScreenCoordinatesSync: (windowX: number, windowY: number, windowInfo: WindowInfo) => {
screenX: number;
screenY: number;
};
/**
* Calculate content coordinates (considering scroll)
*/
export declare const windowToContentCoordinates: (windowX: number, windowY: number, windowInfo: WindowInfo) => {
contentX: number;
contentY: number;
};
//# sourceMappingURL=browser-info.d.ts.map