Skip to content

Commit

Permalink
Merge pull request #857 from Sunday9787/master
Browse files Browse the repository at this point in the history
解决 组件类型声明错误
  • Loading branch information
Sunday9787 authored Oct 12, 2020
2 parents 80209ac + 533b8d0 commit 300b1b6
Show file tree
Hide file tree
Showing 31 changed files with 63 additions and 33 deletions.
3 changes: 0 additions & 3 deletions index.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lint": "eslint --ext .js,.vue src docs build",
"prepublishOnly": "npm run build"
},
"types": "types/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/Dafrok/vue-baidu-map.git"
Expand Down
3 changes: 2 additions & 1 deletion types/auto-complete.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Point } from "./base/common";
import { Map } from "./map";
import { BaiduMapComponent } from './base/component'


export declare class AutoComplete {
export declare class AutoComplete extends BaiduMapComponent {
/**
* 返回数据类型。两种设置方式,第一种为默认值(即设置值为空),将返回所有数据。
* 如地图初始化为北京,在输入框中输入“小”,输入框下会出现包含“小”关键字的多种类型(如餐饮、地名等)的提示词条。
Expand Down
4 changes: 3 additions & 1 deletion types/base/base-control.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ControlAnchor, Size } from './common'
import { BaiduMapComponent } from './component'

export declare class BaseControl {

export declare class BaseControl extends BaiduMapComponent {
/**
* 控件的停靠位置,默认定位到地图的右下角
*/
Expand Down
5 changes: 5 additions & 0 deletions types/base/component.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Vue from 'vue'

/** BaiduMap component common definition */
export declare class BaiduMapComponent extends Vue {
}
3 changes: 2 additions & 1 deletion types/boundary.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BaiduMapComponent } from './base/component'

export declare class Boundary {
export declare class Boundary extends BaiduMapComponent {
/**
* 行政区划名称
*/
Expand Down
3 changes: 2 additions & 1 deletion types/bus.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point } from './base/common'

export declare class Bus {
export declare class Bus extends BaiduMapComponent {
/**
* location表示检索区域,其类型可为空、坐标点或城市名称的字符串。当参数为空时,
* 检索位置由当前地图中心点确定,且搜索结果的标注将自动加载到地图上,并支持调整地图视野层级;
Expand Down
3 changes: 2 additions & 1 deletion types/circle.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point } from './base/common'

export declare class Circle {
export declare class Circle extends BaiduMapComponent {
center: Point
/**
* 设置圆形的半径,单位为米
Expand Down
4 changes: 2 additions & 2 deletions types/copyright.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Point, Copyright } from './base/common'
import { Copyright as c } from './base/common'
import { BaseControl } from './base/base-control'


export declare class Copyright extends BaseControl {
copyright: Copyright[]
copyright: c[]
}
3 changes: 2 additions & 1 deletion types/curve-line.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point } from './base/common'

export declare class CurveLine {
export declare class CurveLine extends BaiduMapComponent {
/**
* 构成弧线的关键点
*/
Expand Down
3 changes: 2 additions & 1 deletion types/driving.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point, LocalResultPoi, DrivingPolicy } from './base/common'

export declare class Driving {
export declare class Driving extends BaiduMapComponent {
/**
* location表示检索区域,其类型可为空、坐标点或城市名称的字符串。当参数为空时,
* 检索位置由当前地图中心点确定,且搜索结果的标注将自动加载到地图上,并支持调整地图视野层级;
Expand Down
3 changes: 2 additions & 1 deletion types/ground.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Bounds } from './base/common'

export declare class Ground {
export declare class Ground extends BaiduMapComponent {
/**
* 设置图层显示的矩形区域
*/
Expand Down
3 changes: 2 additions & 1 deletion types/info-window.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point, Size } from './base/common'

export declare class InfoWindow {
export declare class InfoWindow extends BaiduMapComponent {
/**
* @default false
*/
Expand Down
3 changes: 2 additions & 1 deletion types/item.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BaiduMapComponent } from './base/component'

export declare class Item {
export declare class Item extends BaiduMapComponent {
/**
* 点击菜单时执行的回调函数,第一个参数为 {BMap, map, target, pixel, point}
*/
Expand Down
3 changes: 2 additions & 1 deletion types/label.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point, Size } from './base/common'

export declare class Label {
export declare class Label extends BaiduMapComponent {
/**
* 设置文本标注的内容。支持HTML
*/
Expand Down
3 changes: 2 additions & 1 deletion types/local-search.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BaiduMapComponent } from './base/component'
import { Point, Bounds, LocalResultPoi } from './base/common'

interface Nearby {
Expand All @@ -14,7 +15,7 @@ interface CustomData {
filter: string
}

export declare class LocalSearch {
export declare class LocalSearch extends BaiduMapComponent {
/**
* location表示检索区域,其类型可为空、坐标点或城市名称的字符串。当参数为空时,
* 检索位置由当前地图中心点确定,且搜索结果的标注将自动加载到地图上,并支持调整地图视野层级;
Expand Down
3 changes: 2 additions & 1 deletion types/lushu.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BaiduMapComponent } from './base/component'
import { Point, Size, Icon } from './base/common'

interface LandmarkPois {
Expand All @@ -7,7 +8,7 @@ interface LandmarkPois {
pauseTime: number
}

export declare class Lushu {
export declare class Lushu extends BaiduMapComponent {
/**
* 是否行进
* @default true
Expand Down
4 changes: 2 additions & 2 deletions types/map-type.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MapType, MapTypeControlType } from './base/common'
import { MapType as mt, MapTypeControlType } from './base/common'
import { BaseControl } from './base/base-control'

export declare class MapType extends BaseControl {
Expand All @@ -9,5 +9,5 @@ export declare class MapType extends BaseControl {
/**
* 控件展示的地图类型,默认为普通图、卫星图、卫星加路网混合图和三维图。通过此属性可配置控件展示的地图类型
*/
mapTypes: MapType[]
mapTypes: mt[]
}
3 changes: 2 additions & 1 deletion types/map-view.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BaiduMapComponent } from './base/component'

export declare class MapView {
export declare class MapView extends BaiduMapComponent {
}
3 changes: 2 additions & 1 deletion types/map.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { MapType, Point, MapStyle } from './base/common'

export declare class Map {
export declare class Map extends BaiduMapComponent {
/**
* 百度地图开发者平台申请的密钥,仅在局部注册组件时声明。
*/
Expand Down
3 changes: 2 additions & 1 deletion types/marker-clusterer.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point, Size, Icon, Animation } from './base/common'

export declare class MarkerClusterer {
export declare class MarkerClusterer extends BaiduMapComponent {
/**
* 网格大小
*/
Expand Down
3 changes: 2 additions & 1 deletion types/marker.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BaiduMapComponent } from './base/component'
import { Point, Size, Icon, Animation } from './base/common'

interface Label {
Expand All @@ -9,7 +10,7 @@ interface Label {
}
}

export declare class Marker {
export declare class Marker extends BaiduMapComponent {
/**
* 标注的位置
*/
Expand Down
3 changes: 2 additions & 1 deletion types/menu.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BaiduMapComponent } from './base/component'

export declare class Menu {
export declare class Menu extends BaiduMapComponent {
/**
* 菜单宽度
*/
Expand Down
3 changes: 2 additions & 1 deletion types/overlay.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BaiduMapComponent } from './base/component'

type MapPanes =
'floatPane' // 信息窗口所在的容器
Expand All @@ -8,7 +9,7 @@ type MapPanes =
| 'markerShadow' // 标注阴影所在的容器
| 'mapPane' // 折线、多边形等矢量图形所在的容器

export declare class Overlay {
export declare class Overlay extends BaiduMapComponent {
/**
* 自定义覆盖物所在容器。
*/
Expand Down
3 changes: 2 additions & 1 deletion types/point-collection.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point, ShapeType, SizeType } from './base/common'

export declare class PointCollection {
export declare class PointCollection extends BaiduMapComponent {
/**
* 设置要在地图上展示的点坐标集合
* @default []
Expand Down
3 changes: 2 additions & 1 deletion types/polygon.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point } from './base/common'

export declare class Polygon {
export declare class Polygon extends BaiduMapComponent {
/**
* 设置多边型的点数组
* @default []
Expand Down
3 changes: 2 additions & 1 deletion types/polyline.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { IconSequence, Point } from './base/common'

export declare class Polyline {
export declare class Polyline extends BaiduMapComponent {
/**
* 设置折线的点数组
* @default []
Expand Down
3 changes: 2 additions & 1 deletion types/tile.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Copyright } from './base/common'

export declare class Tile {
export declare class Tile extends BaiduMapComponent {
/**
* 是否使用了带有透明信息的PNG。
* 由于IE6不支持PNG透明,因此需要特殊处理
Expand Down
3 changes: 2 additions & 1 deletion types/traffic.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { PredictDate } from './base/common'

export declare class Traffic {
export declare class Traffic extends BaiduMapComponent {
/**
* 预测日期
*/
Expand Down
3 changes: 2 additions & 1 deletion types/transit.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point, LocalResultPoi, TransitPolicy } from './base/common'

export declare class Transit {
export declare class Transit extends BaiduMapComponent {
/**
* location表示检索区域,其类型可为空、坐标点或城市名称的字符串。当参数为空时,
* 检索位置由当前地图中心点确定,且搜索结果的标注将自动加载到地图上,并支持调整地图视野层级;
Expand Down
3 changes: 2 additions & 1 deletion types/walking.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaiduMapComponent } from './base/component'
import { Point, LocalResultPoi, TransitPolicy } from './base/common'

export declare class Walking {
export declare class Walking extends BaiduMapComponent {
/**
* location表示检索区域,其类型可为空、坐标点或城市名称的字符串。当参数为空时,
* 检索位置由当前地图中心点确定,且搜索结果的标注将自动加载到地图上,并支持调整地图视野层级;
Expand Down

0 comments on commit 300b1b6

Please sign in to comment.