From 29ba4b7a42a0eb3454ecbcaeba61eab92631659b Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 27 Jul 2016 20:45:08 -0700 Subject: [PATCH] Get tests passing again --- draft-js/draft-js-tests.tsx | 2 +- react-bootstrap/index.d.ts | 13 +++++++++++-- react-bootstrap/react-bootstrap-tests.tsx | 2 +- react-mdl/index.d.ts | 4 ++-- react-mdl/react-mdl-tests.tsx | 6 +++--- react/index.d.ts | 2 +- redux-form/index.d.ts | 7 ++----- redux-form/redux-form-tests.tsx | 8 ++++---- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/draft-js/draft-js-tests.tsx b/draft-js/draft-js-tests.tsx index eef542a266..4409d820dc 100644 --- a/draft-js/draft-js-tests.tsx +++ b/draft-js/draft-js-tests.tsx @@ -105,7 +105,7 @@ class StyleButton extends React.Component<{key: string, active: boolean, label: } return ( - + this.onToggle(e as any)}> {this.props.label} ); diff --git a/react-bootstrap/index.d.ts b/react-bootstrap/index.d.ts index 3641a4c751..1d9490ea69 100644 --- a/react-bootstrap/index.d.ts +++ b/react-bootstrap/index.d.ts @@ -8,7 +8,7 @@ export = ReactBootstrap; declare namespace ReactBootstrap { - type Sizes = 'xs' | 'xsmall' | 'sm' | 'small' | 'lg' | 'large'; + type Sizes = 'xs' | 'xsmall' | 'sm' | 'small' | 'medium' | 'lg' | 'large'; // Change onSelect signature to be (eventKey: any, event: SyntheticEvent<{}>) => any on all React-Bootstrap components, instead of the old inconsistent mishmash (#1604, #1677, #1756) @@ -307,6 +307,13 @@ declare namespace ReactBootstrap { // interface ModalDialogProps extends React.HTMLProps { // TODO: Add more specific type + onHide?: Function; + onEnter?: Function; + onEntered?: Function; + onEntering?: Function; + onExit?: Function; + onExited?: Function; + onExiting?: Function; } type ModalDialog = React.ClassicComponent; var ModalDialog: React.ClassicComponentClass; @@ -569,11 +576,13 @@ declare namespace ReactBootstrap { interface NavDropdownBaseProps extends DropdownBaseProps { noCaret?: boolean; + eventKey?: any; } type NavDropdownProps = NavDropdownBaseProps & React.HTMLProps; class NavDropdown extends React.Component - { } + { + } // diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 174d5a9b4f..0272f1727f 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -170,7 +170,7 @@ export class ReactBootstrapTest extends Component {
- + Action Another action Active Item diff --git a/react-mdl/index.d.ts b/react-mdl/index.d.ts index 8d81a8f723..b11c920dab 100644 --- a/react-mdl/index.d.ts +++ b/react-mdl/index.d.ts @@ -395,7 +395,7 @@ declare namespace __ReactMDL { title ?: string; } interface HeaderProps extends __MDLOtherProps { - title ?: string; + title ?: any; // string | JSX.Element scroll ?: boolean; seamed ?: boolean; transparent ?: boolean; @@ -412,7 +412,7 @@ declare namespace __ReactMDL { interface LayoutProps extends __MDLOtherProps { fixedDrawer ?: boolean; fixedHeader ?: boolean; - fixedTabse ?: boolean; + fixedTabs ?: boolean; } interface NavigationProps extends __MDLOtherProps {} class Content extends __MDLComponent {} diff --git a/react-mdl/react-mdl-tests.tsx b/react-mdl/react-mdl-tests.tsx index 8956f25b27..2f644d1797 100644 --- a/react-mdl/react-mdl-tests.tsx +++ b/react-mdl/react-mdl-tests.tsx @@ -166,7 +166,7 @@ React.createClass({ - + Image.jpg @@ -310,8 +310,8 @@ React.createClass({
- - + + Allow data collection?

Allowing us to collect data will let us get you the information you want faster.

diff --git a/react/index.d.ts b/react/index.d.ts index e6e760058d..d6568d6fee 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -2032,7 +2032,7 @@ declare namespace React { title?: string; type?: string; useMap?: string; - value?: string | string[]; + value?: string | string[] | number; width?: number | string; wmode?: string; wrap?: string; diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index b58c28a0d2..151f505859 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -3,11 +3,7 @@ // Definitions by: Daniel Lytkin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - - +import * as React from 'react'; import { Component, SyntheticEvent, FormEventHandler } from 'react'; import { Dispatch, ActionCreator, Reducer } from 'redux'; @@ -191,6 +187,7 @@ export interface ReduxFormProps { * given as the error prop. */ handleSubmit?(event: SyntheticEvent): void; + handleSubmit?(event: React.MouseEvent): void; handleSubmit?(submit: (data: FormData, dispatch?: Dispatch) => Promise | void): FormEventHandler; /** diff --git a/redux-form/redux-form-tests.tsx b/redux-form/redux-form-tests.tsx index d6620940d2..8254caabbf 100644 --- a/redux-form/redux-form-tests.tsx +++ b/redux-form/redux-form-tests.tsx @@ -8,7 +8,7 @@ import {reduxForm, reducer as reduxFormReducer, ReduxFormProps} from 'redux-form namespace SimpleForm { export const fields = ['firstName', 'lastName', 'email', 'sex', 'favoriteColor', 'employed', 'notes']; - class SimpleForm extends Component, void> { + class SimpleForm extends Component, void> { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired, @@ -123,7 +123,7 @@ namespace SynchronousValidation { return errors; }; - class SynchronousValidationForm extends Component, any> { + class SynchronousValidationForm extends Component, any> { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired, @@ -204,7 +204,7 @@ namespace SumbitValidation { render() { const {fields: {username, password}, error, resetForm, handleSubmit, submitting} = this.props; - return (
+ return ( handleSubmit(submit as any)}>
@@ -255,7 +255,7 @@ namespace InitializingFromState { load: Function; } - class InitializingFromStateForm extends Component, any> { + class InitializingFromStateForm extends Component, any> { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired,