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 type for SyntheticEvent class that includes private properties
    
  8.  * @flow
    
  9.  */
    
  10. 
    
  11. import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
    
  12. import type {DOMEventName} from './DOMEventNames';
    
  13. 
    
  14. export type DispatchConfig = {
    
  15.   dependencies?: Array<DOMEventName>,
    
  16.   phasedRegistrationNames: {
    
  17.     bubbled: null | string,
    
  18.     captured: null | string,
    
  19.   },
    
  20.   registrationName?: string,
    
  21. };
    
  22. 
    
  23. type BaseSyntheticEvent = {
    
  24.   isPersistent: () => boolean,
    
  25.   isPropagationStopped: () => boolean,
    
  26.   _dispatchInstances?: null | Array<Fiber | null> | Fiber,
    
  27.   _dispatchListeners?: null | Array<Function> | Function,
    
  28.   _targetInst: Fiber,
    
  29.   nativeEvent: Event,
    
  30.   target?: mixed,
    
  31.   relatedTarget?: mixed,
    
  32.   type: string,
    
  33.   currentTarget: null | EventTarget,
    
  34. };
    
  35. 
    
  36. export type KnownReactSyntheticEvent = BaseSyntheticEvent & {
    
  37.   _reactName: string,
    
  38. };
    
  39. export type UnknownReactSyntheticEvent = BaseSyntheticEvent & {
    
  40.   _reactName: null,
    
  41. };
    
  42. 
    
  43. export type ReactSyntheticEvent =
    
  44.   | KnownReactSyntheticEvent
    
  45.   | UnknownReactSyntheticEvent;