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 `react-server` package on npm.
    
  11. // It is only used by third-party renderers.
    
  12. //
    
  13. // Its API lets you pass the host config as an argument.
    
  14. // However, inside the `react-server` we treat host config as a module.
    
  15. // This file is a shim between two worlds.
    
  16. //
    
  17. // It works because the `react-server` bundle is wrapped in something like:
    
  18. //
    
  19. // module.exports = function ($$$config) {
    
  20. //   /* renderer code */
    
  21. // }
    
  22. //
    
  23. // So `$$$config` looks like a global variable, but it's
    
  24. // really an argument to a top-level wrapping function.
    
  25. 
    
  26. declare var $$$config: any;
    
  27. 
    
  28. export opaque type ModuleLoading = mixed;
    
  29. export opaque type SSRModuleMap = mixed;
    
  30. export opaque type ServerManifest = mixed;
    
  31. export opaque type ServerReferenceId = string;
    
  32. export opaque type ClientReferenceMetadata = mixed;
    
  33. export opaque type ClientReference<T> = mixed; // eslint-disable-line no-unused-vars
    
  34. export const resolveClientReference = $$$config.resolveClientReference;
    
  35. export const resolveServerReference = $$$config.resolveServerReference;
    
  36. export const preloadModule = $$$config.preloadModule;
    
  37. export const requireModule = $$$config.requireModule;
    
  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; // eslint-disable-line no-undef
    
  46. 
    
  47. export const createStringDecoder = $$$config.createStringDecoder;
    
  48. export const readPartialStringChunk = $$$config.readPartialStringChunk;
    
  49. export const readFinalStringChunk = $$$config.readFinalStringChunk;