ant-design-vue/components/_util/hooks/_vueuse/_configurable.ts
2022-11-07 13:42:51 +08:00

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;