import * as React from "react"; import { ForwardRefExoticComponentWithAs } from "@interop-ui/react-polymorphic"; import { MeasurableElement, Size } from "@interop-ui/utils"; export function composeEventHandlers(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: { checkForDefaultPrevented?: boolean | undefined; }): (event: E) => void; export function createContext(displayName: string, rootComponentName: string): readonly [React.Context, (componentName: string) => ContextValueType]; export function extendComponent>(Comp: As extends ForwardRefExoticComponentWithAs ? ForwardRefExoticComponentWithAs : As, displayName: string): ForwardRefExoticComponentWithAs ? ForwardRefExoticComponentWithAs : As>, import("@interop-ui/react-polymorphic").ExtendedProps ? ForwardRefExoticComponentWithAs : As, {}>>; /** * A custom hook that converts a callback to a ref * to avoid triggering re-renders when passed as a prop * or avoid re-executing effects when passed as a dependency */ export function useCallbackRef any>(callback?: T): T; type PossibleRef = React.Ref | undefined; /** * A utility to compose multiple refs together * Accepts callback refs and RefObject(s) */ export function composeRefs(...refs: PossibleRef[]): (node: T) => void; /** * A custom hook that composes multiple refs * Accepts callback refs and RefObject(s) */ export function useComposedRefs(...refs: PossibleRef[]): (node: T) => void; /** * React hook for creating a value exactly once. * @see https://github.com/Andarist/use-constant */ export function useConstant(fn: () => ValueType): ValueType; type UseControlledStateParams = { prop?: T | undefined; defaultProp?: T | undefined; onChange?: (state: T) => void; }; export function useControlledState({ prop, defaultProp, onChange, }: UseControlledStateParams): readonly [T | undefined, React.Dispatch>]; /** * On the server, React emits a warning when calling `useLayoutEffect`. * This is because neither `useLayoutEffect` nor `useEffect` run on the server. * We use this safe version which suppresses the warning by replacing it with a noop on the server. * * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect */ export const useLayoutEffect: typeof React.useLayoutEffect; export function useDisableBodyPointerEvents({ disabled }: { disabled: boolean; }): void; /** * Get a reference to the global document object relative to a specific node ref * @param forwardedRef */ export function useDocumentRef(forwardedRef: React.RefObject): React.MutableRefObject; export function getOwnerDocument(nodeRef: React.RefObject): Document; export function getOwnerWindow(nodeRef: React.RefObject): Window & typeof globalThis; export function getOwnerGlobals(nodeRef: React.RefObject): { ownerDocument: Document; ownerWindow: Window & typeof globalThis; }; export const useId: () => number; export function usePrefersReducedMotion(nodeRef: React.RefObject): boolean; export function prefersReducedMotion(globalWindow?: Window & typeof globalThis): boolean; export function onPrefersReducedMotionChange(callback: (prefers: boolean) => any, globalWindow?: Window & typeof globalThis): () => void; export function usePrevious(value: T): T | undefined; /** * Use this custom hook to get access to an element's rect (getBoundingClientRect) * and observe it along time. */ export function useRect( /** A reference to the element whose rect to observe */ refToObserve: React.RefObject): ClientRect | undefined; export function useSize( /** A reference to the element whose size to observe */ refToObserve: React.RefObject): Size | undefined; //# sourceMappingURL=index.d.ts.map