-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds experimental event component responder surfaces (#15228)
* Adds Press and Hover event modules + more features to the Event Responder System
- Loading branch information
Showing
15 changed files
with
1,040 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
import SyntheticEvent from 'events/SyntheticEvent'; | ||
import type {AnyNativeEvent} from 'events/PluginModuleType'; | ||
|
||
export type EventResponderContext = { | ||
event: AnyNativeEvent, | ||
eventTarget: EventTarget, | ||
eventType: string, | ||
isPassive: () => boolean, | ||
isPassiveSupported: () => boolean, | ||
dispatchEvent: ( | ||
name: string, | ||
listener: (e: SyntheticEvent) => void | null, | ||
pressTarget: EventTarget | null, | ||
discrete: boolean, | ||
extraProperties?: Object, | ||
) => void, | ||
isTargetWithinElement: ( | ||
childTarget: EventTarget, | ||
parentTarget: EventTarget, | ||
) => boolean, | ||
isTargetOwned: EventTarget => boolean, | ||
isTargetWithinEventComponent: EventTarget => boolean, | ||
isPositionWithinTouchHitTarget: (x: number, y: number) => boolean, | ||
addRootEventTypes: (rootEventTypes: Array<string>) => void, | ||
removeRootEventTypes: (rootEventTypes: Array<string>) => void, | ||
requestOwnership: (target: EventTarget | null) => boolean, | ||
releaseOwnership: (target: EventTarget | null) => boolean, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.