tg-map-vue3 3.8.9 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +8 -12
  2. package/dist/src/components/TgMap.vue.d.ts +33 -33
  3. package/dist/src/components/controls/TgCustomControl.vue.d.ts +1 -1
  4. package/dist/src/components/controls/TgMapTypeControl.vue.d.ts +6 -6
  5. package/dist/src/components/controls/TgScaleControl.vue.d.ts +3 -3
  6. package/dist/src/components/controls/TgStreetViewControl.vue.d.ts +3 -3
  7. package/dist/src/components/controls/TgZoomControl.vue.d.ts +3 -3
  8. package/dist/src/components/extra/TgHeatmap.vue.d.ts +2 -2
  9. package/dist/src/components/extra/TgMarkerClusterer.vue.d.ts +2 -2
  10. package/dist/src/components/index.d.ts +3 -5
  11. package/dist/src/components/overlays/TgCircle.vue.d.ts +12 -12
  12. package/dist/src/components/overlays/TgElementOverlay.vue.d.ts +4 -4
  13. package/dist/src/components/overlays/TgMarker.vue.d.ts +21 -21
  14. package/dist/src/components/overlays/TgPolygon.vue.d.ts +9 -9
  15. package/dist/src/components/overlays/TgPolyline.vue.d.ts +9 -9
  16. package/dist/src/components/overlays/TgRectangle.vue.d.ts +9 -9
  17. package/dist/src/map/lat-lng.d.ts +0 -3
  18. package/dist/src/map/map/controls/control.d.ts +0 -2
  19. package/dist/src/map/map/controls/map-type.control.d.ts +0 -1
  20. package/dist/src/map/map/controls/zoom.control.d.ts +0 -1
  21. package/dist/src/map/map/extra/autocomplete.d.ts +0 -1
  22. package/dist/src/map/map/extra/heatmap.d.ts +0 -1
  23. package/dist/src/map/map/extra/places-service.d.ts +0 -2
  24. package/dist/src/map/map/google-map.d.ts +0 -1
  25. package/dist/src/map/map/here-map.d.ts +0 -1
  26. package/dist/src/map/map/map-options.d.ts +0 -2
  27. package/dist/src/map/map/map-type.d.ts +0 -3
  28. package/dist/src/map/map/overlay/baidu-info-box.d.ts +1 -2
  29. package/dist/src/map/map/overlay/circle.d.ts +0 -2
  30. package/dist/src/map/map/overlay/element-overlay.d.ts +0 -2
  31. package/dist/src/map/map/overlay/google-label.d.ts +11 -12
  32. package/dist/src/map/map/overlay/icon.d.ts +0 -2
  33. package/dist/src/map/map/overlay/info-window.d.ts +0 -1
  34. package/dist/src/map/map/overlay/label.d.ts +0 -1
  35. package/dist/src/map/map/overlay/marker.d.ts +0 -1
  36. package/dist/src/map/map/overlay/polygon.d.ts +0 -2
  37. package/dist/src/map/map/overlay/polyline.d.ts +0 -3
  38. package/dist/src/map/map/overlay/rectangle.d.ts +0 -2
  39. package/dist/src/map/unions.d.ts +0 -5
  40. package/dist/src/utils/arrays.d.ts +1 -13
  41. package/dist/src/utils/google-utils.d.ts +0 -1
  42. package/dist/src/utils/mapped-types.d.ts +0 -7
  43. package/dist/src/utils/strings.d.ts +0 -5
  44. package/dist/src/utils/utils.d.ts +1 -8
  45. package/dist/tg-map.js +1468 -1289
  46. package/dist/tg-map.js.map +1 -1
  47. package/dist/tg-map.umd.cjs +7 -7
  48. package/dist/tg-map.umd.cjs.map +1 -1
  49. package/package.json +10 -5
  50. package/dist/src/utils/assert.d.ts +0 -9
@@ -1,4 +1,3 @@
1
- /// <reference types="google.maps" />
2
1
  import type { EventCallback, LatLngBounds } from '../../../components';
3
2
  import { type AddressFields } from '../../../utils/google-utils';
4
3
  import { type RemoveEventListenerFunction } from '../../event-target';
