import { ReactNode } from 'react'; type ExtractArgs = T[keyof T] extends (...args: infer A) => any ? A : any[]; type EventState> = T & { (key?: keyof T, fun?: T[keyof T]): EventState; (target?: Partial): EventState; }; type Vec2 = [x: number, y: number]; type DragDevice = 'mouse' | 'touch' | 'pointer'; interface DragState { _active: boolean; active: boolean; device: DragDevice; _value: Vec2; value: Vec2; delta: Vec2; offset: Vec2; movement: Vec2; target: El; event: Event; memo: any; isDragStart: boolean; isDragging: boolean; isDragEnd: boolean; drag(self: DragState): void; dragStart(e: Event): void; dragging(e: Event): void; dragEnd(e: Event): void; mount(target: El): void; clean(el: null): void; ref(traget: El | null): void; } type DragArg = Partial> | DragState['drag']; declare const useDrag: (arg: DragArg) => EventState>; interface DragProps extends Partial> { children(self: DragState): ReactNode; } declare const Drag: (props: DragProps) => ReactNode; interface HoverState { _active: boolean; active: boolean; device: 'mouse' | 'pointer' | 'touch'; _value: Vec2; value: Vec2; delta: Vec2; offset: Vec2; movement: Vec2; event: Event; target: El; isHoverStart: boolean; isHovering: boolean; isHoverEnd: boolean; hover: (self: HoverState) => void; hoverStart(e: Event): void; hovering(e: Event): void; hoverEnd(e: Event): void; mount(target: El): void; clean(target?: El): void; ref(target: El | null): void; } type HoverArg = Partial> | HoverState['hover']; declare const useHover: (arg?: HoverArg) => EventState>; interface HoverProps extends Partial> { children: (state: HoverState) => ReactNode; } declare const Hover: (props: HoverProps) => ReactNode; interface KeyState { target: El | Window; pressedKey: string; code: string; event: KeyboardEvent; key(e: KeyState): void; keydown(e: KeyboardEvent): void; mount(el: El): void; clean(el: null): void; ref(el: Element | null): void; } type KeyArg = Partial> | KeyState['key']; declare const useKey: (arg: KeyArg) => EventState>; interface KeyProps extends Partial> { children: (state: KeyState) => ReactNode; } declare const Key: (props: KeyProps) => ReactNode; type PinchDevice = 'mouse' | 'pointer' | 'touch' | 'wheel' | 'gesture'; interface PinchState { device: PinchDevice; active: boolean; _active: boolean; value: Vec2; _value: Vec2; delta: Vec2; offset: Vec2; movement: Vec2; initial: Vec2; origin: Vec2; _touchIds: number[]; _pointerEvents: Map; scale: number; turns: number; target: El; event: Event | null; memo: Record; timeout: number; clearTimeout: () => void; isPinchStart: boolean; isPinching: boolean; isPinchEnd: boolean; pinch: (self: PinchState) => void; pinchStart: (e: Event) => void; pinching: (e: Event) => void; pinchEnd: (e: Event) => void; mount: (target: El) => void; clean: () => void; ref: (el: El | null) => void; } type PinchArg = Partial> | PinchState['pinch']; declare const usePinch: (arg?: PinchArg) => EventState>; interface PinchProps extends Partial> { children: (state: PinchState) => ReactNode; } declare const Pinch: (props: PinchProps) => ReactNode; interface ResizeState { observer: ResizeObserver | null; listener(): void; mount(el: El): void; clean(el: null): void; resize(self: ResizeState): void; ref(target: El): void; } type ResizeArg = Partial> | ResizeState['resize']; declare const useResize: (arg: ResizeArg) => EventState>; interface ResizeProps extends Partial> { children: (state: ResizeState) => ReactNode; } declare const Resize: (props: ResizeProps) => ReactNode; interface ScrollState { _active: boolean; active: boolean; _value: Vec2; value: Vec2; delta: Vec2; offset: Vec2; movement: Vec2; target: El; event: Event; memo: any; isScrollStart: boolean; isScrolling: boolean; isScrollEnd: boolean; timeout: number; clearTimeout(): void; scroll(self: ScrollState): void; scrollStart(e: Event): void; scrolling(e: Event): void; scrollEnd(e: Event): void; mount(target: El): void; clean(target: null): void; ref(traget: El | null): void; tick?: () => void; } type ScrollConfig = Partial> | ScrollState['scroll']; declare const useScroll: (config: ScrollConfig) => EventState>; interface ScrollProps extends Partial> { children: (state: ScrollState) => ReactNode; } declare const Scroll: (props: ScrollProps) => ReactNode; interface WheelState { _active: boolean; active: boolean; _value: Vec2; value: Vec2; delta: Vec2; offset: Vec2; movement: Vec2; target: El; event: Event; timeout: number; clearTimeout(): void; memo: any; isWheelStart: boolean; isWheeling: boolean; isWheelEnd: boolean; wheel(self: WheelState): void; wheelStart(e: Event): void; wheeling(e: Event): void; wheelEnd(e: Event): void; mount(target: El): void; clean(target: null): void; ref(traget: El | null): void; tick?: () => void; } type WheelConfig = Partial> | WheelState['wheel']; declare const useWheel: (config: WheelConfig) => EventState>; interface WheelProps extends Partial> { children: (state: WheelState) => ReactNode; } declare const Wheel: (props: WheelProps) => ReactNode; export { Drag, type DragProps, Hover, type HoverProps, Key, type KeyProps, Pinch, type PinchProps, Resize, type ResizeProps, Scroll, type ScrollProps, Wheel, type WheelProps, useDrag, useHover, useKey, usePinch, useResize, useScroll, useWheel };