forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-relay-hooks.js
54 lines (50 loc) · 1.44 KB
/
react-relay-hooks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
type JSONValue =
| string
| boolean
| number
| null
| {+[key: string]: JSONValue}
| $ReadOnlyArray<JSONValue>;
declare module 'ReactFlightDOMRelayServerIntegration' {
declare export opaque type Destination;
declare export opaque type BundlerConfig;
declare export function emitModel(
destination: Destination,
id: number,
json: JSONValue,
): void;
declare export function emitError(
destination: Destination,
id: number,
message: string,
stack: string,
): void;
declare export function close(destination: Destination): void;
declare export opaque type ModuleReference<T>;
declare export type ModuleMetaData = JSONValue;
declare export function resolveModuleMetaData<T>(
config: BundlerConfig,
resourceReference: ModuleReference<T>,
): ModuleMetaData;
}
declare module 'ReactFlightDOMRelayClientIntegration' {
declare export opaque type ModuleReference<T>;
declare export opaque type ModuleMetaData;
declare export function resolveModuleReference<T>(
moduleData: ModuleMetaData,
): ModuleReference<T>;
declare export function preloadModule<T>(
moduleReference: ModuleReference<T>,
): void;
declare export function requireModule<T>(
moduleReference: ModuleReference<T>,
): T;
}