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 strict-local
    
  8.  */
    
  9. 
    
  10. import type {EncodedHookMap} from './generateHookMap';
    
  11. 
    
  12. export type ReactSourceMetadata = [?EncodedHookMap];
    
  13. export type ReactSourcesArray = $ReadOnlyArray<?ReactSourceMetadata>;
    
  14. 
    
  15. export type FBSourceMetadata = [?{...}, ?ReactSourceMetadata];
    
  16. export type FBSourcesArray = $ReadOnlyArray<?FBSourceMetadata>;
    
  17. 
    
  18. export type BasicSourceMap = {
    
  19.   +file?: string,
    
  20.   +mappings: string,
    
  21.   +names: Array<string>,
    
  22.   +sourceRoot?: string,
    
  23.   +sources: Array<string>,
    
  24.   +sourcesContent?: Array<?string>,
    
  25.   +version: number,
    
  26.   +x_facebook_sources?: FBSourcesArray,
    
  27.   +x_react_sources?: ReactSourcesArray,
    
  28. };
    
  29. 
    
  30. export type IndexSourceMapSection = {
    
  31.   map: IndexSourceMap | BasicSourceMap,
    
  32.   offset: {
    
  33.     line: number,
    
  34.     column: number,
    
  35.     ...
    
  36.   },
    
  37.   ...
    
  38. };
    
  39. 
    
  40. export type IndexSourceMap = {
    
  41.   +file?: string,
    
  42.   +mappings?: void, // avoids SourceMap being a disjoint union
    
  43.   +sourcesContent?: void,
    
  44.   +sections: Array<IndexSourceMapSection>,
    
  45.   +version: number,
    
  46.   +x_facebook_sources?: FBSourcesArray,
    
  47.   +x_react_sources?: ReactSourcesArray,
    
  48. };
    
  49. 
    
  50. export type MixedSourceMap = IndexSourceMap | BasicSourceMap;