Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add types for Popover sub-components #4093

Merged
merged 1 commit into from
Jul 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion types/components/Popover.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as React from 'react';
import { Placement } from './Overlay';

import { BsPrefixComponent } from './helpers';
import PopoverContent from './PopoverContent';
import PopoverTitle from './PopoverTitle';

export interface PopoverProps {
id: string | number;
Expand All @@ -11,6 +13,9 @@ export interface PopoverProps {
arrowProps?: { ref: any; style: object };
}

declare class Popover extends BsPrefixComponent<'div', PopoverProps> {}
declare class Popover extends BsPrefixComponent<'div', PopoverProps> {
static Title: typeof PopoverTitle;
static Content: typeof PopoverContent;
}

export default Popover;
9 changes: 9 additions & 0 deletions types/components/PopoverContent.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from 'react';
import Button from './Button';
import { BsPrefixComponent } from './helpers';

declare class PopoverContent<
As extends React.ReactType = 'div'
> extends BsPrefixComponent<As> { }

export default PopoverContent;
9 changes: 9 additions & 0 deletions types/components/PopoverTitle.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from 'react';
import Button from './Button';
import { BsPrefixComponent } from './helpers';

declare class PopoverTitle<
As extends React.ReactType = 'div'
> extends BsPrefixComponent<As> { }

export default PopoverTitle;
3 changes: 3 additions & 0 deletions types/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export { default as Overlay, OverlayProps } from './Overlay';
export { default as OverlayTrigger, OverlayTriggerProps } from './OverlayTrigger';
export { default as PageItem, PageItemProps } from './PageItem';
export { default as Pagination, PaginationProps } from './Pagination';

export { default as Popover, PopoverProps } from './Popover';
export { default as PopoverTitle } from './PopoverTitle';
export { default as PopoverContent } from './PopoverContent';
export { default as ProgressBar, ProgressBarProps } from './ProgressBar';
export { default as ResponsiveEmbed, ResponsiveEmbedProps } from './ResponsiveEmbed';
export { default as Row, RowProps } from './Row';
Expand Down