@yahoo/uds-mobile 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -0
- package/dist/_virtual/_rolldown/runtime.cjs +14 -0
- package/dist/_virtual/_rolldown/runtime.js +19 -0
- package/dist/components/Switch.cjs +2 -2
- package/dist/components/Switch.js +2 -2
- package/dist/components/Switch.js.map +1 -1
- package/dist/jest/index.cjs +27 -0
- package/dist/jest/index.d.cts +19 -0
- package/dist/jest/index.d.cts.map +1 -0
- package/dist/jest/index.d.ts +19 -0
- package/dist/jest/index.d.ts.map +1 -0
- package/dist/jest/index.js +25 -0
- package/dist/jest/index.js.map +1 -0
- package/dist/jest/mocks/icons.cjs +56 -0
- package/dist/jest/mocks/icons.d.cts +24 -0
- package/dist/jest/mocks/icons.d.cts.map +1 -0
- package/dist/jest/mocks/icons.d.ts +24 -0
- package/dist/jest/mocks/icons.d.ts.map +1 -0
- package/dist/jest/mocks/icons.js +46 -0
- package/dist/jest/mocks/icons.js.map +1 -0
- package/dist/jest/mocks/react-native.cjs +212 -0
- package/dist/jest/mocks/react-native.d.cts +293 -0
- package/dist/jest/mocks/react-native.d.cts.map +1 -0
- package/dist/jest/mocks/react-native.d.ts +293 -0
- package/dist/jest/mocks/react-native.d.ts.map +1 -0
- package/dist/jest/mocks/react-native.js +180 -0
- package/dist/jest/mocks/react-native.js.map +1 -0
- package/dist/jest/mocks/reanimated.cjs +249 -0
- package/dist/jest/mocks/reanimated.d.cts +150 -0
- package/dist/jest/mocks/reanimated.d.cts.map +1 -0
- package/dist/jest/mocks/reanimated.d.ts +150 -0
- package/dist/jest/mocks/reanimated.d.ts.map +1 -0
- package/dist/jest/mocks/reanimated.js +210 -0
- package/dist/jest/mocks/reanimated.js.map +1 -0
- package/dist/jest/mocks/styles.cjs +327 -0
- package/dist/jest/mocks/styles.d.cts +33 -0
- package/dist/jest/mocks/styles.d.cts.map +1 -0
- package/dist/jest/mocks/styles.d.ts +33 -0
- package/dist/jest/mocks/styles.d.ts.map +1 -0
- package/dist/jest/mocks/styles.js +310 -0
- package/dist/jest/mocks/styles.js.map +1 -0
- package/dist/jest/mocks/svg.cjs +133 -0
- package/dist/jest/mocks/svg.d.cts +137 -0
- package/dist/jest/mocks/svg.d.cts.map +1 -0
- package/dist/jest/mocks/svg.d.ts +137 -0
- package/dist/jest/mocks/svg.d.ts.map +1 -0
- package/dist/jest/mocks/svg.js +100 -0
- package/dist/jest/mocks/svg.js.map +1 -0
- package/dist/jest/mocks/unistyles.cjs +143 -0
- package/dist/jest/mocks/unistyles.d.cts +197 -0
- package/dist/jest/mocks/unistyles.d.cts.map +1 -0
- package/dist/jest/mocks/unistyles.d.ts +197 -0
- package/dist/jest/mocks/unistyles.d.ts.map +1 -0
- package/dist/jest/mocks/unistyles.js +132 -0
- package/dist/jest/mocks/unistyles.js.map +1 -0
- package/dist/jest/setup.cjs +40 -0
- package/dist/jest/setup.d.cts +11 -0
- package/dist/jest/setup.d.cts.map +1 -0
- package/dist/jest/setup.d.ts +11 -0
- package/dist/jest/setup.d.ts.map +1 -0
- package/dist/jest/setup.js +39 -0
- package/dist/jest/setup.js.map +1 -0
- package/dist/types/dist/index.d.cts.map +1 -1
- package/dist/types/dist/index.d.ts.map +1 -1
- package/generated/styles.cjs +46 -0
- package/generated/styles.d.ts +17 -0
- package/generated/styles.mjs +46 -0
- package/generated/unistyles.d.ts +25 -0
- package/package.json +11 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
3
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
|
|
8
|
+
//#region src/jest/mocks/reanimated.tsx
|
|
9
|
+
var reanimated_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
10
|
+
Animated: () => Animated,
|
|
11
|
+
Easing: () => Easing,
|
|
12
|
+
FadeIn: () => FadeIn,
|
|
13
|
+
FadeOut: () => FadeOut,
|
|
14
|
+
SlideInRight: () => SlideInRight,
|
|
15
|
+
SlideOutLeft: () => SlideOutLeft,
|
|
16
|
+
ZoomIn: () => ZoomIn,
|
|
17
|
+
ZoomOut: () => ZoomOut,
|
|
18
|
+
cancelAnimation: () => cancelAnimation,
|
|
19
|
+
convertToRGBA: () => convertToRGBA,
|
|
20
|
+
createAnimatedComponent: () => createAnimatedComponent,
|
|
21
|
+
default: () => Animated,
|
|
22
|
+
interpolate: () => interpolate,
|
|
23
|
+
interpolateColor: () => interpolateColor,
|
|
24
|
+
isWorklet: () => isWorklet,
|
|
25
|
+
measure: () => measure,
|
|
26
|
+
runOnJS: () => runOnJS,
|
|
27
|
+
runOnUI: () => runOnUI,
|
|
28
|
+
scrollTo: () => scrollTo,
|
|
29
|
+
useAnimatedGestureHandler: () => useAnimatedGestureHandler,
|
|
30
|
+
useAnimatedProps: () => useAnimatedProps,
|
|
31
|
+
useAnimatedReaction: () => useAnimatedReaction,
|
|
32
|
+
useAnimatedRef: () => useAnimatedRef,
|
|
33
|
+
useAnimatedScrollHandler: () => useAnimatedScrollHandler,
|
|
34
|
+
useAnimatedStyle: () => useAnimatedStyle,
|
|
35
|
+
useDerivedValue: () => useDerivedValue,
|
|
36
|
+
useSharedValue: () => useSharedValue,
|
|
37
|
+
withDecay: () => withDecay,
|
|
38
|
+
withDelay: () => withDelay,
|
|
39
|
+
withRepeat: () => withRepeat,
|
|
40
|
+
withSequence: () => withSequence,
|
|
41
|
+
withSpring: () => withSpring,
|
|
42
|
+
withTiming: () => withTiming
|
|
43
|
+
});
|
|
44
|
+
function useSharedValue(initialValue) {
|
|
45
|
+
return {
|
|
46
|
+
value: initialValue,
|
|
47
|
+
addListener: jest.fn(),
|
|
48
|
+
removeListener: jest.fn(),
|
|
49
|
+
modify: jest.fn()
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function useDerivedValue(derivedFn) {
|
|
53
|
+
try {
|
|
54
|
+
return { value: derivedFn() };
|
|
55
|
+
} catch {
|
|
56
|
+
return { value: void 0 };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function useAnimatedStyle(styleWorklet) {
|
|
60
|
+
try {
|
|
61
|
+
return styleWorklet();
|
|
62
|
+
} catch {
|
|
63
|
+
return {};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function withTiming(toValue) {
|
|
67
|
+
return toValue;
|
|
68
|
+
}
|
|
69
|
+
function withSpring(toValue) {
|
|
70
|
+
return toValue;
|
|
71
|
+
}
|
|
72
|
+
function withDelay(_delay, animation) {
|
|
73
|
+
return animation;
|
|
74
|
+
}
|
|
75
|
+
function withSequence(...animations) {
|
|
76
|
+
return animations[animations.length - 1];
|
|
77
|
+
}
|
|
78
|
+
function withRepeat(animation) {
|
|
79
|
+
return animation;
|
|
80
|
+
}
|
|
81
|
+
function withDecay(config) {
|
|
82
|
+
return config.velocity ?? 0;
|
|
83
|
+
}
|
|
84
|
+
function interpolate(value, inputRange, outputRange, _extrapolation) {
|
|
85
|
+
if (value <= inputRange[0]) return outputRange[0];
|
|
86
|
+
if (value >= inputRange[inputRange.length - 1]) return outputRange[outputRange.length - 1];
|
|
87
|
+
for (let i = 0; i < inputRange.length - 1; i++) if (value >= inputRange[i] && value <= inputRange[i + 1]) {
|
|
88
|
+
const progress = (value - inputRange[i]) / (inputRange[i + 1] - inputRange[i]);
|
|
89
|
+
return outputRange[i] + progress * (outputRange[i + 1] - outputRange[i]);
|
|
90
|
+
}
|
|
91
|
+
return outputRange[outputRange.length - 1];
|
|
92
|
+
}
|
|
93
|
+
function interpolateColor(value, inputRange, outputRange) {
|
|
94
|
+
if (value <= inputRange[0]) return outputRange[0];
|
|
95
|
+
if (value >= inputRange[inputRange.length - 1]) return outputRange[outputRange.length - 1];
|
|
96
|
+
const index = Math.round((value - inputRange[0]) / (inputRange[inputRange.length - 1] - inputRange[0]) * (outputRange.length - 1));
|
|
97
|
+
return outputRange[Math.min(index, outputRange.length - 1)];
|
|
98
|
+
}
|
|
99
|
+
const Easing = {
|
|
100
|
+
linear: (t) => t,
|
|
101
|
+
ease: (t) => t,
|
|
102
|
+
quad: (t) => t * t,
|
|
103
|
+
cubic: (t) => t * t * t,
|
|
104
|
+
poly: (_n) => (t) => t,
|
|
105
|
+
sin: (t) => t,
|
|
106
|
+
circle: (t) => t,
|
|
107
|
+
exp: (t) => t,
|
|
108
|
+
elastic: (_bounciness) => (t) => t,
|
|
109
|
+
back: (_s) => (t) => t,
|
|
110
|
+
bounce: (t) => t,
|
|
111
|
+
bezier: () => (t) => t,
|
|
112
|
+
bezierFn: () => (t) => t,
|
|
113
|
+
in: (easing) => easing,
|
|
114
|
+
out: (easing) => easing,
|
|
115
|
+
inOut: (easing) => easing
|
|
116
|
+
};
|
|
117
|
+
function useAnimatedGestureHandler() {
|
|
118
|
+
return {};
|
|
119
|
+
}
|
|
120
|
+
function useAnimatedScrollHandler() {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
function useAnimatedProps(propsWorklet) {
|
|
124
|
+
try {
|
|
125
|
+
return propsWorklet();
|
|
126
|
+
} catch {
|
|
127
|
+
return {};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function useAnimatedRef() {
|
|
131
|
+
return { current: null };
|
|
132
|
+
}
|
|
133
|
+
function useAnimatedReaction() {}
|
|
134
|
+
function MockView({ children, style, testID, ...props }) {
|
|
135
|
+
return react.default.createElement("View", {
|
|
136
|
+
style,
|
|
137
|
+
testID,
|
|
138
|
+
...props
|
|
139
|
+
}, children);
|
|
140
|
+
}
|
|
141
|
+
function MockText({ children, style, testID, ...props }) {
|
|
142
|
+
return react.default.createElement("Text", {
|
|
143
|
+
style,
|
|
144
|
+
testID,
|
|
145
|
+
...props
|
|
146
|
+
}, children);
|
|
147
|
+
}
|
|
148
|
+
function MockScrollView({ children, style, testID, ...props }) {
|
|
149
|
+
return react.default.createElement("ScrollView", {
|
|
150
|
+
style,
|
|
151
|
+
testID,
|
|
152
|
+
...props
|
|
153
|
+
}, children);
|
|
154
|
+
}
|
|
155
|
+
function MockImage({ style, testID = "AnimatedImage", ...props }) {
|
|
156
|
+
return react.default.createElement("Image", {
|
|
157
|
+
style,
|
|
158
|
+
testID,
|
|
159
|
+
...props
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function createAnimatedComponent(Component) {
|
|
163
|
+
function AnimatedComponent({ children, style, ...props }) {
|
|
164
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
165
|
+
style: Array.isArray(style) ? Object.assign({}, ...style) : style,
|
|
166
|
+
...props,
|
|
167
|
+
children
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
AnimatedComponent.displayName = `Animated(${Component.displayName || Component.name || "Component"})`;
|
|
171
|
+
return AnimatedComponent;
|
|
172
|
+
}
|
|
173
|
+
const Animated = {
|
|
174
|
+
View: MockView,
|
|
175
|
+
Text: MockText,
|
|
176
|
+
Image: MockImage,
|
|
177
|
+
ScrollView: MockScrollView,
|
|
178
|
+
createAnimatedComponent
|
|
179
|
+
};
|
|
180
|
+
const FadeIn = { duration: jest.fn().mockReturnThis() };
|
|
181
|
+
const FadeOut = { duration: jest.fn().mockReturnThis() };
|
|
182
|
+
const SlideInRight = { duration: jest.fn().mockReturnThis() };
|
|
183
|
+
const SlideOutLeft = { duration: jest.fn().mockReturnThis() };
|
|
184
|
+
const ZoomIn = { duration: jest.fn().mockReturnThis() };
|
|
185
|
+
const ZoomOut = { duration: jest.fn().mockReturnThis() };
|
|
186
|
+
function convertToRGBA(color) {
|
|
187
|
+
if (typeof color === "string") return color;
|
|
188
|
+
return `rgba(${color >> 16 & 255}, ${color >> 8 & 255}, ${color & 255}, 1)`;
|
|
189
|
+
}
|
|
190
|
+
function runOnJS(fn) {
|
|
191
|
+
return fn;
|
|
192
|
+
}
|
|
193
|
+
function runOnUI(fn) {
|
|
194
|
+
return fn;
|
|
195
|
+
}
|
|
196
|
+
function isWorklet() {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
const cancelAnimation = jest.fn();
|
|
200
|
+
const measure = jest.fn(() => ({
|
|
201
|
+
x: 0,
|
|
202
|
+
y: 0,
|
|
203
|
+
width: 100,
|
|
204
|
+
height: 100,
|
|
205
|
+
pageX: 0,
|
|
206
|
+
pageY: 0
|
|
207
|
+
}));
|
|
208
|
+
const scrollTo = jest.fn();
|
|
209
|
+
|
|
210
|
+
//#endregion
|
|
211
|
+
exports.Animated = Animated;
|
|
212
|
+
exports.default = Animated;
|
|
213
|
+
exports.Easing = Easing;
|
|
214
|
+
exports.FadeIn = FadeIn;
|
|
215
|
+
exports.FadeOut = FadeOut;
|
|
216
|
+
exports.SlideInRight = SlideInRight;
|
|
217
|
+
exports.SlideOutLeft = SlideOutLeft;
|
|
218
|
+
exports.ZoomIn = ZoomIn;
|
|
219
|
+
exports.ZoomOut = ZoomOut;
|
|
220
|
+
exports.cancelAnimation = cancelAnimation;
|
|
221
|
+
exports.convertToRGBA = convertToRGBA;
|
|
222
|
+
exports.createAnimatedComponent = createAnimatedComponent;
|
|
223
|
+
exports.interpolate = interpolate;
|
|
224
|
+
exports.interpolateColor = interpolateColor;
|
|
225
|
+
exports.isWorklet = isWorklet;
|
|
226
|
+
exports.measure = measure;
|
|
227
|
+
Object.defineProperty(exports, 'reanimated_exports', {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function () {
|
|
230
|
+
return reanimated_exports;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
exports.runOnJS = runOnJS;
|
|
234
|
+
exports.runOnUI = runOnUI;
|
|
235
|
+
exports.scrollTo = scrollTo;
|
|
236
|
+
exports.useAnimatedGestureHandler = useAnimatedGestureHandler;
|
|
237
|
+
exports.useAnimatedProps = useAnimatedProps;
|
|
238
|
+
exports.useAnimatedReaction = useAnimatedReaction;
|
|
239
|
+
exports.useAnimatedRef = useAnimatedRef;
|
|
240
|
+
exports.useAnimatedScrollHandler = useAnimatedScrollHandler;
|
|
241
|
+
exports.useAnimatedStyle = useAnimatedStyle;
|
|
242
|
+
exports.useDerivedValue = useDerivedValue;
|
|
243
|
+
exports.useSharedValue = useSharedValue;
|
|
244
|
+
exports.withDecay = withDecay;
|
|
245
|
+
exports.withDelay = withDelay;
|
|
246
|
+
exports.withRepeat = withRepeat;
|
|
247
|
+
exports.withSequence = withSequence;
|
|
248
|
+
exports.withSpring = withSpring;
|
|
249
|
+
exports.withTiming = withTiming;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
|
|
2
|
+
import React, { ComponentType, PropsWithChildren, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/jest/mocks/reanimated.d.ts
|
|
5
|
+
declare namespace reanimated_d_exports {
|
|
6
|
+
export { Animated, Easing, FadeIn, FadeOut, SlideInRight, SlideOutLeft, ZoomIn, ZoomOut, cancelAnimation, convertToRGBA, createAnimatedComponent, Animated as default, interpolate, interpolateColor, isWorklet, measure, runOnJS, runOnUI, scrollTo, useAnimatedGestureHandler, useAnimatedProps, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue, withDecay, withDelay, withRepeat, withSequence, withSpring, withTiming };
|
|
7
|
+
}
|
|
8
|
+
declare function useSharedValue<T>(initialValue: T): {
|
|
9
|
+
value: T;
|
|
10
|
+
addListener: jest.Mock<any, any, any>;
|
|
11
|
+
removeListener: jest.Mock<any, any, any>;
|
|
12
|
+
modify: jest.Mock<any, any, any>;
|
|
13
|
+
};
|
|
14
|
+
declare function useDerivedValue<T>(derivedFn: () => T): {
|
|
15
|
+
value: T;
|
|
16
|
+
};
|
|
17
|
+
declare function useAnimatedStyle<T extends object>(styleWorklet: () => T): T;
|
|
18
|
+
declare function withTiming<T>(toValue: T): T;
|
|
19
|
+
declare function withSpring<T>(toValue: T): T;
|
|
20
|
+
declare function withDelay<T>(_delay: number, animation: T): T;
|
|
21
|
+
declare function withSequence<T>(...animations: T[]): T;
|
|
22
|
+
declare function withRepeat<T>(animation: T): T;
|
|
23
|
+
declare function withDecay(config: {
|
|
24
|
+
velocity?: number;
|
|
25
|
+
deceleration?: number;
|
|
26
|
+
}): number;
|
|
27
|
+
declare function interpolate(value: number, inputRange: readonly number[], outputRange: readonly number[], _extrapolation?: 'clamp' | 'extend' | {
|
|
28
|
+
extrapolateLeft?: string;
|
|
29
|
+
extrapolateRight?: string;
|
|
30
|
+
}): number;
|
|
31
|
+
declare function interpolateColor(value: number, inputRange: readonly number[], outputRange: readonly string[]): string;
|
|
32
|
+
declare const Easing: {
|
|
33
|
+
linear: (t: number) => number;
|
|
34
|
+
ease: (t: number) => number;
|
|
35
|
+
quad: (t: number) => number;
|
|
36
|
+
cubic: (t: number) => number;
|
|
37
|
+
poly: (_n: number) => (t: number) => number;
|
|
38
|
+
sin: (t: number) => number;
|
|
39
|
+
circle: (t: number) => number;
|
|
40
|
+
exp: (t: number) => number;
|
|
41
|
+
elastic: (_bounciness?: number) => (t: number) => number;
|
|
42
|
+
back: (_s?: number) => (t: number) => number;
|
|
43
|
+
bounce: (t: number) => number;
|
|
44
|
+
bezier: () => (t: number) => number;
|
|
45
|
+
bezierFn: () => (t: number) => number;
|
|
46
|
+
in: (easing: (t: number) => number) => (t: number) => number;
|
|
47
|
+
out: (easing: (t: number) => number) => (t: number) => number;
|
|
48
|
+
inOut: (easing: (t: number) => number) => (t: number) => number;
|
|
49
|
+
};
|
|
50
|
+
declare function useAnimatedGestureHandler(): Record<string, unknown>;
|
|
51
|
+
declare function useAnimatedScrollHandler(): Record<string, unknown>;
|
|
52
|
+
declare function useAnimatedProps<T extends object>(propsWorklet: () => T): T;
|
|
53
|
+
declare function useAnimatedRef<T>(): {
|
|
54
|
+
current: T | null;
|
|
55
|
+
};
|
|
56
|
+
declare function useAnimatedReaction(): void;
|
|
57
|
+
interface MockViewProps {
|
|
58
|
+
children?: ReactNode;
|
|
59
|
+
style?: object;
|
|
60
|
+
testID?: string;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
declare function MockView({
|
|
64
|
+
children,
|
|
65
|
+
style,
|
|
66
|
+
testID,
|
|
67
|
+
...props
|
|
68
|
+
}: MockViewProps): React.ReactElement<{
|
|
69
|
+
style: object | undefined;
|
|
70
|
+
testID: string | undefined;
|
|
71
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
72
|
+
declare function MockText({
|
|
73
|
+
children,
|
|
74
|
+
style,
|
|
75
|
+
testID,
|
|
76
|
+
...props
|
|
77
|
+
}: MockViewProps): React.ReactElement<{
|
|
78
|
+
style: object | undefined;
|
|
79
|
+
testID: string | undefined;
|
|
80
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
81
|
+
declare function MockScrollView({
|
|
82
|
+
children,
|
|
83
|
+
style,
|
|
84
|
+
testID,
|
|
85
|
+
...props
|
|
86
|
+
}: MockViewProps): React.ReactElement<{
|
|
87
|
+
style: object | undefined;
|
|
88
|
+
testID: string | undefined;
|
|
89
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
90
|
+
declare function MockImage({
|
|
91
|
+
style,
|
|
92
|
+
testID,
|
|
93
|
+
...props
|
|
94
|
+
}: MockViewProps): React.DOMElement<{
|
|
95
|
+
children?: ReactNode;
|
|
96
|
+
style: object | undefined;
|
|
97
|
+
testID: string;
|
|
98
|
+
}, Element>;
|
|
99
|
+
declare function createAnimatedComponent<T extends ComponentType<object>>(Component: T): {
|
|
100
|
+
({
|
|
101
|
+
children,
|
|
102
|
+
style,
|
|
103
|
+
...props
|
|
104
|
+
}: PropsWithChildren<{
|
|
105
|
+
style?: object;
|
|
106
|
+
}>): React.JSX.Element;
|
|
107
|
+
displayName: string;
|
|
108
|
+
};
|
|
109
|
+
declare const Animated: {
|
|
110
|
+
View: typeof MockView;
|
|
111
|
+
Text: typeof MockText;
|
|
112
|
+
Image: typeof MockImage;
|
|
113
|
+
ScrollView: typeof MockScrollView;
|
|
114
|
+
createAnimatedComponent: typeof createAnimatedComponent;
|
|
115
|
+
};
|
|
116
|
+
declare const FadeIn: {
|
|
117
|
+
duration: jest.Mock<any, any, any>;
|
|
118
|
+
};
|
|
119
|
+
declare const FadeOut: {
|
|
120
|
+
duration: jest.Mock<any, any, any>;
|
|
121
|
+
};
|
|
122
|
+
declare const SlideInRight: {
|
|
123
|
+
duration: jest.Mock<any, any, any>;
|
|
124
|
+
};
|
|
125
|
+
declare const SlideOutLeft: {
|
|
126
|
+
duration: jest.Mock<any, any, any>;
|
|
127
|
+
};
|
|
128
|
+
declare const ZoomIn: {
|
|
129
|
+
duration: jest.Mock<any, any, any>;
|
|
130
|
+
};
|
|
131
|
+
declare const ZoomOut: {
|
|
132
|
+
duration: jest.Mock<any, any, any>;
|
|
133
|
+
};
|
|
134
|
+
declare function convertToRGBA(color: string | number): string;
|
|
135
|
+
declare function runOnJS<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
136
|
+
declare function runOnUI<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
137
|
+
declare function isWorklet(): boolean;
|
|
138
|
+
declare const cancelAnimation: jest.Mock<any, any, any>;
|
|
139
|
+
declare const measure: jest.Mock<{
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
pageX: number;
|
|
145
|
+
pageY: number;
|
|
146
|
+
}, [], any>;
|
|
147
|
+
declare const scrollTo: jest.Mock<any, any, any>;
|
|
148
|
+
//#endregion
|
|
149
|
+
export { Animated, Animated as default, Easing, FadeIn, FadeOut, SlideInRight, SlideOutLeft, ZoomIn, ZoomOut, cancelAnimation, convertToRGBA, createAnimatedComponent, interpolate, interpolateColor, isWorklet, measure, reanimated_d_exports, runOnJS, runOnUI, scrollTo, useAnimatedGestureHandler, useAnimatedProps, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue, withDecay, withDelay, withRepeat, withSequence, withSpring, withTiming };
|
|
150
|
+
//# sourceMappingURL=reanimated.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reanimated.d.cts","names":[],"sources":["../../../src/jest/mocks/reanimated.tsx"],"mappings":";;;;;;;iBAaS,cAAA,GAAA,CAAkB,YAAA,EAAc,CAAA;;;;;;iBAUhC,eAAA,GAAA,CAAmB,SAAA,QAAiB,CAAA;EAAM,KAAA,EAAO,CAAA;AAAA;AAAA,iBASjD,gBAAA,kBAAA,CAAmC,YAAA,QAAoB,CAAA,GAAI,CAAA;AAAA,iBAS3D,UAAA,GAAA,CAAc,OAAA,EAAS,CAAA,GAAI,CAAA;AAAA,iBAI3B,UAAA,GAAA,CAAc,OAAA,EAAS,CAAA,GAAI,CAAA;AAAA,iBAI3B,SAAA,GAAA,CAAa,MAAA,UAAgB,SAAA,EAAW,CAAA,GAAI,CAAA;AAAA,iBAI5C,YAAA,GAAA,CAAA,GAAmB,UAAA,EAAY,CAAA,KAAM,CAAA;AAAA,iBAIrC,UAAA,GAAA,CAAc,SAAA,EAAW,CAAA,GAAI,CAAA;AAAA,iBAI7B,SAAA,CAAU,MAAA;EAAU,QAAA;EAAmB,YAAA;AAAA;AAAA,iBAKvC,WAAA,CACP,KAAA,UACA,UAAA,qBACA,WAAA,qBACA,cAAA;EAAwC,eAAA;EAA0B,gBAAA;AAAA;AAAA,iBAqB3D,gBAAA,CACP,KAAA,UACA,UAAA,qBACA,WAAA;AAAA,cAiBI,MAAA;;;;;yBAKmB,CAAA;;;;sCAIa,CAAA;0BACZ,CAAA;;iBAET,CAAA;mBACE,CAAA;gBACH,CAAA,yBAAoB,CAAA;iBACnB,CAAA,yBAAoB,CAAA;mBAClB,CAAA,yBAAoB,CAAA;AAAA;AAAA,iBAI9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AAAA,iBAG/C,aAAA,CAAc,KAAA;AAAA,iBAQd,OAAA,eAAsB,IAAA,wBAAA,CAA6B,EAAA,EAAI,CAAA,GAAI,CAAA;AAAA,iBAI3D,OAAA,eAAsB,IAAA,wBAAA,CAA6B,EAAA,EAAI,CAAA,GAAI,CAAA;AAAA,iBAK3D,SAAA,CAAA;AAAA,cAKH,eAAA,EAAe,IAAA,CAAA,IAAA;AAAA,cAGf,OAAA,EAAO,IAAA,CAAA,IAAA;;;;;;;;cAUP,QAAA,EAAQ,IAAA,CAAA,IAAA"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
|
|
2
|
+
import React, { ComponentType, PropsWithChildren, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/jest/mocks/reanimated.d.ts
|
|
5
|
+
declare namespace reanimated_d_exports {
|
|
6
|
+
export { Animated, Easing, FadeIn, FadeOut, SlideInRight, SlideOutLeft, ZoomIn, ZoomOut, cancelAnimation, convertToRGBA, createAnimatedComponent, Animated as default, interpolate, interpolateColor, isWorklet, measure, runOnJS, runOnUI, scrollTo, useAnimatedGestureHandler, useAnimatedProps, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue, withDecay, withDelay, withRepeat, withSequence, withSpring, withTiming };
|
|
7
|
+
}
|
|
8
|
+
declare function useSharedValue<T>(initialValue: T): {
|
|
9
|
+
value: T;
|
|
10
|
+
addListener: jest.Mock<any, any, any>;
|
|
11
|
+
removeListener: jest.Mock<any, any, any>;
|
|
12
|
+
modify: jest.Mock<any, any, any>;
|
|
13
|
+
};
|
|
14
|
+
declare function useDerivedValue<T>(derivedFn: () => T): {
|
|
15
|
+
value: T;
|
|
16
|
+
};
|
|
17
|
+
declare function useAnimatedStyle<T extends object>(styleWorklet: () => T): T;
|
|
18
|
+
declare function withTiming<T>(toValue: T): T;
|
|
19
|
+
declare function withSpring<T>(toValue: T): T;
|
|
20
|
+
declare function withDelay<T>(_delay: number, animation: T): T;
|
|
21
|
+
declare function withSequence<T>(...animations: T[]): T;
|
|
22
|
+
declare function withRepeat<T>(animation: T): T;
|
|
23
|
+
declare function withDecay(config: {
|
|
24
|
+
velocity?: number;
|
|
25
|
+
deceleration?: number;
|
|
26
|
+
}): number;
|
|
27
|
+
declare function interpolate(value: number, inputRange: readonly number[], outputRange: readonly number[], _extrapolation?: 'clamp' | 'extend' | {
|
|
28
|
+
extrapolateLeft?: string;
|
|
29
|
+
extrapolateRight?: string;
|
|
30
|
+
}): number;
|
|
31
|
+
declare function interpolateColor(value: number, inputRange: readonly number[], outputRange: readonly string[]): string;
|
|
32
|
+
declare const Easing: {
|
|
33
|
+
linear: (t: number) => number;
|
|
34
|
+
ease: (t: number) => number;
|
|
35
|
+
quad: (t: number) => number;
|
|
36
|
+
cubic: (t: number) => number;
|
|
37
|
+
poly: (_n: number) => (t: number) => number;
|
|
38
|
+
sin: (t: number) => number;
|
|
39
|
+
circle: (t: number) => number;
|
|
40
|
+
exp: (t: number) => number;
|
|
41
|
+
elastic: (_bounciness?: number) => (t: number) => number;
|
|
42
|
+
back: (_s?: number) => (t: number) => number;
|
|
43
|
+
bounce: (t: number) => number;
|
|
44
|
+
bezier: () => (t: number) => number;
|
|
45
|
+
bezierFn: () => (t: number) => number;
|
|
46
|
+
in: (easing: (t: number) => number) => (t: number) => number;
|
|
47
|
+
out: (easing: (t: number) => number) => (t: number) => number;
|
|
48
|
+
inOut: (easing: (t: number) => number) => (t: number) => number;
|
|
49
|
+
};
|
|
50
|
+
declare function useAnimatedGestureHandler(): Record<string, unknown>;
|
|
51
|
+
declare function useAnimatedScrollHandler(): Record<string, unknown>;
|
|
52
|
+
declare function useAnimatedProps<T extends object>(propsWorklet: () => T): T;
|
|
53
|
+
declare function useAnimatedRef<T>(): {
|
|
54
|
+
current: T | null;
|
|
55
|
+
};
|
|
56
|
+
declare function useAnimatedReaction(): void;
|
|
57
|
+
interface MockViewProps {
|
|
58
|
+
children?: ReactNode;
|
|
59
|
+
style?: object;
|
|
60
|
+
testID?: string;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
declare function MockView({
|
|
64
|
+
children,
|
|
65
|
+
style,
|
|
66
|
+
testID,
|
|
67
|
+
...props
|
|
68
|
+
}: MockViewProps): React.ReactElement<{
|
|
69
|
+
style: object | undefined;
|
|
70
|
+
testID: string | undefined;
|
|
71
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
72
|
+
declare function MockText({
|
|
73
|
+
children,
|
|
74
|
+
style,
|
|
75
|
+
testID,
|
|
76
|
+
...props
|
|
77
|
+
}: MockViewProps): React.ReactElement<{
|
|
78
|
+
style: object | undefined;
|
|
79
|
+
testID: string | undefined;
|
|
80
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
81
|
+
declare function MockScrollView({
|
|
82
|
+
children,
|
|
83
|
+
style,
|
|
84
|
+
testID,
|
|
85
|
+
...props
|
|
86
|
+
}: MockViewProps): React.ReactElement<{
|
|
87
|
+
style: object | undefined;
|
|
88
|
+
testID: string | undefined;
|
|
89
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
90
|
+
declare function MockImage({
|
|
91
|
+
style,
|
|
92
|
+
testID,
|
|
93
|
+
...props
|
|
94
|
+
}: MockViewProps): React.DOMElement<{
|
|
95
|
+
children?: ReactNode;
|
|
96
|
+
style: object | undefined;
|
|
97
|
+
testID: string;
|
|
98
|
+
}, Element>;
|
|
99
|
+
declare function createAnimatedComponent<T extends ComponentType<object>>(Component: T): {
|
|
100
|
+
({
|
|
101
|
+
children,
|
|
102
|
+
style,
|
|
103
|
+
...props
|
|
104
|
+
}: PropsWithChildren<{
|
|
105
|
+
style?: object;
|
|
106
|
+
}>): React.JSX.Element;
|
|
107
|
+
displayName: string;
|
|
108
|
+
};
|
|
109
|
+
declare const Animated: {
|
|
110
|
+
View: typeof MockView;
|
|
111
|
+
Text: typeof MockText;
|
|
112
|
+
Image: typeof MockImage;
|
|
113
|
+
ScrollView: typeof MockScrollView;
|
|
114
|
+
createAnimatedComponent: typeof createAnimatedComponent;
|
|
115
|
+
};
|
|
116
|
+
declare const FadeIn: {
|
|
117
|
+
duration: jest.Mock<any, any, any>;
|
|
118
|
+
};
|
|
119
|
+
declare const FadeOut: {
|
|
120
|
+
duration: jest.Mock<any, any, any>;
|
|
121
|
+
};
|
|
122
|
+
declare const SlideInRight: {
|
|
123
|
+
duration: jest.Mock<any, any, any>;
|
|
124
|
+
};
|
|
125
|
+
declare const SlideOutLeft: {
|
|
126
|
+
duration: jest.Mock<any, any, any>;
|
|
127
|
+
};
|
|
128
|
+
declare const ZoomIn: {
|
|
129
|
+
duration: jest.Mock<any, any, any>;
|
|
130
|
+
};
|
|
131
|
+
declare const ZoomOut: {
|
|
132
|
+
duration: jest.Mock<any, any, any>;
|
|
133
|
+
};
|
|
134
|
+
declare function convertToRGBA(color: string | number): string;
|
|
135
|
+
declare function runOnJS<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
136
|
+
declare function runOnUI<T extends (...args: unknown[]) => unknown>(fn: T): T;
|
|
137
|
+
declare function isWorklet(): boolean;
|
|
138
|
+
declare const cancelAnimation: jest.Mock<any, any, any>;
|
|
139
|
+
declare const measure: jest.Mock<{
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
pageX: number;
|
|
145
|
+
pageY: number;
|
|
146
|
+
}, [], any>;
|
|
147
|
+
declare const scrollTo: jest.Mock<any, any, any>;
|
|
148
|
+
//#endregion
|
|
149
|
+
export { Animated, Animated as default, Easing, FadeIn, FadeOut, SlideInRight, SlideOutLeft, ZoomIn, ZoomOut, cancelAnimation, convertToRGBA, createAnimatedComponent, interpolate, interpolateColor, isWorklet, measure, reanimated_d_exports, runOnJS, runOnUI, scrollTo, useAnimatedGestureHandler, useAnimatedProps, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue, withDecay, withDelay, withRepeat, withSequence, withSpring, withTiming };
|
|
150
|
+
//# sourceMappingURL=reanimated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reanimated.d.ts","names":[],"sources":["../../../src/jest/mocks/reanimated.tsx"],"mappings":";;;;;;;iBAaS,cAAA,GAAA,CAAkB,YAAA,EAAc,CAAA;;;;;;iBAUhC,eAAA,GAAA,CAAmB,SAAA,QAAiB,CAAA;EAAM,KAAA,EAAO,CAAA;AAAA;AAAA,iBASjD,gBAAA,kBAAA,CAAmC,YAAA,QAAoB,CAAA,GAAI,CAAA;AAAA,iBAS3D,UAAA,GAAA,CAAc,OAAA,EAAS,CAAA,GAAI,CAAA;AAAA,iBAI3B,UAAA,GAAA,CAAc,OAAA,EAAS,CAAA,GAAI,CAAA;AAAA,iBAI3B,SAAA,GAAA,CAAa,MAAA,UAAgB,SAAA,EAAW,CAAA,GAAI,CAAA;AAAA,iBAI5C,YAAA,GAAA,CAAA,GAAmB,UAAA,EAAY,CAAA,KAAM,CAAA;AAAA,iBAIrC,UAAA,GAAA,CAAc,SAAA,EAAW,CAAA,GAAI,CAAA;AAAA,iBAI7B,SAAA,CAAU,MAAA;EAAU,QAAA;EAAmB,YAAA;AAAA;AAAA,iBAKvC,WAAA,CACP,KAAA,UACA,UAAA,qBACA,WAAA,qBACA,cAAA;EAAwC,eAAA;EAA0B,gBAAA;AAAA;AAAA,iBAqB3D,gBAAA,CACP,KAAA,UACA,UAAA,qBACA,WAAA;AAAA,cAiBI,MAAA;;;;;yBAKmB,CAAA;;;;sCAIa,CAAA;0BACZ,CAAA;;iBAET,CAAA;mBACE,CAAA;gBACH,CAAA,yBAAoB,CAAA;iBACnB,CAAA,yBAAoB,CAAA;mBAClB,CAAA,yBAAoB,CAAA;AAAA;AAAA,iBAI9B,yBAAA,CAAA,GAA6B,MAAA;AAAA,iBAI7B,wBAAA,CAAA,GAA4B,MAAA;AAAA,iBAK5B,gBAAA,kBAAA,CAAmC,YAAA,Q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