@@ -1,4 +1,3 @@
1
- /// <reference types="google.maps" />
2
1
  import BHeatMapOverlay from 'bmaplib.heatmap';
3
2
  import type { LatLng, WeightedLatLng } from '../../lat-lng';
4
3
  import type { BaiduMap } from '../baidu-map';
@@ -1,5 +1,3 @@
1
- /// <reference types="google.maps" />
2
- /// <reference types="baidumap-web-sdk" />
3
1
  import { LatLng, LatLngBounds, Location, type AbstractMap } from '../../../components';
4
2
  import type { UnionPlacesService } from '../../unions';
5
3
  import type { BaiduMap } from '../baidu-map';
@@ -1,4 +1,3 @@
1
- /// <reference types="google.maps" />
2
1
  import { LatLng, LatLngBounds } from '../lat-lng';
3
2
  import { Point, type Padding } from '../types';
4
3
  import { CustomControl } from './controls/control';
@@ -1,4 +1,3 @@
1
- /// <reference types="heremaps" />
2
1
  import { CoordType, LatLng, LatLngBounds } from '../lat-lng';
3
2
  import type { Padding, Point } from '../types';
4
3
  import type { CustomControl } from './controls/control';
@@ -1,5 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="google.maps" />
3
1
  import { LatLng } from '../lat-lng';
4
2
  import type { BuildInMapTypeId } from './map-type';
5
3
  export declare const InfoWindowModeValues: readonly ["single", "multi"];
@@ -1,6 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="baidumap-web-sdk" />
3
- /// <reference types="google.maps" />
4
1
  import { FastFindValues } from '../../utils/values';
5
2
  import { CoordType } from '../lat-lng';
6
3
  import type { Point } from '../types';
@@ -1,4 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
1
  import { Point } from '../../types';
3
2
  import './baidu-info-box.scss';
4
3
  import type { BMarker } from './marker';
@@ -14,7 +13,7 @@ export declare function createBaiduInfoBox(content: HTMLElement, position?: BMap
14
13
  offset: Point;
15
14
  initialize(map: BMap.Map): HTMLElement;
16
15
  draw(): void;
17
- open(map: BMap.Map, anchor?: BMarker | undefined): void;
16
+ open(map: BMap.Map, anchor?: BMarker): void;
18
17
  attachMarker(marker: BMarker): void;
19
18
  detachMarker(marker: BMarker): void;
20
19
  close(): void;
@@ -1,5 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="google.maps" />
3
1
  import type { Tg } from '../../event';
4
2
  import { EventHubEventTargetDelegate } from '../../event-target';
5
3
  import { LatLng } from '../../lat-lng';
@@ -1,5 +1,3 @@
1
- /// <reference types="google.maps" />
2
- /// <reference types="baidumap-web-sdk" />
3
1
  import { LatLng } from '../../lat-lng';
4
2
  import { Point } from '../../types';
5
3
  import type { AbstractMap } from '../map';
@@ -1,5 +1,4 @@
1
- /// <reference types="google.maps" />
2
- import { type Nullable } from '../../../components';
1
+ import { type Nullable } from 'tg-commons';
3
2
  import type { Point } from '../../types';
4
3
  import { MapPane } from './element-overlay';
5
4
  export type GoogleLabel = InstanceType<ReturnType<typeof createGoogleLabelClass>>;
@@ -19,25 +18,25 @@ export declare function createGoogleLabel(element: HTMLElement, position: Nullab
19
18
  getOffset(): Point | undefined;
20
19
  getVisible(): boolean;
21
20
  setVisible(visible: boolean): void;
22
- getMap(): google.maps.Map | google.maps.StreetViewPanorama | null;
21
+ getMap(): google.maps.Map | null | google.maps.StreetViewPanorama;
23
22
  getPanes(): google.maps.MapPanes | null;
24
23
  getProjection(): google.maps.MapCanvasProjection;
25
- setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void;
24
+ setMap(map: google.maps.Map | null | google.maps.StreetViewPanorama): void;
26
25
  addListener(eventName: string, handler: Function): google.maps.MapsEventListener;
27
- bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null | undefined, noNotify?: boolean | undefined): void;
26
+ bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null, noNotify?: boolean): void;
28
27
  get(key: string): any;
