Add react-props-decorators@0.1.0

This commit is contained in:
tkqubo
2015-09-15 05:41:43 +09:00
parent 7a3ca1f0b8
commit cfc40da29b
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 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 {
/* ... */
}
@@ -0,0 +1 @@
--experimentalDecorators --noImplicitAny --target ES5
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for react-props-decorators
// 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
}
}