Skip to content

Commit

Permalink
[popover2] feat: export PopperCustomModifier type (palantir#5712)
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Nov 4, 2022
1 parent 98e89b2 commit 652c834
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/popover2/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export {
Popover2TargetProps,
PopperBoundary,
PopperModifierOverrides,
PopperCustomModifer,
Placement,
PlacementOptions,
StrictModifierNames,
Expand Down
9 changes: 8 additions & 1 deletion packages/popover2/src/popover2SharedProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ export type PopperModifierOverrides = Partial<{
[M in StrictModifierNames]: Partial<Omit<StrictModifier<M>, "name">>;
}>;

/**
* Custom popper.js v2 modifier for Popover2 and Tooltip2.
*
* @see https://popper.js.org/docs/v2/modifiers/#custom-modifiers
*/
export type PopperCustomModifer = Partial<Modifier<any, object>>;

// eslint-disable-next-line deprecation/deprecation
export type Popover2TargetProps = IPopover2TargetProps;
/**
Expand Down Expand Up @@ -169,7 +176,7 @@ export interface IPopover2SharedProps<TProps> extends OverlayableProps, Props {
*
* @see https://popper.js.org/docs/v2/modifiers/#custom-modifiers
*/
modifiersCustom?: ReadonlyArray<Partial<Modifier<any, object>>>;
modifiersCustom?: readonly PopperCustomModifer[];

/**
* Callback invoked in controlled mode when the popover open state *would*
Expand Down

0 comments on commit 652c834

Please sign in to comment.