import * as maptalks from 'maptalks' /** * maptalks的类型声明有点问题, 使用该模块扩展, 规避一些报错 */ declare module 'maptalks' { interface LayerAbstractRenderer { setToRedraw(): void } type Eventable = InstanceType> interface Map { config(options: MapOptionsType): this config(conf: K, value: MapOptionsType[K]): this /** @deprecated config()内部会复制一遍options的值, 故如果只是读取, 建议直接使用{@link options}, */ config(): MapOptionsType } interface TileLayer { config(options: TileLayerOptionsType): this config(conf: K, value: TileLayerOptionsType[K]): this /** @deprecated */ config(): TileLayerOptionsType } interface Marker { config(options: MarkerOptionsType): this config(conf: K, value: MarkerOptionsType[K]): this /** @deprecated */ config(): MarkerOptionsType updateSymbol(props: AnyMarkerSymbol | Array): this } interface Polygon { config(options: PolygonOptionsType): this config(conf: K, value: PolygonOptionsType[K]): this /** @deprecated */ config(): PolygonOptionsType updateSymbol(props: FillSymbol | Array): this } interface LineString { config(options: LineStringOptionsType): this config(conf: K, value: LineStringOptionsType[K]): this /** @deprecated */ config(): LineStringOptionsType updateSymbol(props: LineSymbol | Array): this } interface Circle { config(options: CircleOptionsType): this config(conf: K, value: CircleOptionsType[K]): this /** @deprecated */ config(): CircleOptionsType updateSymbol(props: FillSymbol | Array): this } interface Rectangle { config(options: RectangleOptionsType): this config(conf: K, value: RectangleOptionsType[K]): this /** @deprecated */ config(): RectangleOptionsType updateSymbol(props: FillSymbol | Array): this } namespace ui { interface UIMarker { config(options: UIMarkerOptionsType): this config(conf: K, value: UIMarkerOptionsType[K]): this /** @deprecated */ config(): UIMarkerOptionsType } interface InfoWindow { config(options: InfoWindowOptionsType): this config(conf: K, value: InfoWindowOptionsType[K]): this /** @deprecated */ config(): InfoWindowOptionsType /** 若不传{@link coordinate}则使用owner的中心点 */ show(coordinate?: Coordinate): this } } namespace control { interface Control { config(options: ControlOptionsType): this config(conf: K, value: ControlOptionsType[K]): this /** @deprecated */ config(): ControlOptionsType } interface Zoom { config(options: ZoomOptionsTypeSpec & ControlOptionsType): this config(conf: K, value: (ZoomOptionsTypeSpec & ControlOptionsType)[K]): this /** @deprecated */ config(): ZoomOptionsTypeSpec & ControlOptionsType } } /** {@link DomPositionType}里设置transform等其他css样式, 也会生效 */ type FixedDomPositionType = DomPositionType & Partial> } // TODO: 使用这个导出的maptalks编译会报错... export { maptalks }