@@ -15,11 +15,30 @@ export type ElementIds = Partial<{
1515 trigger : string
1616} >
1717
18+ /* -----------------------------------------------------------------------------
19+ * Machine context
20+ * -----------------------------------------------------------------------------*/
21+
1822export interface CollapsibleProps extends CommonProperties , DirectionProperty {
23+ /**
24+ * The ids of the elements in the collapsible. Useful for composition.
25+ */
1926 ids ?: ElementIds
27+ /**
28+ * Whether the collapsible is open.
29+ */
2030 open ?: boolean
31+ /**
32+ * The default open state of the collapsible.
33+ */
2134 defaultOpen ?: boolean
35+ /**
36+ * The callback invoked when the open state changes.
37+ */
2238 onOpenChange ?: ( details : OpenChangeDetails ) => void
39+ /**
40+ * The callback invoked when the exit animation completes.
41+ */
2342 onExitComplete ?: ( ) => void
2443}
2544
@@ -61,11 +80,30 @@ export interface CollapsibleSchema {
6180
6281export type CollapsibleService = Service < CollapsibleSchema >
6382
83+ /* -----------------------------------------------------------------------------
84+ * Component API
85+ * -----------------------------------------------------------------------------*/
86+
6487export interface CollapsibleApi < T extends PropTypes = PropTypes > {
88+ /**
89+ * Whether the collapsible is open.
90+ */
6591 open : boolean
92+ /**
93+ * Whether the collapsible is visible (open or closing)
94+ */
6695 visible : boolean
96+ /**
97+ * Whether the collapsible is disabled
98+ */
6799 disabled : boolean
100+ /**
101+ * Function to open or close the collapsible.
102+ */
68103 setOpen ( open : boolean ) : void
104+ /**
105+ * Function to measure the size of the content.
106+ */
69107 measureSize ( ) : void
70108
71109 getRootProps ( ) : T [ "element" ]
0 commit comments