Skip to content

Commit

Permalink
feat: 代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Jan 16, 2024
1 parent 1d2b986 commit 2c2cc0f
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 387 deletions.
106 changes: 0 additions & 106 deletions src/hooks/useReact.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/layer/config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +0,0 @@
import type { EventMapping } from './types';

export const eventMapping: EventMapping = {
onClick: 'click',
onDoubleClick: 'dblclick',
onContextMenu: 'contextmenu',

onMouseDown: 'mousedown',
onMouseUp: 'mouseup',
onMouseMove: 'mousemove',
onMouseEnter: 'mouseenter',
onMouseLeave: 'mouseleave',
onMouseOver: 'mouseover',
onMouseOut: 'mouseout',

onTouchStart: 'touchstart',
onTouchEnd: 'touchend',
onTouchCancel: 'touchcancel',
};
21 changes: 21 additions & 0 deletions src/layer/constant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { EventMapping, KeysOfUnion } from './types';

export const LayerEventMap: EventMapping = {
onClick: 'click',
onDoubleClick: 'dblclick',
onContextMenu: 'contextmenu',

onMouseDown: 'mousedown',
onMouseUp: 'mouseup',
onMouseMove: 'mousemove',
onMouseEnter: 'mouseenter',
onMouseLeave: 'mouseleave',
onMouseOver: 'mouseover',
onMouseOut: 'mouseout',

onTouchStart: 'touchstart',
onTouchEnd: 'touchend',
onTouchCancel: 'touchcancel',
};

export const LayerEventList = Object.keys(LayerEventMap) as KeysOfUnion<EventMapping>[];
85 changes: 0 additions & 85 deletions src/layer/demos/basic.tsx

This file was deleted.

94 changes: 0 additions & 94 deletions src/layer/hooks/useEvents.ts

This file was deleted.

60 changes: 0 additions & 60 deletions src/layer/index.md

This file was deleted.

Loading

0 comments on commit 2c2cc0f

Please sign in to comment.