Add @providesModule annotations and update copyright notices

'providesModule' is necessary for haste support
This commit is contained in:
Nicolas Gallagher
2017-06-18 12:56:41 -07:00
parent 6203a3fec6
commit 02cfbf8987
85 changed files with 558 additions and 67 deletions

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2017-present, Nicolas Gallagher.
* 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.
*
* @flow
*/
import propsToAccessibilityComponent from './propsToAccessibilityComponent';
import propsToAriaRole from './propsToAriaRole';
import propsToTabIndex from './propsToTabIndex';

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2017-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
import propsToAriaRole from './propsToAriaRole';
const roleComponents = {

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2017-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
const accessibilityComponentTypeToRole = {
button: 'button',
none: 'presentation'

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2017-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
import propsToAriaRole from './propsToAriaRole';
const propsToTabIndex = props => {

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
let id = 0;
const requests = {};

View File

@@ -1,8 +1,12 @@
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* Copyright (c) 2016-present, Nicolas Gallagher.
* 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.
*
* @providesModule NativeMethodsMixin
* @flow
*/

View File

@@ -1,11 +1,9 @@
/* 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.
* LICENSE file in the root directory of this source tree.
*
* @providesModule ReactNativePropRegistry
* @flow

View File

@@ -1,11 +1,10 @@
/* eslint-disable */
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
* 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.
* LICENSE file in the root directory of this source tree.
*
* @providesModule ScrollResponder
* @flow

View File

@@ -1,7 +1,10 @@
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @flow
*/

View File

@@ -2,6 +2,9 @@
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @flow
*/

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
import '../injectResponderEventPlugin';
import AccessibilityUtil from '../AccessibilityUtil';

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
import AccessibilityUtil from '../AccessibilityUtil';
import StyleSheet from '../../apis/StyleSheet';
import StyleRegistry from '../../apis/StyleSheet/registry';

View File

@@ -1,3 +1,14 @@
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
* 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.
*
* @providesModule dismissKeyboard
* @flow
*/
import TextInputState from '../../components/TextInput/TextInputState';
const dismissKeyboard = () => {

View File

@@ -1,2 +1,13 @@
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
* 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.
*
* @providesModule findNodeHandle
* @noflow
*/
import { findDOMNode } from 'react-dom';
export default findDOMNode;

View File

@@ -1,7 +1,3 @@
/* global document, window */
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
/**
* Adapts focus styles based on the user's active input modality (i.e., how
* they are interacting with the UI right now).
@@ -16,7 +12,12 @@ import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
* 2. a focus event happened on an element which requires keyboard interaction (e.g., a text field);
*
* Based on https://github.com/WICG/focus-ring
*
* @noflow
*/
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
const modality = () => {
if (!canUseDOM) {
return;

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
const CSS_UNIT_RE = /^[+-]?\d*(?:\.\d+)?(?:[Ee][+-]?\d+)?(%|\w*)/;
const getUnit = str => str.match(CSS_UNIT_RE)[1];

View File

@@ -1,3 +1,13 @@
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @noflow
*/
const emptyArray = [];
// Mobile Safari re-uses touch objects, so we copy the properties we want and normalize the identifier

View File

@@ -1,8 +1,18 @@
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @flow
*/
import prefixAll from 'inline-style-prefixer/static';
export default prefixAll;
export const prefixInlineStyles = style => {
export const prefixInlineStyles = (style: Object) => {
const prefixedStyles = prefixAll(style);
// React@15 removed undocumented support for fallback values in

View File

@@ -1,7 +1,16 @@
/* global window */
/**
* Copyright (c) 2015-present, Nicolas Gallagher.
* 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.
*
* @flow
*/
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
const _requestIdleCallback = function(cb) {
const _requestIdleCallback = function(cb: Function) {
return setTimeout(() => {
const start = Date.now();
cb({

View File

@@ -1,3 +1,7 @@
/**
* @flow
*/
const unitlessNumbers = {
animationIterationCount: true,
borderImageOutset: true,