2016-05-27 09:13:21 +08:00
|
|
|
/**
|
2017-09-25 04:48:13 +08:00
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
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-10-26 03:23:55 +08:00
|
|
|
| ReactCall
|
|
|
|
|
| ReactReturn
|
2017-03-14 08:05:18 +08:00
|
|
|
| ReactPortal
|
|
|
|
|
| ReactText
|
|
|
|
|
| ReactFragment;
|
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;
|
|
|
|
|
|
|
|
|
|
export type ReactEmpty = null | void | boolean;
|
2017-05-25 00:06:30 +08:00
|
|
|
|
2017-10-26 03:23:55 +08:00
|
|
|
export type ReactCall = {
|
2017-05-25 00:06:30 +08:00
|
|
|
$$typeof: Symbol | number,
|
|
|
|
|
key: null | string,
|
|
|
|
|
children: any,
|
2017-10-26 03:23:55 +08:00
|
|
|
// This should be a more specific CallHandler
|
|
|
|
|
handler: (props: any, returns: Array<mixed>) => ReactNodeList,
|
2017-05-25 00:06:30 +08:00
|
|
|
props: any,
|
|
|
|
|
};
|
|
|
|
|
|
2017-10-26 03:23:55 +08:00
|
|
|
export type ReactReturn = {
|
2017-05-25 00:06:30 +08:00
|
|
|
$$typeof: Symbol | number,
|
|
|
|
|
value: mixed,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ReactPortal = {
|
|
|
|
|
$$typeof: Symbol | number,
|
|
|
|
|
key: null | string,
|
|
|
|
|
containerInfo: any,
|
|
|
|
|
children: ReactNodeList,
|
|
|
|
|
// TODO: figure out the API for cross-renderer implementation.
|
|
|
|
|
implementation: any,
|
|
|
|
|
};
|