tg-map-vue3 3.1.4 → 3.1.6

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.
@@ -1,15 +1,11 @@
1
- import type { ZoomControl } from '../../map/map/controls/zoom.control';
1
+ import { createEmptyVNode } from '../../utils/vue-utils';
2
2
  import { ControlPosition } from '../../map/map/controls/control';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  position: {
5
5
  type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>>;
6
6
  default: ControlPosition;
7
7
  };
8
- }, {
9
- control: ZoomControl;
10
- }, unknown, {}, {}, import("vue").DefineComponent<{}, {}, {}, {}, {
11
- recreate(): void;
12
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ }, typeof createEmptyVNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
13
9
  position: {
14
10
  type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>>;
15
11
  default: ControlPosition;
@@ -7,6 +7,7 @@ declare const TgMapPlugin: {
7
7
  install(app: App, config?: PartialTgMapConfig): void;
8
8
  };
9
9
  export default TgMapPlugin;
10
+ export * from './map-hooks';
10
11
  export { default as TgMap } from './TgMap.vue';
11
12
  export { default as TgMapWidget } from './TgMapWidget.vue';
12
13
  export { default as TgCustomControl } from './controls/TgCustomControl.vue';
@@ -0,0 +1,14 @@
1
+ import { type Ref } from 'vue';
2
+ import { type AbstractMap } from '.';
3
+ /** 作为Vue3下, `MapMixin`的替代 */
4
+ export declare function useTgMap(): {
5
+ mapRef: Ref<AbstractMap | undefined>;
6
+ /** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
7
+ readonly map: AbstractMap;
8
+ /** 地图元素创建回调 */
9
+ onCreate(hook: VoidFunction): void;
10
+ /** 地图元素销毁回调 */
11
+ onDestroy(hook: VoidFunction): void;
12
+ /** 重新创建地图元素 */
13
+ recreate(): void;
14
+ };
@@ -14,6 +14,7 @@ declare module 'vue' {
14
14
  [MIXIN_HOOK_DESTROY]?(): void;
15
15
  }
16
16
  }
