Skip to content

Commit

Permalink
Add annotations to prepare for fully resolved environment
Browse files Browse the repository at this point in the history
Summary: Changelog: [internal]

Reviewed By: samwgoldman

Differential Revision: D37469106

fbshipit-source-id: a28fc3f8a5947bb09a808a4162080c3fe6bfb1f5
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Jun 29, 2022
1 parent 33dc0bb commit 4d62e0d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Libraries/Inspector/ElementBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ElementBox extends React.Component<$FlowFixMeProps> {
let padding = resolveBoxStyle('padding', style);

const frameStyle = {...this.props.frame};
const contentStyle = {
const contentStyle: {width: number, height: number} = {
width: this.props.frame.width,
height: this.props.frame.height,
};
Expand Down
30 changes: 16 additions & 14 deletions Libraries/Interaction/PanResponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,21 @@ type ActiveCallback = (

type PassiveCallback = (event: PressEvent, gestureState: GestureState) => mixed;

type PanHandlers = {|
onMoveShouldSetResponder: (event: PressEvent) => boolean,
onMoveShouldSetResponderCapture: (event: PressEvent) => boolean,
onResponderEnd: (event: PressEvent) => void,
onResponderGrant: (event: PressEvent) => boolean,
onResponderMove: (event: PressEvent) => void,
onResponderReject: (event: PressEvent) => void,
onResponderRelease: (event: PressEvent) => void,
onResponderStart: (event: PressEvent) => void,
onResponderTerminate: (event: PressEvent) => void,
onResponderTerminationRequest: (event: PressEvent) => boolean,
onStartShouldSetResponder: (event: PressEvent) => boolean,
onStartShouldSetResponderCapture: (event: PressEvent) => boolean,
|};

type PanResponderConfig = $ReadOnly<{|
onMoveShouldSetPanResponder?: ?ActiveCallback,
onMoveShouldSetPanResponderCapture?: ?ActiveCallback,
Expand Down Expand Up @@ -385,20 +400,7 @@ const PanResponder = {
*/
create(config: PanResponderConfig): $TEMPORARY$object<{|
getInteractionHandle: () => ?number,
panHandlers: $TEMPORARY$object<{|
onMoveShouldSetResponder: (event: PressEvent) => boolean,
onMoveShouldSetResponderCapture: (event: PressEvent) => boolean,
onResponderEnd: (event: PressEvent) => void,
onResponderGrant: (event: PressEvent) => boolean,
onResponderMove: (event: PressEvent) => void,
onResponderReject: (event: PressEvent) => void,
onResponderRelease: (event: PressEvent) => void,
onResponderStart: (event: PressEvent) => void,
onResponderTerminate: (event: PressEvent) => void,
onResponderTerminationRequest: (event: PressEvent) => boolean,
onStartShouldSetResponder: (event: PressEvent) => boolean,
onStartShouldSetResponderCapture: (event: PressEvent) => boolean,
|}>,
panHandlers: PanHandlers,
|}> {
const interactionState = {
handle: (null: ?number),
Expand Down

0 comments on commit 4d62e0d

Please sign in to comment.