aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
41 lines • 1.53 kB
TypeScript
import type { DependencyList, EffectCallback } from 'react';
/**
* Returns true when executed in a browser-like environment.
*/
export declare const isBrowser: () => boolean;
/**
* Convenience inverse helper.
*/
export declare const isServer: () => boolean;
/**
* Safely access the `window` object when available.
*/
export declare const getSafeWindow: () => typeof window | undefined;
/**
* Safely access the `document` object when available.
*/
export declare const getSafeDocument: () => Document | undefined;
/**
* Safely access the `navigator` object when available.
*/
export declare const getSafeNavigator: () => Navigator | undefined;
/**
* Helper to guard feature detection against SSR environments.
*/
export declare const safeMatchMedia: (query: string) => MediaQueryList | undefined;
/**
* Executes a side effect only when running in the browser. Returns a no-op cleanup on the server.
*/
export declare const runClientEffect: (effect: EffectCallback) => ReturnType<EffectCallback> | undefined;
/**
* React hook compatible helper to defer `useEffect` logic to the client.
*
* Example:
* useClientEffect(() => { /* browser only *\/ });
*/
export declare const useClientEffect: (useEffectImpl: (effect: EffectCallback, deps?: DependencyList) => void, effect: EffectCallback, deps?: DependencyList) => void;
/**
* Creates a lazy accessor that only evaluates the factory on the client.
*/
export declare const lazyClientValue: <T>(factory: () => T, fallback: T) => T;
//# sourceMappingURL=env.d.ts.map