import { ConstructorOptions, DOMWindow, ResourceLoaderConstructorOptions } from 'jsdom'; declare type WindowOptions = Omit & ResourceLoaderConstructorOptions; declare type Many = T | readonly T[]; declare type PropertyName = string | number | symbol; declare type PropertyPath = Many; interface RestoreFunction { (): void; } /** * Builds a mocked browser environment using JSDOM. * * @param properties - A list of properties to map from `Window` to * `NodeJS.Global`. This reduces pollution at the global scope if only a subset * of window properties are required. * @param options - Options to configure the JSDOM instance. * * @source https://github.com/lukechilds/browser-env/blob/master/src/index.js */ declare function createBrowserEnv(properties?: (keyof typeof window)[]): DOMWindow; declare function createBrowserEnv(options?: WindowOptions): DOMWindow; declare function createBrowserEnv(properties?: (keyof typeof window)[], options?: WindowOptions): DOMWindow; declare function createBrowserEnv(options?: WindowOptions, properties?: (keyof typeof window)[]): DOMWindow; /** * Stub a property on the `Window` object at the given `path`. * * @param path - A path within the window object to stub. * @param value - A replacement value for the given path. */ declare function stubWindowProperty(path: TKey | [TKey], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2, TKey3], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2, TKey3, TKey4], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2, TKey3, TKey4, TKey5], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2, TKey3, TKey4, TKey5, TKey6], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2, TKey3, TKey4, TKey5, TKey6, TKey7], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2, TKey3, TKey4, TKey5, TKey6, TKey7, TKey8], value: TValue): RestoreFunction; declare function stubWindowProperty(path: [TKey1, TKey2, TKey3, TKey4, TKey5, TKey6, TKey7, TKey8, TKey9], value: TValue): RestoreFunction; declare function stubWindowProperty(path: PropertyPath, value: any): RestoreFunction; /** * Restore the `Window` object, removing any previously applied stubs. */ declare function restoreWindow(): DOMWindow; declare const _default: typeof createBrowserEnv & { stub: typeof stubWindowProperty; restore: typeof restoreWindow; }; export default _default;