/** * BMap 与 BMapGL 视为同一套 API,类型统一使用 @types/bmapgl-browser。 * 下方 declare namespace BMapGL { ... } 用于覆盖 @types 中与实际 API 不一致的规则。 */ declare namespace BMap { export type Map = BMapGL.Map; export type Point = BMapGL.Point; export type LocalSearch = BMapGL.LocalSearch; export type LocalResult = BMapGL.LocalResult; export type LocalResultPoi = BMapGL.LocalResultPoi; export type Bounds = BMapGL.Bounds; } /* eslint-disable-next-line no-redeclare, @typescript-eslint/no-redeclare */ declare const BMap: typeof BMapGL; /** 覆盖 @types/bmapgl-browser:与实际 API 不一致时在此扩展/合并 */ declare namespace BMapGL { interface RenderOptions { map?: Map; panel?: string | HTMLElement; autoViewport?: boolean; pageCapacity?: number; } interface Map { getProjection?: () => Projection; lnglatToMercator?: (lnglat: Point) => Point; } interface Projection { lnglatToMercator?: (lnglat: Point) => Point; lngLatToMercator?: (lnglat: Point) => Point; convertLL2MC?: (lnglat: Point) => Point; } } interface Window { BMap?: typeof BMapGL; BMapGL?: typeof BMapGL; } declare module '*.png' { const url: string; export default url; } declare module '*.svg' { const url: string; export default url; } declare module '*.svg?raw' { const src: string; export default src; }