import type { FormatFileNameOptions, GetAddressBarShadowPaddingOptions, GetAndCreatePathOptions, GetMobileScreenSizeOptions, GetMobileViewPortPositionOptions, GetToolBarShadowPaddingOptions, ScreenshotSize } from './utils.interfaces.js'; import type { ClassOptions, CompareOptions } from './options.interfaces.js'; import type { Executor, Methods } from '../methods/methods.interfaces.js'; import type { DeviceRectangles } from '../methods/rectangles.interfaces.js'; /** * Get and create a folder */ export declare function getAndCreatePath(folder: string, options: GetAndCreatePathOptions): string; /** * Format the filename */ export declare function formatFileName(options: FormatFileNameOptions): string; /** * Checks if it is mobile */ export declare function checkIsMobile(platformName: string): boolean; /** * Checks if the os is Android */ export declare function checkIsAndroid(platformName: string): boolean; /** * Checks if the os is IOS */ export declare function checkIsIos(platformName: string): boolean; /** * Checks if the test is executed in a browser */ export declare function checkTestInBrowser(browserName: string): boolean; /** * Checks if the test is executed in a browser on a mobile phone */ export declare function checkTestInMobileBrowser(platformName: string, browserName: string): boolean; /** * Checks if this is a native webscreenshot on android */ export declare function checkAndroidNativeWebScreenshot(platformName: string, nativeWebscreenshot: boolean): boolean; /** * Checks if this is an Android chromedriver screenshot */ export declare function checkAndroidChromeDriverScreenshot(platformName: string, nativeWebScreenshot: boolean): boolean; /** * Get the address bar shadow padding. This is only needed for Android native webscreenshot and iOS */ export declare function getAddressBarShadowPadding(options: GetAddressBarShadowPaddingOptions): number; /** * Get the tool bar shadow padding. Add some extra padding for iOS when we have a home bar */ export declare function getToolBarShadowPadding(options: GetToolBarShadowPaddingOptions): number; /** * Calculate the data based on the device pixel ratio */ export declare function calculateDprData(data: T, devicePixelRatio: number): T; /** * Wait for an amount of milliseconds */ export declare function waitFor(milliseconds: number): Promise; /** * Get the size of a screenshot in pixels without the device pixel ratio */ export declare function getBase64ScreenshotSize(screenshot: string, devicePixelRation?: number): ScreenshotSize; /** * Get the device pixel ratio */ export declare function getDevicePixelRatio(screenshot: string, deviceScreenSize: { height: number; width: number; }): number; /** * Get the iOS bezel image names */ export declare function getIosBezelImageNames(normalizedDeviceName: string): { topImageName: string; bottomImageName: string; }; /** * Validate that the item is an object */ export declare function isObject(item: unknown): item is object | Function; /** * Validate if it's storybook */ export declare function isStorybook(): boolean; /** * Check if we want to update baseline images */ export declare function updateVisualBaseline(): boolean; /** * Log the deprecated root compareOptions (at `ClassOptions` level) * and returns non-undefined ones to be added back to the config */ export declare function logAllDeprecatedCompareOptions(options: ClassOptions): Partial; /** * Get the mobile screen size, this is different for native and webview */ export declare function getMobileScreenSize({ currentBrowser, executor, isIOS, isNativeContext, }: GetMobileScreenSizeOptions): Promise<{ height: number; width: number; }>; /** * Load a base64 HTML page in the browser */ export declare function loadBase64Html({ executor, isIOS }: { executor: Executor; isIOS: boolean; }): Promise; /** * Execute a native click */ export declare function executeNativeClick({ executor, isIOS, x, y }: { executor: Executor; isIOS: boolean; x: number; y: number; }): Promise; /** * Get the mobile viewport position, we determine this by: * 1. Loading a base64 HTML page * 2. Injecting an overlay on top of the webview with an event listener that stores the click position in the webview * 3. Clicking on the overlay in the center of the screen with a native click * 4. Getting the data from the overlay and removing it * 5. Calculating the position of the viewport based on the click position of the native click vs the overlay * 6. Returning the calculated values */ export declare function getMobileViewPortPosition({ initialDeviceRectangles, isAndroid, isIOS, isNativeContext, methods: { executor, getUrl, url, }, nativeWebScreenshot, screenHeight, screenWidth, }: GetMobileViewPortPositionOptions): Promise; /** * Get the value of a method or the default value */ export declare function getMethodOrWicOption(method: Partial | undefined, wic: T, key: K): T[K]; /** * Determine if the Bidi screenshot can be used */ export declare function canUseBidiScreenshot(methods: Methods): boolean; //# sourceMappingURL=utils.d.ts.map