29
28
  notify(key: string): void;
30
29
  set(key: string, value: any): void;
31
- setValues(values?: object | null | undefined): void;
30
+ setValues(values?: object | null): void;
32
31
  unbind(key: string): void;
33
32
  unbindAll(): void;
34
33
  };
35
34
  /** 打开页面时 google.maps.OverlayView 并没有加载, 故需要将GoogleLabel类写到方法中去 */
36
35
  declare function createGoogleLabelClass(): {
37
- new (element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point, _mapPane?: MapPane, zIndex?: number): {
36
+ new (element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point | undefined, _mapPane?: MapPane, zIndex?: number): {
38
37
  container: HTMLElement;
39
38
  position: Nullable<google.maps.LatLng>;
40
- offset?: Point;
39
+ offset?: Point | undefined;
41
40
  _mapPane: MapPane;
42
41
  setZIndex(zIndex: number): void;
43
42
  setElement(element: HTMLElement): void;
@@ -50,16 +49,16 @@ declare function createGoogleLabelClass(): {
50
49
  getOffset(): Point | undefined;
51
50
  getVisible(): boolean;
52
51
  setVisible(visible: boolean): void;
53
- getMap(): google.maps.Map | google.maps.StreetViewPanorama | null;
52
+ getMap(): google.maps.Map | null | google.maps.StreetViewPanorama;
54
53
  getPanes(): google.maps.MapPanes | null;
55
54
  getProjection(): google.maps.MapCanvasProjection;
56
- setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void;
55
+ setMap(map: google.maps.Map | null | google.maps.StreetViewPanorama): void;
57
56
  addListener(eventName: string, handler: Function): google.maps.MapsEventListener;
58
- bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null | undefined, noNotify?: boolean | undefined): void;
57
+ bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null, noNotify?: boolean): void;
59
58
  get(key: string): any;
60
59
  notify(key: string): void;
61
60
  set(key: string, value: any): void;
62
- setValues(values?: object | null | undefined): void;
61
+ setValues(values?: object | null): void;
63
62
  unbind(key: string): void;
64
63
  unbindAll(): void;
65
64
  };
@@ -1,5 +1,3 @@
1
- /// <reference types="google.maps" />
2
- /// <reference types="baidumap-web-sdk" />
3
1
  import type { Point, Size } from '../../types';
4
2
  export type UnionIcon = Icon | SymbolIcon;
5
3
  export declare const UnionIcon: {
@@ -1,4 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
1
  import type { Tg } from '../../event';
3
2
  import { AbstractEventTargetDelegate } from '../../event-target';
4
3
  import { LatLng } from '../../lat-lng';
@@ -1,4 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
1
  import type { Tg } from '../../event';
3
2
  import { CoordType, LatLng } from '../../lat-lng';
4
3
  import { Point } from '../../types';
@@ -1,4 +1,3 @@
1
- /// <reference types="google.maps" />
2
1
  import type { Nullable } from '../../../utils/mapped-types';
3
2
  import type { Tg } from '../../event';
4
3
  import { CoordType, LatLng } from '../../lat-lng';
@@ -1,5 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="google.maps" />
3
1
  import type { Tg } from '../../event';
4
2
  import { EventHubEventTargetDelegate } from '../../event-target';
5
3
  import { LatLng } from '../../lat-lng';
@@ -1,6 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="baidumap-web-sdk" />
3
- /// <reference types="google.maps" />
4
1
  import type { Tg } from '../../event';
5
2
  import { EventHubEventTargetDelegate } from '../../event-target';
6
3
  import { LatLng } from '../../lat-lng';
@@ -1,5 +1,3 @@
1
- /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="google.maps" />
3
1
  import type { Tg } from '../../event';
4
2
  import { CoordType, LatLngBounds } from '../../lat-lng';
5
3
  import type { BaiduMap } from '../baidu-map';
@@ -1,8 +1,3 @@
1
- /// <reference types="google.maps" />
2
- /// <reference types="heremaps" />
3
- /// <reference types="baidumap-web-sdk" />
4
- /// <reference types="baidumap-web-sdk" />
5
- /// <reference types="baidumap-web-sdk" />
6
1
  import type { BaiduInfoBox } from './map/overlay/baidu-info-box';
7
2
  import type { GoogleLabel } from './map/overlay/google-label';
8
3
  /**
@@ -1,12 +1,5 @@
1
- /// <reference types="google.maps" />
2
- import { type AnyFunction, type Constructor } from '../components';
1
+ import type { AnyFunction, Constructor } from './mapped-types';
3
2
  export declare namespace Arrays {
4
- /**
5
- * 浅层比较
6
- * @see https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript
7
- * */
8
- function equals<T>(a: T[], b: T[]): boolean;
9
- function remove<T>(arr: T[], item: T): T | undefined;
10
3
  function findByType<T>(arr: any[], constructor: Constructor<T>): T | undefined;
11
4
  /** 自动推断item的类型的{@link Array.includes} */
12
5
  function includesTyped<T extends E, E>(arr: T[], item: E): item is T;
@@ -14,11 +7,6 @@ export declare namespace Arrays {
14
7
  function at<T>(arr: T[], index: number, value: T): void;
15
8
  /** 获取 指定位置的值 */
16
9
  function at<T>(arr: T[], index: number): T | undefined;
17
- /**
18
- * 判断并推断数组非空
19
- * @see https://stackoverflow.com/questions/56006111/is-it-possible-to-define-a-non-empty-array-type-in-typescript
20
- */
21
- function isNotEmpty<T>(arr: T[]): arr is [T, ...T[]];
22
10
  }
23
11
  export declare namespace MVCArrays {
24
12
  function indexOf<T>(arr: google.maps.MVCArray<T>, item: T): number;
@@ -1,4 +1,3 @@
1
- /// <reference types="google.maps" />
2
1
  import { type CoordTypeSupplier } from '../map/lat-lng';
3
2
  import type { Place } from '../map/map/extra/places-service';
4
3
  /**
@@ -19,13 +19,6 @@ export type AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;
19
19
  export type PrimitiveToWrapper<T> = T extends boolean ? Boolean : T extends string ? String : T extends number ? Number : T;
20
20
  /** 包装类型=>原始类型 */
21
21
  export type WrapperToPrimitive<T> = T extends Boolean ? boolean : T extends String ? string : T extends Number ? number : T;
22
- /**
23
- * 返回undefined但类型是指定的泛型T, 需要你自身保证在使用前先初始化
24
- * 模仿了kotlin的lateinit关键字
25
- * */
26
- export declare function lateinit<T>(): T;
27
- export declare function typed<T>(): T | undefined;
28
- export declare function typed<T>(t: T): T;
29
22
  /**
30
23
  * `vue instanceof VueConstructor`时`vue`并不会自动转换成`VueConstructor`的子类, 用该方法可以实现这种转换
31
24
  */
@@ -19,8 +19,3 @@ export declare namespace Strings {
19
19
  * */
20
20
  function isInt(str: string): boolean;
21
21
  }
22
- /** @see https://github.com/browserify/path-browserify */
23
- export declare const path: {
24
- /** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
25
- basename(path: string, ext?: string): string;
26
- };
@@ -1,17 +1,10 @@
1
- /** 抛异常是语句不是表达式, 使用该方法替换则可以在表达式中使用 */
2
- export declare function throwError(msg?: string): never;
3
- export declare function throwUnsupported(msg?: string): never;
4
1
  export declare function todo(msg?: string): never;
5
2
  export declare function debug(msg?: any): any;
6
- /** 啥也不做 */
7
- export declare function noop(...args: any[]): void;
8
- /** 可以用在Array.filter(isDef)中, 用来过滤为空的值 */
9
- export declare function isDef<T>(v: T | undefined | null): v is T;
10
3
  /**
11
4
  * entry的value是否定义了
12
5
  *
13
6
  * 可以用在Array.filter(isEntryValueDef)中, 用来过滤值为空的元素
14
- * @see isDef
7
+ * @see isNotNull
15
8
  */
16
9
  export declare function isEntryValueDef<K, V>(entry: [K, V]): entry is [K, NonNullable<V>];
17
10
  /**