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 f490ca6 commit cba26fd
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 121 deletions.
3 changes: 1 addition & 2 deletions src/map/constant.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import type { EventMapping } from './types';
import type { KeysOfUnion } from '../types';
import type { EventMapping, KeysOfUnion } from './types';

export const defaultContainerStyle: React.CSSProperties = {
width: '100%',
Expand Down
13 changes: 0 additions & 13 deletions src/map/demos/basic.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions src/map/demos/globe.tsx

This file was deleted.

58 changes: 0 additions & 58 deletions src/map/hooks/useMapEvent.ts

This file was deleted.

6 changes: 4 additions & 2 deletions src/map/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import type { MapboxOptions, MapEventType } from 'mapbox-gl';
import type { KeysOfUnion } from '../types';

export interface MapOptions extends MapboxOptions {}
export type { KeysOfUnion } from '../types';

export type MapEvents = {
onError: (e: MapEventType['error']) => void;
Expand Down Expand Up @@ -74,7 +74,7 @@ export type EventMapping = { [T in keyof MapEvents]: string };

export type MapboxOptionKeys = KeysOfUnion<MapboxOptions>;

export interface MapProps extends Omit<MapOptions, 'container'>, Partial<MapEvents> {
export interface MapProps extends Omit<MapboxOptions, 'container'>, Partial<MapEvents> {
/** 地图加载前的加载效果 */
loading?: React.ReactNode;
/** 额外的样式类 */
Expand All @@ -83,3 +83,5 @@ export interface MapProps extends Omit<MapOptions, 'container'>, Partial<MapEven
containerStyle?: React.CSSProperties;
children?: React.ReactNode;
}

export type PropKey = KeysOfUnion<MapProps>;
22 changes: 0 additions & 22 deletions src/marker/demos/basic.tsx

This file was deleted.

0 comments on commit cba26fd

Please sign in to comment.