mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
Add react-props-decorators@0.1.0
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user