material-you-react
Version:
Material You: Material You (M3) Design system and its components for simple integration with Next.Js or other react-based frameworks
20 lines (19 loc) • 1.19 kB
TypeScript
export declare const noop: () => void;
export declare function on<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['addEventListener']> | [string, Function | null, ...any]): void;
export declare function off<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['removeEventListener']> | [string, Function | null, ...any]): void;
export declare const isBrowser: boolean;
export declare const isNavigator: boolean;
export type UseMeasureRect = Pick<DOMRectReadOnly, 'x' | 'y' | 'top' | 'left' | 'right' | 'bottom' | 'height' | 'width'>;
export type UseMeasureRef<E extends Element = Element> = (element: E) => void;
export type UseMeasureResult<E extends Element = Element> = [UseMeasureRef<E>, UseMeasureRect];
declare function useMeasure<E extends Element = Element>(): UseMeasureResult<E>;
export declare function getWidthSizeClass(width: number): WindowSizeClass;
export declare enum WindowSizeClass {
Compact = "compact",
Medium = "medium",
Expanded = "expanded",
Large = "large",
ExtraLarge = "extra-large"
}
declare const _default: typeof useMeasure;
export default _default;