2016-05-27 09:13:21 +08:00
|
|
|
/**
|
2018-09-08 06:11:23 +08:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-05-27 09:13:21 +08:00
|
|
|
*
|
2017-09-25 04:48:13 +08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-05-27 09:13:21 +08:00
|
|
|
*
|
|
|
|
|
* @flow
|
|
|
|
|
*/
|
|
|
|
|
|
2017-03-14 08:05:18 +08:00
|
|
|
export type ReactNode =
|
2017-08-29 05:39:58 +08:00
|
|
|
| React$Element<any>
|
2017-03-14 08:05:18 +08:00
|
|
|
| ReactPortal
|
|
|
|
|
| ReactText
|
2018-01-25 11:36:22 +08:00
|
|
|
| ReactFragment
|
|
|
|
|
| ReactProvider<any>
|
|
|
|
|
| ReactConsumer<any>;
|
2018-09-10 23:15:18 +08:00
|
|
|
|
|
|
|
|
export type ReactEmpty = null | void | boolean;
|
2016-05-27 09:13:21 +08:00
|
|
|
|
2017-08-29 05:39:58 +08:00
|
|
|
export type ReactFragment = ReactEmpty | Iterable<React$Node>;
|
2016-05-27 09:13:21 +08:00
|
|
|
|
2017-08-29 05:39:58 +08:00
|
|
|
export type ReactNodeList = ReactEmpty | React$Node;
|
2016-05-27 09:13:21 +08:00
|
|
|
|
|
|
|
|
export type ReactText = string | number;
|
|
|
|
|
|
2018-01-25 11:36:22 +08:00
|
|
|
export type ReactProvider<T> = {
|
|
|
|
|
$$typeof: Symbol | number,
|
|
|
|
|
type: ReactProviderType<T>,
|
|
|
|
|
key: null | string,
|
|
|
|
|
ref: null,
|
|
|
|
|
props: {
|
|
|
|
|
value: T,
|
|
|
|
|
children?: ReactNodeList,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ReactProviderType<T> = {
|
|
|
|
|
$$typeof: Symbol | number,
|
2018-04-03 08:47:25 +08:00
|
|
|
_context: ReactContext<T>,
|
2018-01-25 11:36:22 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ReactConsumer<T> = {
|
|
|
|
|
$$typeof: Symbol | number,
|
|
|
|
|
type: ReactContext<T>,
|
|
|
|
|
key: null | string,
|
|
|
|
|
ref: null,
|
|
|
|
|
props: {
|
2018-01-31 05:06:12 +08:00
|
|
|
children: (value: T) => ReactNodeList,
|
2018-03-23 23:58:49 +08:00
|
|
|
unstable_observedBits?: number,
|
2018-01-25 11:36:22 +08:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ReactContext<T> = {
|
|
|
|
|
$$typeof: Symbol | number,
|
2018-01-31 05:06:12 +08:00
|
|
|
Consumer: ReactContext<T>,
|
|
|
|
|
Provider: ReactProviderType<T>,
|
2018-03-13 05:30:47 +08:00
|
|
|
|
|
|
|
|
_calculateChangedBits: ((a: T, b: T) => number) | null,
|
|
|
|
|
|
|
|
|
|
_currentValue: T,
|
2018-05-11 09:34:01 +08:00
|
|
|
_currentValue2: T,
|
2018-11-10 07:38:20 +08:00
|
|
|
_threadCount: number,
|
2018-01-25 11:36:22 +08:00
|
|
|
|
|
|
|
|
// DEV only
|
|
|
|
|
_currentRenderer?: Object | null,
|
2018-05-11 09:34:01 +08:00
|
|
|
_currentRenderer2?: Object | null,
|
2018-01-25 11:36:22 +08:00
|
|
|
};
|
|
|
|
|
|
2017-05-25 00:06:30 +08:00
|
|
|
export type ReactPortal = {
|
|
|
|
|
$$typeof: Symbol | number,
|
|
|
|
|
key: null | string,
|
|
|
|
|
containerInfo: any,
|
|
|
|
|
children: ReactNodeList,
|
|
|
|
|
// TODO: figure out the API for cross-renderer implementation.
|
|
|
|
|
implementation: any,
|
|
|
|
|
};
|
2018-02-07 04:19:49 +08:00
|
|
|
|
|
|
|
|
export type RefObject = {|
|
2018-03-15 00:43:20 +08:00
|
|
|
current: any,
|
2018-02-07 04:19:49 +08:00
|
|
|
|};
|