From 07f707e2eb8eac55e2f05c03445d3bae680417e9 Mon Sep 17 00:00:00 2001 From: abeall Date: Mon, 9 Oct 2017 12:12:25 -0400 Subject: [PATCH] Fixed declaration of title/label as ReactNode for components, per docs --- types/react-bootstrap/lib/DropdownButton.d.ts | 1 + types/react-bootstrap/lib/Popover.d.ts | 5 +++-- types/react-bootstrap/lib/ProgressBar.d.ts | 5 +++-- types/react-bootstrap/lib/SplitButton.d.ts | 6 ++++-- .../test/react-bootstrap-individual-components-tests.tsx | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/types/react-bootstrap/lib/DropdownButton.d.ts b/types/react-bootstrap/lib/DropdownButton.d.ts index df66dd36dd..e2626e2bb7 100644 --- a/types/react-bootstrap/lib/DropdownButton.d.ts +++ b/types/react-bootstrap/lib/DropdownButton.d.ts @@ -10,6 +10,7 @@ declare namespace DropdownButton { navItem?: boolean; noCaret?: boolean; pullRight?: boolean; + title: React.ReactNode; } export type DropdownButtonProps = DropdownButtonBaseProps & React.HTMLProps; diff --git a/types/react-bootstrap/lib/Popover.d.ts b/types/react-bootstrap/lib/Popover.d.ts index 2af51da4b6..95abc38854 100644 --- a/types/react-bootstrap/lib/Popover.d.ts +++ b/types/react-bootstrap/lib/Popover.d.ts @@ -1,8 +1,8 @@ import * as React from 'react'; -import { Sizes } from 'react-bootstrap'; +import { Sizes, Omit } from 'react-bootstrap'; declare namespace Popover { - export interface PopoverProps extends React.HTMLProps { + export interface PopoverProps extends Omit, "title"> { // Optional arrowOffsetLeft?: number | string; arrowOffsetTop?: number | string; @@ -11,6 +11,7 @@ declare namespace Popover { placement?: string; positionLeft?: number | string; // String support added since v0.30.0 positionTop?: number | string; // String support added since v0.30.0 + title?: React.ReactNode; } } declare class Popover extends React.Component { } diff --git a/types/react-bootstrap/lib/ProgressBar.d.ts b/types/react-bootstrap/lib/ProgressBar.d.ts index 89b2e07cc0..8fc408ac65 100644 --- a/types/react-bootstrap/lib/ProgressBar.d.ts +++ b/types/react-bootstrap/lib/ProgressBar.d.ts @@ -1,8 +1,8 @@ import * as React from 'react'; -import { Sizes } from 'react-bootstrap'; +import { Sizes, Omit } from 'react-bootstrap'; declare namespace ProgressBar { - export interface ProgressBarProps extends React.HTMLProps { + export interface ProgressBarProps extends Omit, "label"> { // Optional active?: boolean; bsSize?: Sizes; @@ -13,6 +13,7 @@ declare namespace ProgressBar { now?: number; srOnly?: boolean; striped?: boolean; + label?: React.ReactNode; } } declare class ProgressBar extends React.Component { } diff --git a/types/react-bootstrap/lib/SplitButton.d.ts b/types/react-bootstrap/lib/SplitButton.d.ts index 7f3d9d7f30..7b824cd647 100644 --- a/types/react-bootstrap/lib/SplitButton.d.ts +++ b/types/react-bootstrap/lib/SplitButton.d.ts @@ -1,13 +1,15 @@ import * as React from 'react'; -import { Sizes } from 'react-bootstrap'; +import { Sizes, Omit } from 'react-bootstrap'; declare namespace SplitButton { - export interface SplitButtonProps extends React.HTMLProps { + export interface SplitButtonProps extends Omit, "title"> { bsStyle?: string; bsSize?: Sizes; dropdownTitle?: any; // TODO: Add more specific type dropup?: boolean; pullRight?: boolean; + title: React.ReactNode; + id: string; } } declare class SplitButton extends React.Component { } diff --git a/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx b/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx index 78579dc953..ff2c5b7472 100644 --- a/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx +++ b/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx @@ -120,7 +120,7 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component { - + @@ -178,7 +178,7 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component { - +