import { type ElementSize } from "./types.js"; import { type ResizeListenerOptions } from "./useResizeListener.js"; /** * @since 6.0.0 */ export interface WindowSizeOptions extends Omit { /** * The default value to use in SSR environments for the window's height. * * @defaultValue `0` */ ssrHeight?: number; /** * The default value to use in SSR environments for the window's width. * * @defaultValue `0` */ ssrWidth?: number; /** * Set this to `true` to ignore resize events that only updated the height. * The hook can be disabled by setting this and {@link disableWidth} to * `true`. * * @defaultValue `false` */ disableHeight?: boolean; /** * Set this to `true` to ignore resize events that only updated the width. * The hook can be disabled by setting this and {@link disableHeight} to * `true`. * * @defaultValue `false` */ disableWidth?: boolean; } /** * This is just a convenience wrapper around the {@link useResizeListener}. * * @example Simple Example * ```tsx * import { useWindowSize } from "@react-md/core/useWindowSize"; * import type { ReactElement } from "react"; * import { useState } from "react"; * * function Example(): ReactElement { * const { height, width } = useWindowSize(); * * return ( * <> * The current window size: *
{JSON.stringify(size, null, 2)}
* * ); * } * ``` * * @since 6.0.0 */ export declare function useWindowSize(options?: WindowSizeOptions): ElementSize;