1 | import type { DependencyList, NativeEventWrapper, ReanimatedEvent } from './commonTypes';
|
2 | declare const EVENT_TYPE: {
|
3 | readonly UNDETERMINED: 0;
|
4 | readonly FAILED: 1;
|
5 | readonly BEGAN: 2;
|
6 | readonly CANCELLED: 3;
|
7 | readonly ACTIVE: 4;
|
8 | readonly END: 5;
|
9 | };
|
10 | type StateType = (typeof EVENT_TYPE)[keyof typeof EVENT_TYPE];
|
11 | type DefaultEvent = {
|
12 | nativeEvent: {
|
13 | readonly handlerTag: number;
|
14 | readonly numberOfPointers: number;
|
15 | readonly state: (typeof EVENT_TYPE)[keyof typeof EVENT_TYPE];
|
16 | readonly x: number;
|
17 | readonly y: number;
|
18 | readonly absoluteX: number;
|
19 | readonly absoluteY: number;
|
20 | readonly translationX: number;
|
21 | readonly translationY: number;
|
22 | readonly velocityX: number;
|
23 | readonly velocityY: number;
|
24 | };
|
25 | };
|
26 | interface PropsUsedInUseAnimatedGestureHandler {
|
27 | handlerTag?: number;
|
28 | numberOfPointers?: number;
|
29 | state?: StateType;
|
30 | oldState?: StateType;
|
31 | }
|
32 | export type GestureHandlerEvent<Event extends object> = ReanimatedEvent<Event> | Event;
|
33 | type GestureHandler<Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler>, Context extends Record<string, unknown>> = (eventPayload: ReanimatedEvent<Event>, context: Context, isCanceledOrFailed?: boolean) => void;
|
34 | export interface GestureHandlers<Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler>, Context extends Record<string, unknown>> {
|
35 | [key: string]: GestureHandler<Event, Context> | undefined;
|
36 | onStart?: GestureHandler<Event, Context>;
|
37 | onActive?: GestureHandler<Event, Context>;
|
38 | onEnd?: GestureHandler<Event, Context>;
|
39 | onFail?: GestureHandler<Event, Context>;
|
40 | onCancel?: GestureHandler<Event, Context>;
|
41 | onFinish?: GestureHandler<Event, Context>;
|
42 | }
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | export declare function useAnimatedGestureHandler<Event extends NativeEventWrapper<PropsUsedInUseAnimatedGestureHandler> = DefaultEvent, Context extends Record<string, unknown> = Record<string, unknown>>(handlers: GestureHandlers<Event, Context>, dependencies?: DependencyList): (e: Event) => void;
|
52 | export {};
|
53 |
|
\ | No newline at end of file |