main
js 57 lines 2.08 KB
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow
8 */
9
10 // This is a host config that's used for the internal `react-noop-renderer` package.
11 //
12 // Its API lets you pass the host config as an argument.
13 // However, inside the `react-server` we treat host config as a module.
14 // This file is a shim between two worlds.
15 //
16 // It works because the `react-server` bundle is wrapped in something like:
17 //
18 // module.exports = function ($$$config) {
19 // /* renderer code */
20 // }
21 //
22 // So `$$$config` looks like a global variable, but it's
23 // really an argument to a top-level wrapping function.
24
25 declare const $$$config: $FlowFixMe;
26
27 export opaque type ModuleLoading = mixed;
28 export opaque type ServerConsumerModuleMap = mixed;
29 export opaque type ServerManifest = mixed;
30 export opaque type ServerReferenceId = string;
31 export opaque type ClientReferenceMetadata = mixed;
32 export opaque type ClientReference<T> = mixed; // eslint-disable-line no-unused-vars
33 export const resolveClientReference = $$$config.resolveClientReference;
34 export const resolveServerReference = $$$config.resolveServerReference;
35 export const preloadModule = $$$config.preloadModule;
36 export const requireModule = $$$config.requireModule;
37 export const getModuleDebugInfo = $$$config.getModuleDebugInfo;
38 export const dispatchHint = $$$config.dispatchHint;
39 export const prepareDestinationForModule =
40 $$$config.prepareDestinationForModule;
41 export const usedWithSSR = true;
42
43 export opaque type Source = mixed;
44
45 export opaque type StringDecoder = mixed;
46
47 export const createStringDecoder = $$$config.createStringDecoder;
48 export const readPartialStringChunk = $$$config.readPartialStringChunk;
49 export const readFinalStringChunk = $$$config.readFinalStringChunk;
50
51 export const bindToConsole = $$$config.bindToConsole;
52
53 export const rendererVersion = $$$config.rendererVersion;
54 export const rendererPackageName = $$$config.rendererPackageName;
55
56 export const checkEvalAvailabilityOnceDev =
57 $$$config.checkEvalAvailabilityOnceDev;