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. export type RNTopLevelEventType =
    
  11.   | 'topMouseDown'
    
  12.   | 'topMouseMove'
    
  13.   | 'topMouseUp'
    
  14.   | 'topScroll'
    
  15.   | 'topSelectionChange'
    
  16.   | 'topTouchCancel'
    
  17.   | 'topTouchEnd'
    
  18.   | 'topTouchMove'
    
  19.   | 'topTouchStart';
    
  20. 
    
  21. export opaque type DOMTopLevelEventType = string;
    
  22. 
    
  23. // Do not use the below two methods directly!
    
  24. // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
    
  25. // (It is the only module that is allowed to access these methods.)
    
  26. 
    
  27. export function unsafeCastStringToDOMTopLevelType(
    
  28.   topLevelType: string,
    
  29. ): DOMTopLevelEventType {
    
  30.   return topLevelType;
    
  31. }
    
  32. 
    
  33. export function unsafeCastDOMTopLevelTypeToString(
    
  34.   topLevelType: DOMTopLevelEventType,
    
  35. ): string {
    
  36.   return topLevelType;
    
  37. }
    
  38. 
    
  39. export type TopLevelType = DOMTopLevelEventType | RNTopLevelEventType;