17
+ /** @deprecated 使用{@link useTgMap}替代 */
17
18
  declare const MapMixin: import("vue").DefineComponent<{}, {}, {}, {}, {
18
19
  recreate(): void;
19
20
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1,37 +1,39 @@
1
+ import { type PropType } from 'vue';
1
2
  import { LatLng } from '../../map/lat-lng';
2
3
  import { type MarkerOverlay } from '../../map/map/overlay/marker';
4
+ import type { Icon } from '../../map/map/overlay/icon';
3
5
  import TgMarkerClusterer from '../extra/TgMarkerClusterer.vue';
4
6
  import type TgLabel from './TgLabel.vue';
5
7
  import type TgInfoWindow from './TgInfoWindow.vue';
6
8
  import type TgInfoBox from './TgInfoBox.vue';
7
9
  declare const TgMarker: import("vue").DefineComponent<{
8
10
  position: {
9
- type: import("vue").PropType<LatLng>;
11
+ type: PropType<LatLng>;
10
12
  required: true;
11
13
  };
12
14
  title: {
13
- type: import("vue").PropType<string>;
15
+ type: PropType<string>;
14
16
  };
15
17
  icon: {
16
- type: import("vue").PropType<any>;
18
+ type: PropType<Icon>;
17
19
  };
18
20
  clickable: {
19
- type: import("vue").PropType<boolean>;
21
+ type: PropType<boolean>;
20
22
  };
21
23
  draggable: {
22
- type: import("vue").PropType<boolean>;
24
+ type: PropType<boolean>;
23
25
  };
24
26
  crossOnDrag: {
25
- type: import("vue").PropType<boolean>;
27
+ type: PropType<boolean>;
26
28
  };
27
29
  cursor: {
28
- type: import("vue").PropType<string>;
30
+ type: PropType<string>;
29
31
  };
30
32
  zIndex: {
31
- type: import("vue").PropType<number>;
33
+ type: PropType<number>;
32
34
  };
33
35
  visible: {
34
- type: import("vue").PropType<boolean>;
36
+ type: PropType<boolean>;
35
37
  };
36
38
  }, {
37
39
  attrs: import("vue").ComputedRef<{
@@ -45,13 +47,13 @@ declare const TgMarker: import("vue").DefineComponent<{
45
47
  $data: {};
46
48
  $props: Partial<{} & {}> & Omit<Readonly<import("vue").ExtractPropTypes<{}>> & Readonly<import("vue").ExtractPropTypes<{
47
49
  position: {
48
- type: import("vue").PropType<LatLng>;
50
+ type: PropType<LatLng>;
49
51
  };
50
52
  offset: {
51
- type: import("vue").PropType<any>;
53
+ type: PropType<any>;
52
54
  };
53
55
  zIndex: {
54
- type: import("vue").PropType<number>;
56
+ type: PropType<number>;
55
57
  };
56
58
  }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
57
59
  $attrs: {
@@ -69,13 +71,13 @@ declare const TgMarker: import("vue").DefineComponent<{
69
71
  $el: any;
70
72
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
71
73
  position: {
72
- type: import("vue").PropType<LatLng>;
74
+ type: PropType<LatLng>;
73
75
  };
74
76
  offset: {
75
- type: import("vue").PropType<any>;
77
+ type: PropType<any>;
76
78
  };
77
79
  zIndex: {
78
- type: import("vue").PropType<number>;
80
+ type: PropType<number>;
79
81
  };
80
82
  }>>, {
81
83
  attrs: import("vue").ComputedRef<{
@@ -113,13 +115,13 @@ declare const TgMarker: import("vue").DefineComponent<{
113
115
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
114
116
  } & Readonly<import("vue").ExtractPropTypes<{}>> & Readonly<import("vue").ExtractPropTypes<{
115
117
  position: {
116
- type: import("vue").PropType<LatLng>;
118
+ type: PropType<LatLng>;
117
119
  };
118
120
  offset: {
119
- type: import("vue").PropType<any>;
121
+ type: PropType<any>;
120
122
  };
121
123
  zIndex: {
122
- type: import("vue").PropType<number>;
124
+ type: PropType<number>;
123
125
  };
124
126
  }>> & import("vue").ShallowUnwrapRef<{
125
127
  attrs: import("vue").ComputedRef<{
@@ -148,32 +150,32 @@ declare const TgMarker: import("vue").DefineComponent<{
148
150
  recreate(): void;
149
151
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
150
152
  position: {
151
- type: import("vue").PropType<LatLng>;
153
+ type: PropType<LatLng>;
152
154
  required: true;
153
155
  };
154
156
  title: {
155
- type: import("vue").PropType<string>;
157
+ type: PropType<string>;
156
158
  };
157
159
  icon: {
158
- type: import("vue").PropType<any>;
160
+ type: PropType<Icon>;
159
161
  };
160
162
  clickable: {
161
- type: import("vue").PropType<boolean>;
163
+ type: PropType<boolean>;
162
164
  };
163
165
  draggable: {
164
- type: import("vue").PropType<boolean>;
166
+ type: PropType<boolean>;
165
167
  };
166
168
  crossOnDrag: {
167
- type: import("vue").PropType<boolean>;
169
+ type: PropType<boolean>;
168
170
  };
169
171
  cursor: {
170
- type: import("vue").PropType<string>;
172
+ type: PropType<string>;
171
173
  };
172
174
  zIndex: {
173
- type: import("vue").PropType<number>;
175
+ type: PropType<number>;
174
176
  };
175
177
  visible: {
176
- type: import("vue").PropType<boolean>;
178
+ type: PropType<boolean>;
177
179
  };
178
180
  }>>, {}>;
179
181
  type TgMarker = InstanceType<typeof TgMarker>;
@@ -0,0 +1,2 @@
1
+ /** 获取当前组件的名字 */
2
+ export declare function useComponentName(): string | undefined;