source: imaps-frontend/node_modules/@use-gesture/core/src/actions.ts

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.8 KB
Line 
1import { GestureKey, EngineClass, Action } from './types'
2import { ResolverMap } from './config/resolver'
3
4import { DragEngine } from './engines/DragEngine'
5import { dragConfigResolver } from './config/dragConfigResolver'
6
7import { PinchEngine } from './engines/PinchEngine'
8import { pinchConfigResolver } from './config/pinchConfigResolver'
9
10import { MoveEngine } from './engines/MoveEngine'
11import { moveConfigResolver } from './config/moveConfigResolver'
12
13import { ScrollEngine } from './engines/ScrollEngine'
14import { scrollConfigResolver } from './config/scrollConfigResolver'
15
16import { WheelEngine } from './engines/WheelEngine'
17import { wheelConfigResolver } from './config/wheelConfigResolver'
18
19import { HoverEngine } from './engines/HoverEngine'
20import { hoverConfigResolver } from './config/hoverConfigResolver'
21
22export const EngineMap = new Map<GestureKey, EngineClass<any>>()
23export const ConfigResolverMap = new Map<GestureKey, ResolverMap>()
24
25export function registerAction(action: Action) {
26 EngineMap.set(action.key, action.engine)
27 ConfigResolverMap.set(action.key, action.resolver)
28}
29
30export const dragAction: Action = {
31 key: 'drag',
32 engine: DragEngine as any,
33 resolver: dragConfigResolver
34}
35
36export const hoverAction: Action = {
37 key: 'hover',
38 engine: HoverEngine as any,
39 resolver: hoverConfigResolver
40}
41
42export const moveAction: Action = {
43 key: 'move',
44 engine: MoveEngine as any,
45 resolver: moveConfigResolver
46}
47
48export const pinchAction: Action = {
49 key: 'pinch',
50 engine: PinchEngine as any,
51 resolver: pinchConfigResolver
52}
53
54export const scrollAction: Action = {
55 key: 'scroll',
56 engine: ScrollEngine as any,
57 resolver: scrollConfigResolver
58}
59
60export const wheelAction: Action = {
61 key: 'wheel',
62 engine: WheelEngine as any,
63 resolver: wheelConfigResolver
64}
Note: See TracBrowser for help on using the repository browser.