import * as React from 'react'; import { TransitionStatus } from "../../utils/useTransitionStatus.js"; import type { CollapsibleRoot } from "./CollapsibleRoot.js"; export type AnimationType = 'css-transition' | 'css-animation' | 'none' | null; export interface Dimensions { height: number | undefined; width: number | undefined; } export declare function useCollapsibleRoot(parameters: useCollapsibleRoot.Parameters): useCollapsibleRoot.ReturnValue; export interface UseCollapsibleRootParameters { /** * Whether the collapsible panel is currently open. * * To render an uncontrolled collapsible, use the `defaultOpen` prop instead. */ open?: boolean; /** * Whether the collapsible panel is initially open. * * To render a controlled collapsible, use the `open` prop instead. * @default false */ defaultOpen?: boolean; /** * Event handler called when the panel is opened or closed. */ onOpenChange: (open: boolean, eventDetails: CollapsibleRoot.ChangeEventDetails) => void; /** * Whether the component should ignore user interaction. * @default false */ disabled: boolean; } export interface UseCollapsibleRootReturnValue { abortControllerRef: React.RefObject; animationTypeRef: React.RefObject; /** * Whether the component should ignore user interaction. */ disabled: boolean; handleTrigger: (event: React.MouseEvent | React.KeyboardEvent) => void; /** * The height of the panel. */ height: number | undefined; /** * Whether the collapsible panel is currently mounted. */ mounted: boolean; /** * Whether the collapsible panel is currently open. */ open: boolean; panelId: React.HTMLAttributes['id']; panelRef: React.RefObject; runOnceAnimationsFinish: (fnToExecute: () => void, signal?: AbortSignal | null) => void; setDimensions: React.Dispatch>; setHiddenUntilFound: React.Dispatch>; setKeepMounted: React.Dispatch>; setMounted: (open: boolean) => void; setOpen: (open: boolean) => void; setPanelIdState: (id: string | undefined) => void; setVisible: React.Dispatch>; transitionDimensionRef: React.RefObject<'height' | 'width' | null>; transitionStatus: TransitionStatus; /** * The visible state of the panel used to determine the `[hidden]` attribute * only when CSS keyframe animations are used. */ visible: boolean; /** * The width of the panel. */ width: number | undefined; } export declare namespace useCollapsibleRoot { type Parameters = UseCollapsibleRootParameters; type ReturnValue = UseCollapsibleRootReturnValue; }