Skip to content

Commit

Permalink
Update type definitions
Browse files Browse the repository at this point in the history
- placementBeacon now accepts all placement options except "auto" and "center"
- fix TooltipRenderProps click handlers event
  • Loading branch information
gilbarbara committed Dec 11, 2020
1 parent e5d1ffe commit ca41846
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Props as FloaterProps } from "react-floater";
import { Props as FloaterType } from 'react-floater';

export type valueof<T> = T[keyof T];

Expand All @@ -15,11 +15,7 @@ export type Placement =
| 'left-end'
| 'right'
| 'right-start'
| 'right-end'
| 'auto'
| 'center';

export type PlacementBeacon = 'top' | 'bottom' | 'left' | 'right';
| 'right-end';

export interface StoreState {
action: string;
Expand Down Expand Up @@ -100,7 +96,7 @@ export interface CommonProps {
disableOverlayClose?: boolean;
disableScrolling?: boolean;
disableScrollParentFix?: boolean;
floaterProps?: FloaterProps;
floaterProps?: FloaterType;
hideBackButton?: boolean;
locale?: Locale;
showProgress?: boolean;
Expand All @@ -124,34 +120,34 @@ export interface TooltipRenderProps extends BeaconRenderProps {
backProps: {
'aria-label': string;
'data-action': string;
onClick: () => void;
onClick: (e: React.MouseEvent<HTMLElement>) => void;
role: string;
title: string;
};
closeProps: {
'aria-label': string;
'data-action': string;
onClick: () => void;
onClick: (e: React.MouseEvent<HTMLElement>) => void;
role: string;
title: string;
};
primaryProps: {
'aria-label': string;
'data-action': string;
onClick: () => void;
onClick: (e: React.MouseEvent<HTMLElement>) => void;
role: string;
title: string;
};
skipProps: {
'aria-label': string;
'data-action': string;
onClick: () => void;
onClick: (e: React.MouseEvent<HTMLElement>) => void;
role: string;
title: string;
};
tooltipProps: {
'aria-modal': boolean;
ref: () => void;
ref: React.RefCallback<HTMLElement>;
role: string;
};
}
Expand All @@ -160,13 +156,13 @@ export interface Step extends CommonProps {
content: React.ReactNode;
disableBeacon?: boolean;
event?: string;
floaterProps?: FloaterProps;
floaterProps?: FloaterType;
hideCloseButton?: boolean;
hideFooter?: boolean;
isFixed?: boolean;
offset?: number;
placement?: Placement;
placementBeacon?: PlacementBeacon;
placement?: Placement | 'auto' | 'center';
placementBeacon?: Placement;
target: string | HTMLElement;
title?: React.ReactNode;
}
Expand Down Expand Up @@ -237,4 +233,5 @@ export const ACTIONS: actions;
export const EVENTS: events;
export const LIFECYCLE: lifecycle;
export const STATUS: status;
export type FloaterProps = FloaterProps;

export type FloaterProps = FloaterType;

0 comments on commit ca41846

Please sign in to comment.