mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Update fbsource
Reviewed By: zertosh Differential Revision: D4111832 fbshipit-source-id: 301969a1c828fb87e7e09c1eea3cd44799b89509
This commit is contained in:
committed by
Facebook Github Bot
parent
90a696597c
commit
bd3be5bd24
@@ -22,25 +22,30 @@ type ResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
|
||||
type Response = ?Object | string;
|
||||
|
||||
type XHRInterceptor = {
|
||||
requestSent: (
|
||||
requestSent(
|
||||
id: number,
|
||||
url: string,
|
||||
method: string,
|
||||
headers: Object) => void,
|
||||
responseReceived: (
|
||||
headers: Object
|
||||
): void,
|
||||
responseReceived(
|
||||
id: number,
|
||||
url: string,
|
||||
status: number,
|
||||
headers: Object) => void,
|
||||
dataReceived: (
|
||||
headers: Object
|
||||
): void,
|
||||
dataReceived(
|
||||
id: number,
|
||||
data: string) => void,
|
||||
loadingFinished: (
|
||||
data: string
|
||||
): void,
|
||||
loadingFinished(
|
||||
id: number,
|
||||
encodedDataLength: number) => void,
|
||||
loadingFailed: (
|
||||
encodedDataLength: number
|
||||
): void,
|
||||
loadingFailed(
|
||||
id: number,
|
||||
error: string) => void,
|
||||
error: string
|
||||
): void,
|
||||
};
|
||||
|
||||
const UNSENT = 0;
|
||||
|
||||
@@ -57,7 +57,7 @@ const _warningMap: Map<string, WarningInfo> = new Map();
|
||||
|
||||
if (__DEV__) {
|
||||
const {error, warn} = console;
|
||||
console.error = function() {
|
||||
(console: any).error = function() {
|
||||
error.apply(console, arguments);
|
||||
// Show yellow box for the `warning` module.
|
||||
if (typeof arguments[0] === 'string' &&
|
||||
@@ -65,7 +65,7 @@ if (__DEV__) {
|
||||
updateWarningMap.apply(null, arguments);
|
||||
}
|
||||
};
|
||||
console.warn = function() {
|
||||
(console: any).warn = function() {
|
||||
warn.apply(console, arguments);
|
||||
updateWarningMap.apply(null, arguments);
|
||||
};
|
||||
|
||||
@@ -31,8 +31,11 @@ type AttributeDiffer = (prevProp: mixed, nextProp: mixed) => boolean;
|
||||
type AttributePreprocessor = (nextProp: mixed) => mixed;
|
||||
|
||||
type CustomAttributeConfiguration =
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
{ diff: AttributeDiffer, process: AttributePreprocessor } |
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
{ diff: AttributeDiffer } |
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
{ process: AttributePreprocessor };
|
||||
|
||||
type AttributeConfiguration =
|
||||
|
||||
@@ -73,6 +73,7 @@ function ChildReconciler(shouldClone) {
|
||||
return clone;
|
||||
}
|
||||
const child = createFiberFromElement(element, priority);
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
previousSibling.sibling = child;
|
||||
child.return = returnFiber;
|
||||
return child;
|
||||
|
||||
@@ -245,6 +245,7 @@ exports.createFiberFromElement = function(element : ReactElement<*>, priorityLev
|
||||
return fiber;
|
||||
};
|
||||
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
function createFiberFromElementType(type : mixed, key : null | string) {
|
||||
let fiber;
|
||||
if (typeof type === 'function') {
|
||||
|
||||
@@ -18,14 +18,18 @@ var ViewStylePropTypes = require('ViewStylePropTypes');
|
||||
// TODO: use spread instead of Object.assign/create after #6560135 is fixed
|
||||
var TextStylePropTypes = Object.assign(Object.create(ViewStylePropTypes), {
|
||||
color: ColorPropType,
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
fontFamily: ReactPropTypes.string,
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
fontSize: ReactPropTypes.number,
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
fontStyle: ReactPropTypes.oneOf(['normal', 'italic']),
|
||||
/**
|
||||
* Specifies font weight. The values 'normal' and 'bold' are supported for
|
||||
* most fonts. Not all fonts have a variant for each of the numeric values,
|
||||
* in that case the closest one is chosen.
|
||||
*/
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
fontWeight: ReactPropTypes.oneOf(
|
||||
['normal' /*default*/, 'bold',
|
||||
'100', '200', '300', '400', '500', '600', '700', '800', '900']
|
||||
@@ -33,6 +37,7 @@ var TextStylePropTypes = Object.assign(Object.create(ViewStylePropTypes), {
|
||||
/**
|
||||
* @platform ios
|
||||
*/
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
fontVariant: ReactPropTypes.arrayOf(
|
||||
ReactPropTypes.oneOf([
|
||||
'small-caps',
|
||||
@@ -42,35 +47,43 @@ var TextStylePropTypes = Object.assign(Object.create(ViewStylePropTypes), {
|
||||
'proportional-nums',
|
||||
])
|
||||
),
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
textShadowOffset: ReactPropTypes.shape(
|
||||
{width: ReactPropTypes.number, height: ReactPropTypes.number}
|
||||
),
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
textShadowRadius: ReactPropTypes.number,
|
||||
textShadowColor: ColorPropType,
|
||||
/**
|
||||
* @platform ios
|
||||
*/
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
letterSpacing: ReactPropTypes.number,
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
lineHeight: ReactPropTypes.number,
|
||||
/**
|
||||
* Specifies text alignment. The value 'justify' is only supported on iOS and
|
||||
* fallbacks to `left` on Android.
|
||||
*/
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
textAlign: ReactPropTypes.oneOf(
|
||||
['auto' /*default*/, 'left', 'right', 'center', 'justify']
|
||||
),
|
||||
/**
|
||||
* @platform android
|
||||
*/
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
textAlignVertical: ReactPropTypes.oneOf(
|
||||
['auto' /*default*/, 'top', 'bottom', 'center']
|
||||
),
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
textDecorationLine: ReactPropTypes.oneOf(
|
||||
['none' /*default*/, 'underline', 'line-through', 'underline line-through']
|
||||
),
|
||||
/**
|
||||
* @platform ios
|
||||
*/
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
textDecorationStyle: ReactPropTypes.oneOf(
|
||||
['solid' /*default*/, 'double', 'dotted','dashed']
|
||||
),
|
||||
@@ -81,6 +94,7 @@ var TextStylePropTypes = Object.assign(Object.create(ViewStylePropTypes), {
|
||||
/**
|
||||
* @platform ios
|
||||
*/
|
||||
// $FlowFixMe(>=0.34.0)
|
||||
writingDirection: ReactPropTypes.oneOf(
|
||||
['auto' /*default*/, 'ltr', 'rtl']
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user