mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Merge pull request #6799 from adidahiya/react-css-transition-group
[React] Fix linting errors and add support for transition timeout props on CSSTransitionGroup
This commit is contained in:
commit
36c6ce86fb
@ -1,9 +1,8 @@
|
||||
///<reference path='../../react/react.d.ts' />
|
||||
///<reference path='../../react/react-addons-linked-state-mixin.d.ts' />
|
||||
///<reference path='../../react/react-0.13.3.d.ts' />
|
||||
///<reference path='material-ui-0.11.1.d.ts' />
|
||||
|
||||
import * as React from "react";
|
||||
import * as LinkedStateMixin from "react-addons-linked-state-mixin";
|
||||
import * as React from "react/addons";
|
||||
|
||||
import mui = require("material-ui");
|
||||
import Colors = require("material-ui/lib/styles/colors");
|
||||
import AppBar = require("material-ui/lib/app-bar");
|
||||
@ -475,4 +474,4 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta
|
||||
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
material-ui/legacy/material-ui-0.11.1.d.ts
vendored
6
material-ui/legacy/material-ui-0.11.1.d.ts
vendored
@ -3,7 +3,7 @@
|
||||
// Definitions by: Nathan Brown <https://github.com/ngbrown>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path='../../react/react.d.ts' />
|
||||
///<reference path='../../react/react-0.13.3.d.ts' />
|
||||
|
||||
declare module "material-ui" {
|
||||
// The reason for exporting the namespace types (__MaterialUI.*) is to also export the type for casting variable.
|
||||
@ -233,7 +233,7 @@ declare namespace __MaterialUI {
|
||||
}
|
||||
|
||||
// what's not commonly overridden by Checkbox, RadioButton, or Toggle
|
||||
interface CommonEnhancedSwitchProps<T> extends React.HTMLAttributes, React.Props<T> {
|
||||
interface CommonEnhancedSwitchProps<T> extends React.HTMLAttributesBase<T> {
|
||||
// <input/> is root element
|
||||
id?: string;
|
||||
iconStyle?: React.CSSProperties;
|
||||
@ -412,7 +412,7 @@ declare namespace __MaterialUI {
|
||||
}
|
||||
|
||||
// non generally overridden elements of EnhancedButton
|
||||
interface SharedEnhancedButtonProps<T> extends React.HTMLAttributes, React.Props<T> {
|
||||
interface SharedEnhancedButtonProps<T> extends React.HTMLAttributesBase<T> {
|
||||
centerRipple?: boolean;
|
||||
containerElement?: string | React.ReactElement<any>;
|
||||
disabled?: boolean;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
///<reference path='../../react/react.d.ts' />
|
||||
///<reference path='../../react/react-0.13.3.d.ts' />
|
||||
///<reference path='material-ui-0.12.1.d.ts' />
|
||||
|
||||
import * as React from "react/addons";
|
||||
@ -465,4 +465,4 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta
|
||||
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
material-ui/legacy/material-ui-0.12.1.d.ts
vendored
2
material-ui/legacy/material-ui-0.12.1.d.ts
vendored
@ -3,7 +3,7 @@
|
||||
// Definitions by: Nathan Brown <https://github.com/ngbrown>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path='../../react/react.d.ts' />
|
||||
///<reference path='../../react/react-0.13.3.d.ts' />
|
||||
|
||||
declare module "material-ui" {
|
||||
export import AppBar = __MaterialUI.AppBar; // require('material-ui/lib/app-bar');
|
||||
|
||||
8
react/react-0.13.3.d.ts
vendored
8
react/react-0.13.3.d.ts
vendored
@ -212,7 +212,7 @@ declare namespace __React {
|
||||
displayName?: string;
|
||||
propTypes?: ValidationMap<any>;
|
||||
contextTypes?: ValidationMap<any>;
|
||||
childContextTypes?: ValidationMap<any>
|
||||
childContextTypes?: ValidationMap<any>;
|
||||
|
||||
getDefaultProps?(): P;
|
||||
getInitialState?(): S;
|
||||
@ -591,7 +591,7 @@ declare namespace __React {
|
||||
x2?: number | string;
|
||||
x?: number | string;
|
||||
y1?: number | string;
|
||||
y2?: number | string
|
||||
y2?: number | string;
|
||||
y?: number | string;
|
||||
}
|
||||
|
||||
@ -1021,7 +1021,7 @@ declare module "react/addons" {
|
||||
displayName?: string;
|
||||
propTypes?: ValidationMap<any>;
|
||||
contextTypes?: ValidationMap<any>;
|
||||
childContextTypes?: ValidationMap<any>
|
||||
childContextTypes?: ValidationMap<any>;
|
||||
|
||||
getDefaultProps?(): P;
|
||||
getInitialState?(): S;
|
||||
@ -1399,7 +1399,7 @@ declare module "react/addons" {
|
||||
x2?: number | string;
|
||||
x?: number | string;
|
||||
y1?: number | string;
|
||||
y2?: number | string
|
||||
y2?: number | string;
|
||||
y?: number | string;
|
||||
}
|
||||
|
||||
|
||||
10
react/react-addons-css-transition-group.d.ts
vendored
10
react/react-addons-css-transition-group.d.ts
vendored
@ -7,7 +7,6 @@
|
||||
/// <reference path="react-addons-transition-group.d.ts" />
|
||||
|
||||
declare namespace __React {
|
||||
|
||||
interface CSSTransitionGroupTransitionName {
|
||||
enter: string;
|
||||
enterActive?: string;
|
||||
@ -16,16 +15,19 @@ declare namespace __React {
|
||||
appear?: string;
|
||||
appearActive?: string;
|
||||
}
|
||||
|
||||
|
||||
interface CSSTransitionGroupProps extends TransitionGroupProps {
|
||||
transitionName: string | CSSTransitionGroupTransitionName;
|
||||
transitionAppear?: boolean;
|
||||
transitionAppearTimeout?: number;
|
||||
transitionEnter?: boolean;
|
||||
transitionEnterTimeout?: number;
|
||||
transitionLeave?: boolean;
|
||||
transitionLeaveTimeout?: number;
|
||||
}
|
||||
|
||||
|
||||
type CSSTransitionGroup = ComponentClass<CSSTransitionGroupProps>;
|
||||
|
||||
|
||||
namespace __Addons {
|
||||
export var CSSTransitionGroup: __React.CSSTransitionGroup;
|
||||
}
|
||||
|
||||
4
react/react-addons-linked-state-mixin.d.ts
vendored
4
react/react-addons-linked-state-mixin.d.ts
vendored
@ -10,7 +10,7 @@ declare namespace __React {
|
||||
value: T;
|
||||
requestChange(newValue: T): void;
|
||||
}
|
||||
|
||||
|
||||
interface LinkedStateMixin extends Mixin<any, any> {
|
||||
linkState<T>(key: string): ReactLink<T>;
|
||||
}
|
||||
@ -19,7 +19,7 @@ declare namespace __React {
|
||||
checkedLink?: ReactLink<boolean>;
|
||||
valueLink?: ReactLink<boolean | string | number>;
|
||||
}
|
||||
|
||||
|
||||
namespace __Addons {
|
||||
export var LinkedStateMixin: LinkedStateMixin;
|
||||
}
|
||||
|
||||
2
react/react-addons-perf.d.ts
vendored
2
react/react-addons-perf.d.ts
vendored
@ -26,7 +26,7 @@ declare namespace __React {
|
||||
};
|
||||
totalTime: number;
|
||||
}
|
||||
|
||||
|
||||
namespace __Addons {
|
||||
namespace Perf {
|
||||
export function start(): void;
|
||||
|
||||
2
react/react-addons-pure-render-mixin.d.ts
vendored
2
react/react-addons-pure-render-mixin.d.ts
vendored
@ -7,7 +7,7 @@
|
||||
|
||||
declare namespace __React {
|
||||
interface PureRenderMixin extends Mixin<any, any> {}
|
||||
|
||||
|
||||
namespace __Addons {
|
||||
export var PureRenderMixin: PureRenderMixin;
|
||||
}
|
||||
|
||||
24
react/react-addons-test-utils.d.ts
vendored
24
react/react-addons-test-utils.d.ts
vendored
@ -44,18 +44,18 @@ declare namespace __React {
|
||||
(element: Element, eventData?: SyntheticEventData): void;
|
||||
(component: Component<any, any>, eventData?: SyntheticEventData): void;
|
||||
}
|
||||
|
||||
|
||||
interface MockedComponentClass {
|
||||
new(): any;
|
||||
}
|
||||
|
||||
|
||||
class ShallowRenderer {
|
||||
getRenderOutput<E extends ReactElement<any>>(): E;
|
||||
getRenderOutput(): ReactElement<any>;
|
||||
render(element: ReactElement<any>, context?: any): void;
|
||||
unmount(): void;
|
||||
}
|
||||
|
||||
|
||||
namespace __Addons {
|
||||
namespace TestUtils {
|
||||
namespace Simulate {
|
||||
@ -93,17 +93,17 @@ declare namespace __React {
|
||||
export var touchStart: EventSimulator;
|
||||
export var wheel: EventSimulator;
|
||||
}
|
||||
|
||||
|
||||
export function renderIntoDocument(
|
||||
element: DOMElement<any>): Element;
|
||||
export function renderIntoDocument<P>(
|
||||
element: ReactElement<P>): Component<P, any>;
|
||||
export function renderIntoDocument<C extends Component<any, any>>(
|
||||
element: ReactElement<any>): C;
|
||||
|
||||
|
||||
export function mockComponent(
|
||||
mocked: MockedComponentClass, mockTagName?: string): typeof TestUtils;
|
||||
|
||||
|
||||
export function isElementOfType(
|
||||
element: ReactElement<any>, type: ReactType): boolean;
|
||||
export function isDOMComponent(instance: ReactInstance): boolean;
|
||||
@ -111,39 +111,39 @@ declare namespace __React {
|
||||
export function isCompositeComponentWithType(
|
||||
instance: ReactInstance,
|
||||
type: ComponentClass<any>): boolean;
|
||||
|
||||
|
||||
export function findAllInRenderedTree(
|
||||
root: Component<any, any>,
|
||||
fn: (i: ReactInstance) => boolean): ReactInstance[];
|
||||
|
||||
|
||||
export function scryRenderedDOMComponentsWithClass(
|
||||
root: Component<any, any>,
|
||||
className: string): Element[];
|
||||
export function findRenderedDOMComponentWithClass(
|
||||
root: Component<any, any>,
|
||||
className: string): Element;
|
||||
|
||||
|
||||
export function scryRenderedDOMComponentsWithTag(
|
||||
root: Component<any, any>,
|
||||
tagName: string): Element[];
|
||||
export function findRenderedDOMComponentWithTag(
|
||||
root: Component<any, any>,
|
||||
tagName: string): Element;
|
||||
|
||||
|
||||
export function scryRenderedComponentsWithType<P>(
|
||||
root: Component<any, any>,
|
||||
type: ComponentClass<P>): Component<P, {}>[];
|
||||
export function scryRenderedComponentsWithType<C extends Component<any, any>>(
|
||||
root: Component<any, any>,
|
||||
type: ComponentClass<any>): C[];
|
||||
|
||||
|
||||
export function findRenderedComponentWithType<P>(
|
||||
root: Component<any, any>,
|
||||
type: ComponentClass<P>): Component<P, {}>;
|
||||
export function findRenderedComponentWithType<C extends Component<any, any>>(
|
||||
root: Component<any, any>,
|
||||
type: ComponentClass<any>): C;
|
||||
|
||||
|
||||
export function createRenderer(): ShallowRenderer;
|
||||
}
|
||||
}
|
||||
|
||||
2
react/react-addons-update.d.ts
vendored
2
react/react-addons-update.d.ts
vendored
@ -23,7 +23,7 @@ declare namespace __React {
|
||||
$unshift?: any[];
|
||||
$splice?: any[][];
|
||||
}
|
||||
|
||||
|
||||
namespace __Addons {
|
||||
export function update(value: any[], spec: UpdateArraySpec): any[];
|
||||
export function update(value: {}, spec: UpdateSpec): any;
|
||||
|
||||
13
react/react-dom.d.ts
vendored
13
react/react-dom.d.ts
vendored
@ -6,11 +6,10 @@
|
||||
/// <reference path="react.d.ts" />
|
||||
|
||||
declare namespace __React {
|
||||
|
||||
namespace __DOM {
|
||||
function findDOMNode<E extends Element>(instance: ReactInstance): E;
|
||||
function findDOMNode(instance: ReactInstance): Element;
|
||||
|
||||
|
||||
function render<P>(
|
||||
element: DOMElement<P>,
|
||||
container: Element,
|
||||
@ -23,15 +22,15 @@ declare namespace __React {
|
||||
element: ReactElement<P>,
|
||||
container: Element,
|
||||
callback?: (component: Component<P, S>) => any): Component<P, S>;
|
||||
|
||||
|
||||
function unmountComponentAtNode(container: Element): boolean;
|
||||
|
||||
|
||||
var version: string;
|
||||
|
||||
|
||||
function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
|
||||
function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
|
||||
function unstable_batchedUpdates(callback: () => any): void;
|
||||
|
||||
|
||||
function unstable_renderSubtreeIntoContainer<P>(
|
||||
parentComponent: Component<any, any>,
|
||||
nextElement: DOMElement<P>,
|
||||
@ -48,7 +47,7 @@ declare namespace __React {
|
||||
container: Element,
|
||||
callback?: (component: Component<P, S>) => any): Component<P, S>;
|
||||
}
|
||||
|
||||
|
||||
namespace __DOMServer {
|
||||
function renderToString(element: ReactElement<any>): string;
|
||||
function renderToStaticMarkup(element: ReactElement<any>): string;
|
||||
|
||||
@ -68,34 +68,34 @@ var ClassicComponent: React.ClassicComponentClass<Props> =
|
||||
|
||||
class ModernComponent extends React.Component<Props, State>
|
||||
implements React.ChildContextProvider<ChildContext> {
|
||||
|
||||
|
||||
static propTypes: React.ValidationMap<Props> = {
|
||||
foo: React.PropTypes.number
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static contextTypes: React.ValidationMap<Context> = {
|
||||
someValue: React.PropTypes.string
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static childContextTypes: React.ValidationMap<ChildContext> = {
|
||||
someOtherValue: React.PropTypes.string
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static defaultProps: Props;
|
||||
|
||||
|
||||
context: Context;
|
||||
|
||||
|
||||
getChildContext() {
|
||||
return {
|
||||
someOtherValue: 'foo'
|
||||
}
|
||||
someOtherValue: "foo"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
state = {
|
||||
inputValue: this.context.someValue,
|
||||
seconds: this.props.foo
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
reset() {
|
||||
this.setState({
|
||||
inputValue: this.context.someValue,
|
||||
@ -104,7 +104,7 @@ class ModernComponent extends React.Component<Props, State>
|
||||
}
|
||||
|
||||
private _input: HTMLInputElement;
|
||||
|
||||
|
||||
render() {
|
||||
return React.DOM.div(null,
|
||||
React.DOM.input({
|
||||
@ -342,7 +342,7 @@ interface TimerState {
|
||||
class Timer extends React.Component<{}, TimerState> {
|
||||
state = {
|
||||
secondsElapsed: 0
|
||||
}
|
||||
};
|
||||
private _interval: number;
|
||||
tick() {
|
||||
this.setState((prevState, props) => ({
|
||||
@ -392,7 +392,7 @@ React.createFactory(React.addons.CSSTransitionGroup)({
|
||||
// --------------------------------------------------------------------------
|
||||
React.createClass({
|
||||
mixins: [React.addons.LinkedStateMixin],
|
||||
render: function() { return React.DOM.div(null) }
|
||||
render: function() { return React.DOM.div(null); }
|
||||
});
|
||||
|
||||
//
|
||||
@ -411,7 +411,7 @@ React.addons.Perf.printDOM(measurements);
|
||||
// --------------------------------------------------------------------------
|
||||
React.createClass({
|
||||
mixins: [React.addons.PureRenderMixin],
|
||||
render: function() { return React.DOM.div(null) }
|
||||
render: function() { return React.DOM.div(null); }
|
||||
});
|
||||
|
||||
//
|
||||
@ -427,7 +427,7 @@ var renderer: React.ShallowRenderer =
|
||||
renderer.render(React.createElement(Timer));
|
||||
var output: React.ReactElement<React.Props<Timer>> =
|
||||
renderer.getRenderOutput();
|
||||
|
||||
|
||||
//
|
||||
// TransitionGroup addon
|
||||
// --------------------------------------------------------------------------
|
||||
@ -437,7 +437,7 @@ React.createFactory(React.addons.TransitionGroup)({ component: "div" });
|
||||
// update addon
|
||||
// --------------------------------------------------------------------------
|
||||
{
|
||||
// These are copied from https://facebook.github.io/react/docs/update.html
|
||||
// These are copied from https://facebook.github.io/react/docs/update.html
|
||||
let initialArray = [1, 2, 3];
|
||||
let newArray = React.addons.update(initialArray, {$push: [4]}); // => [1, 2, 3, 4]
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
/// <reference path="react-addons-test-utils.d.ts" />
|
||||
/// <reference path="react-addons-transition-group.d.ts" />
|
||||
/// <reference path="react-addons-update.d.ts" />
|
||||
|
||||
import React = require("react");
|
||||
import ReactDOM = require("react-dom");
|
||||
import ReactDOMServer = require("react-dom/server");
|
||||
@ -90,28 +91,28 @@ class ModernComponent extends React.Component<Props, State>
|
||||
|
||||
static propTypes: React.ValidationMap<Props> = {
|
||||
foo: React.PropTypes.number
|
||||
}
|
||||
};
|
||||
|
||||
static contextTypes: React.ValidationMap<Context> = {
|
||||
someValue: React.PropTypes.string
|
||||
}
|
||||
};
|
||||
|
||||
static childContextTypes: React.ValidationMap<ChildContext> = {
|
||||
someOtherValue: React.PropTypes.string
|
||||
}
|
||||
};
|
||||
|
||||
context: Context;
|
||||
|
||||
getChildContext() {
|
||||
return {
|
||||
someOtherValue: 'foo'
|
||||
}
|
||||
someOtherValue: "foo"
|
||||
};
|
||||
}
|
||||
|
||||
state = {
|
||||
inputValue: this.context.someValue,
|
||||
seconds: this.props.foo
|
||||
}
|
||||
};
|
||||
|
||||
reset() {
|
||||
this._myComponent.reset();
|
||||
@ -417,7 +418,7 @@ interface TimerState {
|
||||
class Timer extends React.Component<{}, TimerState> {
|
||||
state = {
|
||||
secondsElapsed: 0
|
||||
}
|
||||
};
|
||||
private _interval: number;
|
||||
tick() {
|
||||
this.setState((prevState, props) => ({
|
||||
@ -514,7 +515,7 @@ Perf.printDOM(measurements);
|
||||
// --------------------------------------------------------------------------
|
||||
React.createClass({
|
||||
mixins: [PureRenderMixin],
|
||||
render: function() { return React.DOM.div(null) }
|
||||
render: function() { return React.DOM.div(null); }
|
||||
});
|
||||
|
||||
//
|
||||
|
||||
4
react/react.d.ts
vendored
4
react/react.d.ts
vendored
@ -187,7 +187,7 @@ declare namespace __React {
|
||||
displayName?: string;
|
||||
propTypes?: ValidationMap<any>;
|
||||
contextTypes?: ValidationMap<any>;
|
||||
childContextTypes?: ValidationMap<any>
|
||||
childContextTypes?: ValidationMap<any>;
|
||||
|
||||
getDefaultProps?(): P;
|
||||
getInitialState?(): S;
|
||||
@ -1884,7 +1884,7 @@ declare namespace __React {
|
||||
xmlLang?: string;
|
||||
xmlSpace?: string;
|
||||
y1?: number | string;
|
||||
y2?: number | string
|
||||
y2?: number | string;
|
||||
y?: number | string;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user