diff --git a/types/amap-js-api/amap-js-api-tests.ts b/types/amap-js-api/amap-js-api-tests.ts index 6a5a9db891..4e148bb60c 100644 --- a/types/amap-js-api/amap-js-api-tests.ts +++ b/types/amap-js-api/amap-js-api-tests.ts @@ -972,6 +972,18 @@ testPixel.toFixed(); // $ExpectType Pixel testPixel.toFixed(2); +/** + * plugin.ts + */ + +AMap.plugin('plugin name', () => { + // callback +}); + +AMap.service('plugin name', () => { + // callback +}); + /** * size.ts */ diff --git a/types/amap-js-api/index.d.ts b/types/amap-js-api/index.d.ts index d61a3e7a90..14548bad0e 100644 --- a/types/amap-js-api/index.d.ts +++ b/types/amap-js-api/index.d.ts @@ -15,6 +15,7 @@ /// /// /// +/// /// /// /// diff --git a/types/amap-js-api/plugin.d.ts b/types/amap-js-api/plugin.d.ts new file mode 100644 index 0000000000..b6b7148ab0 --- /dev/null +++ b/types/amap-js-api/plugin.d.ts @@ -0,0 +1,14 @@ +declare namespace AMap { + /** + * 加载插件, + * @param name 插件名称 + * @param callback 插件加载完成后的回调函数 + */ + function plugin(plugin: string | string[], callback: () => void): typeof AMap; + /** + * 加载插件, + * @param name 插件名称 + * @param callback 插件加载完成后的回调函数 + */ + function service(plugin: string | string[], callback: () => void): typeof AMap; +} diff --git a/types/amap-js-api/tsconfig.json b/types/amap-js-api/tsconfig.json index 9b512bebdc..750bdedd08 100644 --- a/types/amap-js-api/tsconfig.json +++ b/types/amap-js-api/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "amap-js-api-tests.ts" ] -} \ No newline at end of file +}