Skip to content

Commit

Permalink
💄Refine TypeScript type for boolean functions (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored and osdnk committed Jun 8, 2019
1 parent b8a1041 commit 24844ff
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions react-native-reanimated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ declare module 'react-native-reanimated' {
| T
| AnimatedNode<T>
| ReadonlyArray<T | AnimatedNode<T> | ReadonlyArray<T | AnimatedNode<T>>>;
type BinaryOperator = (
type BinaryOperator<T = number> = (
left: Adaptable<number>,
right: Adaptable<number>
) => AnimatedNode<number>;
) => AnimatedNode<T>;
type UnaryOperator = (value: Adaptable<number>) => AnimatedNode<number>;
type MultiOperator = (
a: Adaptable<number>,
Expand Down Expand Up @@ -205,14 +205,14 @@ declare module 'react-native-reanimated' {
export const round: UnaryOperator;
export const floor: UnaryOperator;
export const ceil: UnaryOperator;
export const lessThan: BinaryOperator;
export const eq: BinaryOperator;
export const greaterThan: BinaryOperator;
export const lessOrEq: BinaryOperator;
export const greaterOrEq: BinaryOperator;
export const neq: BinaryOperator;
export const and: MultiOperator;
export const or: MultiOperator;
export const lessThan: BinaryOperator<0 | 1>;
export const eq: BinaryOperator<0 | 1>;
export const greaterThan: BinaryOperator<0 | 1>;
export const lessOrEq: BinaryOperator<0 | 1>;
export const greaterOrEq: BinaryOperator<0 | 1>;
export const neq: BinaryOperator<0 | 1>;
export const and: MultiOperator<0 | 1>;
export const or: MultiOperator<0 | 1>;
export function defined(value: Adaptable<any>): AnimatedNode<0 | 1>;
export function not(value: Adaptable<any>): AnimatedNode<0 | 1>;
export function set(
Expand Down

0 comments on commit 24844ff

Please sign in to comment.