From 0e9a7e2a6913f0496e617af710ac7047ae0c5c12 Mon Sep 17 00:00:00 2001 From: Erik Zivkovic Date: Tue, 15 Jan 2019 16:24:15 +0100 Subject: [PATCH 1/2] react-bootstrap: add missing bsClass, bsSize declarations I tried to find as many as possible of the declarations of bsClass, and bsSize that were missing. I used the following sources: * The documentation for pre-v1.0.0 react-bootstrap at https://react-bootstrap.github.io * Double checked using the source code for pre-v1.0.0 at https://github.com/react-bootstrap/react-bootstrap --- types/react-bootstrap/README.md | 13 +++++++++++++ types/react-bootstrap/index.d.ts | 1 + types/react-bootstrap/lib/Alert.d.ts | 1 + types/react-bootstrap/lib/ButtonGroup.d.ts | 1 + types/react-bootstrap/lib/ButtonToolbar.d.ts | 1 + types/react-bootstrap/lib/Clearfix.d.ts | 1 + types/react-bootstrap/lib/FormControlFeedback.d.ts | 4 +++- types/react-bootstrap/lib/InputGroupAddon.d.ts | 4 +++- types/react-bootstrap/lib/InputGroupButton.d.ts | 4 +++- types/react-bootstrap/lib/Modal.d.ts | 1 + types/react-bootstrap/lib/ModalDialog.d.ts | 3 +++ types/react-bootstrap/lib/ModalFooter.d.ts | 1 + types/react-bootstrap/lib/ModalTitle.d.ts | 1 + types/react-bootstrap/lib/Nav.d.ts | 1 + types/react-bootstrap/lib/PageHeader.d.ts | 4 +++- types/react-bootstrap/lib/Pager.d.ts | 1 + types/react-bootstrap/lib/Popover.d.ts | 1 + types/react-bootstrap/lib/ProgressBar.d.ts | 1 + types/react-bootstrap/lib/TabContent.d.ts | 1 + types/react-bootstrap/lib/Tooltip.d.ts | 1 + types/react-bootstrap/lib/Well.d.ts | 1 + 21 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 types/react-bootstrap/README.md diff --git a/types/react-bootstrap/README.md b/types/react-bootstrap/README.md new file mode 100644 index 0000000000..114130171d --- /dev/null +++ b/types/react-bootstrap/README.md @@ -0,0 +1,13 @@ +# react-bootstrap + +## Intended compatibilty +This library is intended for releases of react-bootstrap prior to `v1.0.0`, e.g. `v0.32.4`. + +The reason is that react-bootstrap `v1.0.0` targets Bootstrap v4, and includes its own +typings. react-bootstrap prior to `v1.0.0` targets Bootstrap v3 and does not include any +typings. + +It does not make sense for everyone to upgrade to Bootstrap v3, therefore these typings +are useful for everyone that wants to stay on Bootstrap v3 and react-bootstrap prior to `v1.0.0`. + +The typings for `v1.0.0` were merged in [this pull request](https://github.com/react-bootstrap/react-bootstrap/commit/2079b2292afb835d036fcceef47e8938c4a8d86a). diff --git a/types/react-bootstrap/index.d.ts b/types/react-bootstrap/index.d.ts index 83f5f8db61..c2de3d58b3 100644 --- a/types/react-bootstrap/index.d.ts +++ b/types/react-bootstrap/index.d.ts @@ -14,6 +14,7 @@ // Johann Rakotoharisoa // Andrew Makarov // Duong Tran +// Erik Zivkovic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/react-bootstrap/lib/Alert.d.ts b/types/react-bootstrap/lib/Alert.d.ts index 913619101f..eb6888d956 100644 --- a/types/react-bootstrap/lib/Alert.d.ts +++ b/types/react-bootstrap/lib/Alert.d.ts @@ -5,6 +5,7 @@ declare namespace Alert { export interface AlertProps extends React.HTMLProps { bsSize?: Sizes; bsStyle?: string; + bsClass?: string; closeLabel?: string; /** @deprecated since v0.29.0 */dismissAfter?: number; // TODO: Add more specific type diff --git a/types/react-bootstrap/lib/ButtonGroup.d.ts b/types/react-bootstrap/lib/ButtonGroup.d.ts index 681be17aef..3008e616c4 100644 --- a/types/react-bootstrap/lib/ButtonGroup.d.ts +++ b/types/react-bootstrap/lib/ButtonGroup.d.ts @@ -6,6 +6,7 @@ declare namespace ButtonGroup { block?: boolean; bsSize?: Sizes; bsStyle?: string; + bsClass?: string; justified?: boolean; vertical?: boolean; } diff --git a/types/react-bootstrap/lib/ButtonToolbar.d.ts b/types/react-bootstrap/lib/ButtonToolbar.d.ts index 554f9d5583..d2a54d5b89 100644 --- a/types/react-bootstrap/lib/ButtonToolbar.d.ts +++ b/types/react-bootstrap/lib/ButtonToolbar.d.ts @@ -6,6 +6,7 @@ declare namespace ButtonToolbar { block?: boolean; bsSize?: Sizes; bsStyle?: string; + bsClass?: string; justified?: boolean; vertical?: boolean; } diff --git a/types/react-bootstrap/lib/Clearfix.d.ts b/types/react-bootstrap/lib/Clearfix.d.ts index c248dde7c9..76303b3aff 100644 --- a/types/react-bootstrap/lib/Clearfix.d.ts +++ b/types/react-bootstrap/lib/Clearfix.d.ts @@ -7,6 +7,7 @@ declare namespace Clearfix { visibleSmBlock?: boolean; visibleMdBlock?: boolean; visibleLgBlock?: boolean; + bsClass?: string; } } declare class Clearfix extends React.Component { } diff --git a/types/react-bootstrap/lib/FormControlFeedback.d.ts b/types/react-bootstrap/lib/FormControlFeedback.d.ts index a81939becc..cdfc3aa4f6 100644 --- a/types/react-bootstrap/lib/FormControlFeedback.d.ts +++ b/types/react-bootstrap/lib/FormControlFeedback.d.ts @@ -1,7 +1,9 @@ import * as React from 'react'; declare namespace FormControlFeedback { - export type FormControlFeedbackProps = React.HTMLProps; + export interface FormControlFeedbackProps extends React.HTMLProps { + bsClass?: string; + } } declare class FormControlFeedback extends React.Component { } export = FormControlFeedback; diff --git a/types/react-bootstrap/lib/InputGroupAddon.d.ts b/types/react-bootstrap/lib/InputGroupAddon.d.ts index 720fecc704..40194d5b5d 100644 --- a/types/react-bootstrap/lib/InputGroupAddon.d.ts +++ b/types/react-bootstrap/lib/InputGroupAddon.d.ts @@ -1,7 +1,9 @@ import * as React from 'react'; declare namespace InputGroupAddon { - type InputGroupAddonProps = React.HTMLProps; + interface InputGroupAddonProps extends React.HTMLProps { + bsClass?: string; + } } declare class InputGroupAddon extends React.Component { } export = InputGroupAddon; diff --git a/types/react-bootstrap/lib/InputGroupButton.d.ts b/types/react-bootstrap/lib/InputGroupButton.d.ts index b050c9a2ec..a62ffc9d47 100644 --- a/types/react-bootstrap/lib/InputGroupButton.d.ts +++ b/types/react-bootstrap/lib/InputGroupButton.d.ts @@ -1,7 +1,9 @@ import * as React from 'react'; declare namespace InputGroupButton { - export type InputGroupButtonProps = React.HTMLProps; + export interface InputGroupButtonProps extends React.HTMLProps { + bsClass?: string; + } } declare class InputGroupButton extends React.Component { } export = InputGroupButton; diff --git a/types/react-bootstrap/lib/Modal.d.ts b/types/react-bootstrap/lib/Modal.d.ts index 9b5ada2cdc..80ffdf72f1 100644 --- a/types/react-bootstrap/lib/Modal.d.ts +++ b/types/react-bootstrap/lib/Modal.d.ts @@ -19,6 +19,7 @@ declare namespace Modal { backdropStyle?: any; backdropTransitionTimeout?: number; bsSize?: Sizes; + bsClass?: string; container?: any; // TODO: Add more specific type containerClassName?: string; dialogClassName?: string; diff --git a/types/react-bootstrap/lib/ModalDialog.d.ts b/types/react-bootstrap/lib/ModalDialog.d.ts index 4fb2568ab6..b5493998b9 100644 --- a/types/react-bootstrap/lib/ModalDialog.d.ts +++ b/types/react-bootstrap/lib/ModalDialog.d.ts @@ -1,4 +1,5 @@ import * as React from 'react'; +import { Sizes } from 'react-bootstrap'; declare namespace ModalDialog { export interface ModalDialogProps extends React.HTMLProps { @@ -10,6 +11,8 @@ declare namespace ModalDialog { onExit?: Function; onExited?: Function; onExiting?: Function; + bsSize?: Sizes; + bsClass?: string; } } declare class ModalDialog extends React.Component { } diff --git a/types/react-bootstrap/lib/ModalFooter.d.ts b/types/react-bootstrap/lib/ModalFooter.d.ts index e70b15e688..2f9f902a85 100644 --- a/types/react-bootstrap/lib/ModalFooter.d.ts +++ b/types/react-bootstrap/lib/ModalFooter.d.ts @@ -3,6 +3,7 @@ import * as React from 'react'; declare namespace ModalFooter { export interface ModalFooterProps extends React.HTMLProps { componentClass?: React.ReactType; + bsClass?: string; } } declare class ModalFooter extends React.Component { } diff --git a/types/react-bootstrap/lib/ModalTitle.d.ts b/types/react-bootstrap/lib/ModalTitle.d.ts index b1fd0b386e..a98e7fe3d3 100644 --- a/types/react-bootstrap/lib/ModalTitle.d.ts +++ b/types/react-bootstrap/lib/ModalTitle.d.ts @@ -3,6 +3,7 @@ import * as React from 'react'; declare namespace ModalTitle { export interface ModalTitleProps extends React.HTMLProps { componentClass?: React.ReactType; + bsClass?: string; } } declare class ModalTitle extends React.Component { } diff --git a/types/react-bootstrap/lib/Nav.d.ts b/types/react-bootstrap/lib/Nav.d.ts index 19afb12a7e..2e190662dc 100644 --- a/types/react-bootstrap/lib/Nav.d.ts +++ b/types/react-bootstrap/lib/Nav.d.ts @@ -8,6 +8,7 @@ declare namespace Nav { activeKey?: any; bsSize?: Sizes; bsStyle?: string; + bsClass?: string; collapsible?: boolean; eventKey?: any; expanded?: boolean; diff --git a/types/react-bootstrap/lib/PageHeader.d.ts b/types/react-bootstrap/lib/PageHeader.d.ts index 2212463789..cbc25c3483 100644 --- a/types/react-bootstrap/lib/PageHeader.d.ts +++ b/types/react-bootstrap/lib/PageHeader.d.ts @@ -1,7 +1,9 @@ import * as React from 'react'; declare namespace PageHeader { - export type PageHeaderProps = React.HTMLProps; + export interface PageHeaderProps extends React.HTMLProps { + bsClass?: string; + } } declare class PageHeader extends React.Component { } export = PageHeader; diff --git a/types/react-bootstrap/lib/Pager.d.ts b/types/react-bootstrap/lib/Pager.d.ts index 076d30a0af..432d1d3ec4 100644 --- a/types/react-bootstrap/lib/Pager.d.ts +++ b/types/react-bootstrap/lib/Pager.d.ts @@ -5,6 +5,7 @@ import PagerItem = require('./PagerItem'); declare namespace Pager { export interface PagerProps extends React.HTMLProps { onSelect?: SelectCallback; + bsClass?: string; } } declare class Pager extends React.Component { diff --git a/types/react-bootstrap/lib/Popover.d.ts b/types/react-bootstrap/lib/Popover.d.ts index 95abc38854..b018b585d7 100644 --- a/types/react-bootstrap/lib/Popover.d.ts +++ b/types/react-bootstrap/lib/Popover.d.ts @@ -8,6 +8,7 @@ declare namespace Popover { arrowOffsetTop?: number | string; bsSize?: Sizes; bsStyle?: string; + bsClass?: string; placement?: string; positionLeft?: number | string; // String support added since v0.30.0 positionTop?: number | string; // String support added since v0.30.0 diff --git a/types/react-bootstrap/lib/ProgressBar.d.ts b/types/react-bootstrap/lib/ProgressBar.d.ts index 8fc408ac65..add9b48529 100644 --- a/types/react-bootstrap/lib/ProgressBar.d.ts +++ b/types/react-bootstrap/lib/ProgressBar.d.ts @@ -7,6 +7,7 @@ declare namespace ProgressBar { active?: boolean; bsSize?: Sizes; bsStyle?: string; + bsClass?: string; interpolatedClass?: any; // TODO: Add more specific type max?: number; min?: number; diff --git a/types/react-bootstrap/lib/TabContent.d.ts b/types/react-bootstrap/lib/TabContent.d.ts index 133727263c..61acf34c2e 100644 --- a/types/react-bootstrap/lib/TabContent.d.ts +++ b/types/react-bootstrap/lib/TabContent.d.ts @@ -6,6 +6,7 @@ declare namespace TabContent { animation?: boolean | React.ReactType; mountOnEnter?: boolean; unmountOnExit?: boolean; + bsClass?: string; } } declare class TabContent extends React.Component { } diff --git a/types/react-bootstrap/lib/Tooltip.d.ts b/types/react-bootstrap/lib/Tooltip.d.ts index 8363747293..c08e1a2f70 100644 --- a/types/react-bootstrap/lib/Tooltip.d.ts +++ b/types/react-bootstrap/lib/Tooltip.d.ts @@ -8,6 +8,7 @@ declare namespace Tooltip { arrowOffsetTop?: number | string; bsSize?: Sizes; bsStyle?: string; + bsClass?: string; placement?: string; positionLeft?: number; positionTop?: number; diff --git a/types/react-bootstrap/lib/Well.d.ts b/types/react-bootstrap/lib/Well.d.ts index 07656cc71b..026b66794d 100644 --- a/types/react-bootstrap/lib/Well.d.ts +++ b/types/react-bootstrap/lib/Well.d.ts @@ -5,6 +5,7 @@ declare namespace Well { export interface WellProps extends React.HTMLProps { bsSize?: Sizes; bsStyle?: string; + bsClass?: string; } } declare class Well extends React.Component { } From 11a7577404c497b77781b4564dc8617a06e2803b Mon Sep 17 00:00:00 2001 From: Erik Zivkovic Date: Tue, 29 Jan 2019 11:31:17 +0100 Subject: [PATCH 2/2] Typo: Bootstrap v3 should say Bootstrap v4 --- types/react-bootstrap/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-bootstrap/README.md b/types/react-bootstrap/README.md index 114130171d..ec1bfc027f 100644 --- a/types/react-bootstrap/README.md +++ b/types/react-bootstrap/README.md @@ -7,7 +7,7 @@ The reason is that react-bootstrap `v1.0.0` targets Bootstrap v4, and includes i typings. react-bootstrap prior to `v1.0.0` targets Bootstrap v3 and does not include any typings. -It does not make sense for everyone to upgrade to Bootstrap v3, therefore these typings +It does not make sense for everyone to upgrade to Bootstrap v4, therefore these typings are useful for everyone that wants to stay on Bootstrap v3 and react-bootstrap prior to `v1.0.0`. The typings for `v1.0.0` were merged in [this pull request](https://github.com/react-bootstrap/react-bootstrap/commit/2079b2292afb835d036fcceef47e8938c4a8d86a).