Skip to content

Commit 53d5edf

Browse files
committed
Add PopoverRef type
1 parent cce2742 commit 53d5edf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

index.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,11 @@ export declare const Pill: BoxComponent<PillOwnProps, 'strong'>
15241524

15251525
export type PopoverStatelessProps = BoxProps<'div'>
15261526

1527+
export type PopoverRef = {
1528+
open: () => void
1529+
close: () => void
1530+
}
1531+
15271532
export interface PopoverProps {
15281533
/**
15291534
* The position the Popover is on. Smart positioning might override this.
@@ -1553,10 +1558,14 @@ export interface PopoverProps {
15531558
children:
15541559
| ((props: {
15551560
toggle: () => void
1556-
getRef: (ref: React.RefObject<HTMLElement>) => void
1561+
getRef: (ref: React.RefObject<PopoverRef>) => void
15571562
isShown: boolean
15581563
}) => React.ReactNode)
15591564
| React.ReactNode
1565+
/**
1566+
* Pass a ref to Popover.
1567+
*/
1568+
ref?: React.RefObject<PopoverRef>
15601569
/**
15611570
* The display property passed to the Popover card.
15621571
*/

0 commit comments

Comments
 (0)