Merge pull request #5823 from tkqubo/react-props-decorators

Add react-props-decorators@0.1.0
This commit is contained in:
Masahiro Wakame
2015-09-20 14:31:24 +09:00
3 changed files with 41 additions and 0 deletions
@@ -0,0 +1,17 @@
/// <reference path="react-props-decorators.d.ts" />
/// <reference path="../react/react.d.ts" />
import * as React from 'react';
import { propTypes, defaultProps } from 'react-props-decorators';
@propTypes({
foo: React.PropTypes.string,
bar: React.PropTypes.number
})
@defaultProps({
foo: "defaultString",
bar: 100
})
class Baz extends React.Component<any, any> {
/* ... */
}
@@ -0,0 +1 @@
--experimentalDecorators --noImplicitAny --target ES5
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for react-props-decorators 0.1.0
// Project: https://github.com/popkirby/react-props-decorators
// Definitions by: Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
declare module "react-props-decorators" {
import * as React from 'react';
export interface ClassDecorator {
<TFunction extends Function>(target:TFunction): TFunction|void;
}
var propTypes: (map: React.ValidationMap<any>) => ClassDecorator;
var defaultProps: (defaultProps: any) => ClassDecorator;
export {
propTypes,
defaultProps
}
}