From 49e9e0ab5b926d4d81035198de83f54b9e28bfe5 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Tue, 15 Mar 2016 13:32:52 -0700 Subject: [PATCH] [add] StyleSheet: new prop types --- src/apis/StyleSheet/EdgeInsetsPropType.js | 26 +++++++++++++++++++++++ src/apis/StyleSheet/PointPropType.js | 24 +++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/apis/StyleSheet/EdgeInsetsPropType.js create mode 100644 src/apis/StyleSheet/PointPropType.js diff --git a/src/apis/StyleSheet/EdgeInsetsPropType.js b/src/apis/StyleSheet/EdgeInsetsPropType.js new file mode 100644 index 00000000..cf2d0fcb --- /dev/null +++ b/src/apis/StyleSheet/EdgeInsetsPropType.js @@ -0,0 +1,26 @@ +/* eslint-disable */ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EdgeInsetsPropType + * @flow + */ +'use strict'; + +var PropTypes = require('react').PropTypes; + +var createStrictShapeTypeChecker = require('./createStrictShapeTypeChecker'); + +var EdgeInsetsPropType = createStrictShapeTypeChecker({ + top: PropTypes.number, + left: PropTypes.number, + bottom: PropTypes.number, + right: PropTypes.number, +}); + +module.exports = EdgeInsetsPropType; diff --git a/src/apis/StyleSheet/PointPropType.js b/src/apis/StyleSheet/PointPropType.js new file mode 100644 index 00000000..553227d6 --- /dev/null +++ b/src/apis/StyleSheet/PointPropType.js @@ -0,0 +1,24 @@ +/* eslint-disable */ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule PointPropType + * @flow + */ +'use strict'; + +var PropTypes = require('react').PropTypes; + +var createStrictShapeTypeChecker = require('./createStrictShapeTypeChecker'); + +var PointPropType = createStrictShapeTypeChecker({ + x: PropTypes.number, + y: PropTypes.number, +}); + +module.exports = PointPropType;