mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49424 Changelog: [Internal] Reviewed By: huntie Differential Revision: D69655561 fbshipit-source-id: c36036a2abb43dd75c41582f2a27e7f9d3509044
33 lines
806 B
JavaScript
33 lines
806 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
// Make sure global Event is defined
|
|
import EventPolyfill from './EventPolyfill';
|
|
|
|
type CustomEvent$Options = $ReadOnly<{
|
|
bubbles?: boolean,
|
|
cancelable?: boolean,
|
|
composed?: boolean,
|
|
detail?: {...},
|
|
}>;
|
|
|
|
class CustomEvent extends EventPolyfill {
|
|
detail: ?{...};
|
|
|
|
constructor(typeArg: string, options: CustomEvent$Options) {
|
|
const {bubbles, cancelable, composed} = options;
|
|
super(typeArg, {bubbles, cancelable, composed});
|
|
|
|
this.detail = options.detail; // this would correspond to `NativeEvent` in NativeSyntheticEvent
|
|
}
|
|
}
|
|
|
|
export default CustomEvent;
|