import type { CodegenTypes, HostComponent, ViewProps } from 'react-native'; import { codegenNativeComponent } from 'react-native'; type GestureHandlerEvent = Readonly<{ handlerTag: CodegenTypes.Int32; state: CodegenTypes.Int32; handlerData: CodegenTypes.UnsafeMixed; }>; type GestureHandlerStateChangeEvent = Readonly<{ handlerTag: CodegenTypes.Int32; state: CodegenTypes.Int32; oldState: CodegenTypes.Int32; handlerData: CodegenTypes.UnsafeMixed; }>; type GestureHandlerTouchEvent = Readonly<{ handlerTag: CodegenTypes.Int32; numberOfTouches: CodegenTypes.Int32; state: CodegenTypes.Int32; eventType: CodegenTypes.Int32; allTouches: { id: CodegenTypes.Int32; x: CodegenTypes.Double; y: CodegenTypes.Double; absoluteX: CodegenTypes.Double; absoluteY: CodegenTypes.Double; }[]; changedTouches: { id: CodegenTypes.Int32; x: CodegenTypes.Double; y: CodegenTypes.Double; absoluteX: CodegenTypes.Double; absoluteY: CodegenTypes.Double; }[]; pointerType: CodegenTypes.Int32; }>; export interface VirtualChildrenProps { handlerTags: CodegenTypes.Int32[]; viewTag: CodegenTypes.Int32; } // @ts-expect-error WithDefault adds `| null` to the type, which doesn't align with ViewProps.pointerEvents // Using Exclude to remove null from the type makes the error go away, but breaks codegen. export interface NativeProps extends ViewProps { onGestureHandlerEvent?: | CodegenTypes.DirectEventHandler | undefined; onGestureHandlerStateChange?: | CodegenTypes.DirectEventHandler | undefined; onGestureHandlerTouchEvent?: | CodegenTypes.DirectEventHandler | undefined; onGestureHandlerReanimatedEvent?: | CodegenTypes.DirectEventHandler | undefined; onGestureHandlerReanimatedStateChange?: | CodegenTypes.DirectEventHandler | undefined; onGestureHandlerReanimatedTouchEvent?: | CodegenTypes.DirectEventHandler | undefined; onGestureHandlerAnimatedEvent?: | CodegenTypes.DirectEventHandler | undefined; handlerTags: CodegenTypes.Int32[]; moduleId?: CodegenTypes.WithDefault; virtualChildren: VirtualChildrenProps[]; pointerEvents?: CodegenTypes.WithDefault< 'box-none' | 'none' | 'box-only' | 'auto', 'auto' >; } export default codegenNativeComponent('RNGestureHandlerDetector', { interfaceOnly: true, }) as HostComponent;