Skip to content

Commit

Permalink
Patch Flow syntax failures
Browse files Browse the repository at this point in the history
  • Loading branch information
joemun committed Dec 5, 2024
1 parent 0a0ae4f commit 3cf313f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ import {useMemo} from 'react';

export type AnimatedProps<Props: {...}> = {
// eslint-disable-next-line no-unused-vars
+[_K in keyof (Props &
$ReadOnly<{
passthroughAnimatedPropExplicitValues?: React.ElementConfig<
typeof View,
>,
}>)]: any,
+[_K]: any,
};

export type AnimatedComponentType<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MAX_DEPTH = 5;

/* $FlowIssue[incompatible-type-guard] - Flow does not know that the prototype
and ReactElement checks preserve the type refinement of `value`. */
function isPlainObject(value: mixed): value is $ReadOnly<{[string]: mixed}> {
function isPlainObject(value: mixed) {
return (
value !== null &&
typeof value === 'object' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface Registration<TArgs> {
}

type Registry<TEventToArgsMap: {...}> = {
[K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>,
[K]: Set<Registration<TEventToArgsMap[K]>>,
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const API = {
}
: (tag, saveValueCallback) => {
NativeOperations.getValue(tag, saveValueCallback);
}) as $NonMaybeType<typeof NativeAnimatedModule>['getValue'],
}),

setWaitingForIdentifier(id: string): void {
waitingForQueuedOperations.add(id);
Expand Down Expand Up @@ -216,7 +216,7 @@ const API = {
if (Platform.OS === 'android') {
NativeAnimatedModule?.finishOperationBatch?.();
}
}) as () => void,
}),

createAnimatedNode(tag: number, config: AnimatedNodeConfig): void {
NativeOperations.createAnimatedNode(tag, config);
Expand Down Expand Up @@ -258,7 +258,7 @@ const API = {
config,
endCallback,
);
}) as $NonMaybeType<typeof NativeAnimatedModule>['startAnimatingNode'],
}),

stopAnimation(animationId: number) {
NativeOperations.stopAnimation(animationId);
Expand Down

0 comments on commit 3cf313f

Please sign in to comment.