mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-06 05:59:46 +08:00
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { isClient } from './is';
|
|
|
|
export interface ConfigurableWindow {
|
|
/*
|
|
* Specify a custom `window` instance, e.g. working with iframes or in testing environments.
|
|
*/
|
|
window?: Window;
|
|
}
|
|
|
|
export interface ConfigurableDocument {
|
|
/*
|
|
* Specify a custom `document` instance, e.g. working with iframes or in testing environments.
|
|
*/
|
|
document?: Document;
|
|
}
|
|
|
|
export interface ConfigurableNavigator {
|
|
/*
|
|
* Specify a custom `navigator` instance, e.g. working with iframes or in testing environments.
|
|
*/
|
|
navigator?: Navigator;
|
|
}
|
|
|
|
export interface ConfigurableLocation {
|
|
/*
|
|
* Specify a custom `location` instance, e.g. working with iframes or in testing environments.
|
|
*/
|
|
location?: Location;
|
|
}
|
|
|
|
export const defaultWindow = /* #__PURE__ */ isClient ? window : undefined;
|
|
export const defaultDocument = /* #__PURE__ */ isClient ? window.document : undefined;
|
|
export const defaultNavigator = /* #__PURE__ */ isClient ? window.navigator : undefined;
|
|
export const defaultLocation = /* #__PURE__ */ isClient ? window.location : undefined;
|