>;
+
export function requiredBy(
requiredByPropName: string,
propType: PropTypes.Validator
,
diff --git a/types/airtable/airtable-tests.ts b/types/airtable/airtable-tests.ts
new file mode 100644
index 0000000000..7d7dfbdc60
--- /dev/null
+++ b/types/airtable/airtable-tests.ts
@@ -0,0 +1,43 @@
+import * as Airtable from 'airtable';
+
+interface Row extends Airtable.FieldSet {
+ field1: string;
+ attachments: Airtable.Attachment[];
+}
+
+const airtable = new Airtable();
+
+const base = airtable.base('app id');
+
+const table = base('table name') as Airtable.Table;
+
+async () => {
+ const query = table.select();
+ {
+ const rows = await query.all();
+ for (const row of rows) {
+ row.id; // $ExpectType string
+ row.fields.field1; // $ExpectType string
+ for (const attachment of row.fields.attachments) {
+ attachment.id; // $ExpectType string
+ attachment.filename; // $ExpectType string
+ attachment.size; // $ExpectType number
+ attachment.type; // $ExpectType string
+ attachment.url; // $ExpectType string
+ if (attachment.thumbnails) {
+ attachment.thumbnails.full.height; // $ExpectType number
+ attachment.thumbnails.full.width; // $ExpectType number
+ attachment.thumbnails.full.url; // $ExpectType string
+
+ attachment.thumbnails.large.height; // $ExpectType number
+ attachment.thumbnails.large.width; // $ExpectType number
+ attachment.thumbnails.large.url; // $ExpectType string
+
+ attachment.thumbnails.small.height; // $ExpectType number
+ attachment.thumbnails.small.width; // $ExpectType number
+ attachment.thumbnails.small.url; // $ExpectType string
+ }
+ }
+ }
+ }
+};
diff --git a/types/airtable/index.d.ts b/types/airtable/index.d.ts
new file mode 100644
index 0000000000..f3b6efa4ee
--- /dev/null
+++ b/types/airtable/index.d.ts
@@ -0,0 +1,62 @@
+// Type definitions for airtable 0.5
+// Project: https://github.com/airtable/airtable.js
+// Definitions by: Brandon Valosek
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
+
+export = Airtable;
+
+declare global {
+ class Airtable {
+ base(appId: string): Airtable.Base;
+ }
+
+ namespace Airtable {
+ interface FieldSet {
+ [ key: string ]: undefined | string | ReadonlyArray;
+ }
+
+ interface Base {
+ (tableName: string): Table<{}>;
+ }
+
+ interface Table {
+ select(opt?: SelectOptions): Query;
+ }
+
+ interface SelectOptions {
+ view?: string;
+ }
+
+ interface Query {
+ all(): Promise>;
+ firstPage(): Promise>;
+ }
+
+ type Response = ReadonlyArray>;
+
+ interface Row {
+ id: string;
+ fields: TFields;
+ }
+
+ interface Attachment {
+ id: string;
+ url: string;
+ filename: string;
+ size: number;
+ type: string;
+ thumbnails?: {
+ small: Thumbnail;
+ large: Thumbnail;
+ full: Thumbnail;
+ };
+ }
+
+ interface Thumbnail {
+ url: string;
+ width: number;
+ height: number;
+ }
+ }
+}
diff --git a/types/has-yarn/tsconfig.json b/types/airtable/tsconfig.json
similarity index 94%
rename from types/has-yarn/tsconfig.json
rename to types/airtable/tsconfig.json
index 824092017a..9ec625d762 100644
--- a/types/has-yarn/tsconfig.json
+++ b/types/airtable/tsconfig.json
@@ -18,6 +18,6 @@
},
"files": [
"index.d.ts",
- "has-yarn-tests.ts"
+ "airtable-tests.ts"
]
}
diff --git a/types/aggregate-error/tslint.json b/types/airtable/tslint.json
similarity index 100%
rename from types/aggregate-error/tslint.json
rename to types/airtable/tslint.json
diff --git a/types/alertify/tslint.json b/types/alertify/tslint.json
index a41bf5d19a..3d59f55fda 100644
--- a/types/alertify/tslint.json
+++ b/types/alertify/tslint.json
@@ -8,6 +8,7 @@
"callable-types": false,
"comment-format": false,
"dt-header": false,
+ "npm-naming": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts
index fdd0f395fe..4c68a75831 100644
--- a/types/algoliasearch/algoliasearch-tests.ts
+++ b/types/algoliasearch/algoliasearch-tests.ts
@@ -98,6 +98,7 @@ let _algoliaIndexSettings: IndexSettings = {
placeholders: { '': [''] },
camelCaseAttributes: [''],
sortFacetValuesBy: 'count',
+ queryLanguages: ['fr', 'es'],
};
let _algoliaQueryParameters: QueryParameters = {
@@ -147,6 +148,7 @@ let _algoliaQueryParameters: QueryParameters = {
tagFilters: [''],
facetFilters: [''],
analytics: false,
+ clickAnalytics: true,
analyticsTags: [''],
synonyms: true,
replaceSynonymsInHighlight: false,
@@ -205,6 +207,11 @@ browser.on('error', function onError(err) {
browser.stop();
+index.setSettings({ hitsPerPage: 10 }, () => {})
+index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }, () => {})
+index.setSettings({ hitsPerPage: 10 }).then(() => {})
+index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }).then(() => {})
+
index.browse("", {
advancedSyntax: false,
attributesToRetrieve: ['dogs']
diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts
index 8e3ba4c5ab..8c32304c9e 100644
--- a/types/algoliasearch/index.d.ts
+++ b/types/algoliasearch/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for algoliasearch-client-js 3.30.0
+// Type definitions for algoliasearch-client-js 3.30.1
// Project: https://github.com/algolia/algoliasearch-client-js
// Definitions by: Baptiste Coquelle
// Haroen Viaene
@@ -6,6 +6,8 @@
// Samuel Vaillant
// Kai Eichinger
// Nery Ortez
+// Antoine Rousseau
+// Luca Pasquale
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -358,6 +360,15 @@ declare namespace algoliasearch {
settings: IndexSettings,
cb: (err: Error, res: Task) => void
): void;
+ /**
+ * Set an index settings
+ * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings
+ */
+ setSettings(
+ settings: IndexSettings,
+ extra: { forwardToReplicas: boolean },
+ cb: (err: Error, res: Task) => void
+ ): void;
/**
* Clear cache of an index
* https://github.com/algolia/algoliasearch-client-js#cache
@@ -586,7 +597,7 @@ declare namespace algoliasearch {
* Set an index settings
* https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings
*/
- setSettings(settings: IndexSettings): Promise;
+ setSettings(settings: IndexSettings, extra?: { forwardToReplicas: boolean }): Promise;
/**
* Search in an index
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
@@ -1425,6 +1436,12 @@ declare namespace algoliasearch {
* https://www.algolia.com/doc/api-reference/api-parameters/analytics/
*/
analytics?: boolean;
+ /**
+ * If set to true, enables the Click Analytics feature
+ * default false
+ * https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/
+ */
+ clickAnalytics?: boolean;
/**
* If set, tag your query with the specified identifiers
* default: []
@@ -1778,12 +1795,20 @@ declare namespace algoliasearch {
};
/**
* List of attributes on which to do a decomposition of camel case words.
- *
- https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/
+ * https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/
*/
camelCaseAttributes?: string[];
-
+ /**
+ * Controls how facet values are sorted.
+ * https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/
+ */
sortFacetValuesBy?: 'count' | 'alpha';
+ /**
+ * Sets the languages to be used by language-specific settings and functionalities
+ * such as ignorePlurals, removeStopWords, and CJK word-detection.
+ * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/
+ */
+ queryLanguages?: Array<'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh'>;
}
interface Response {
diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts
index 11e22f5ccf..2fd13ec2d0 100644
--- a/types/algoliasearch/lite/index.d.ts
+++ b/types/algoliasearch/lite/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for algoliasearch-client-js 3.30.0
+// Type definitions for algoliasearch-client-js 3.30.1
// Project: https://github.com/algolia/algoliasearch-client-js
// Definitions by: Baptiste Coquelle
// Haroen Viaene
@@ -7,6 +7,7 @@
// Claas Brüggemann
// Kai Eichinger
// Nery Ortez
+// Antoine Rousseau
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -505,6 +506,12 @@ declare namespace algoliasearch {
* https://www.algolia.com/doc/api-reference/api-parameters/analytics/
*/
analytics?: boolean;
+ /**
+ * If set to true, enables the Click Analytics feature
+ * default false
+ * https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/
+ */
+ clickAnalytics?: boolean;
/**
* If set, tag your query with the specified identifiers
* default: []
@@ -534,9 +541,16 @@ declare namespace algoliasearch {
userData?: string | object;
/**
+ * Controls how facet values are sorted.
* https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/
*/
sortFacetValuesBy?: 'count' | 'alpha';
+ /**
+ * Sets the languages to be used by language-specific settings and functionalities
+ * such as ignorePlurals, removeStopWords, and CJK word-detection.
+ * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/
+ */
+ queryLanguages?: Array<'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh'>;
}
namespace SearchForFacetValues {
diff --git a/types/algoliasearch/tslint.json b/types/algoliasearch/tslint.json
index 886f1a8b6c..4ef1833aa4 100644
--- a/types/algoliasearch/tslint.json
+++ b/types/algoliasearch/tslint.json
@@ -8,6 +8,7 @@
"callable-types": false,
"comment-format": false,
"dt-header": false,
+ "npm-naming": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
diff --git a/types/align-text/index.d.ts b/types/align-text/index.d.ts
new file mode 100644
index 0000000000..ad72062b34
--- /dev/null
+++ b/types/align-text/index.d.ts
@@ -0,0 +1,37 @@
+// Type definitions for align-text 1.0
+// Project: https://github.com/jonschlinkert/align-text
+// Definitions by: Claas Ahlrichs
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.1
+
+interface TransformResult {
+ /**
+ * the amount of indentation to use. Default is 0 when an object is returned.
+ */
+ indent: number;
+ /**
+ * the character to use for indentation. Default is '' (empty string) when an object is returned.
+ */
+ character: string;
+ /**
+ * leading characters to use at the beginning of each line. '' (empty string) when an object is returned.
+ */
+ prefix: string;
+}
+
+interface Callback {
+ /**
+ * @param len the length of the "current" line
+ * @param longest the length of the longest line
+ * @param line the current line (string) being aligned
+ * @param lines the array of all lines
+ */
+ (len: number, longest: number, line: string, lines: string[]):
+ | number
+ | TransformResult;
+}
+
+declare function align_text(text: string, fn?: number | Callback): string;
+declare function align_text(text: any[], fn?: number | Callback): string[];
+
+export = align_text;
diff --git a/types/align-text/test/array.ts b/types/align-text/test/array.ts
new file mode 100644
index 0000000000..4d5fef3479
--- /dev/null
+++ b/types/align-text/test/array.ts
@@ -0,0 +1,6 @@
+import align from "align-text";
+
+const text = ["abc", true, 123456, { hello: "world" }];
+align(text, 4);
+
+align(text);
diff --git a/types/align-text/test/center-complex.ts b/types/align-text/test/center-complex.ts
new file mode 100644
index 0000000000..8520f92583
--- /dev/null
+++ b/types/align-text/test/center-complex.ts
@@ -0,0 +1,12 @@
+import align from "align-text";
+
+function centerAlign(len: number, longest: number) {
+ return {
+ character: "\t",
+ indent: Math.floor((longest - len) / 2),
+ prefix: "~ "
+ };
+}
+
+const text = ["abc", "abc", "abc"];
+align(text, centerAlign);
diff --git a/types/align-text/test/center-simple.ts b/types/align-text/test/center-simple.ts
new file mode 100644
index 0000000000..5400551b81
--- /dev/null
+++ b/types/align-text/test/center-simple.ts
@@ -0,0 +1,8 @@
+import align from "align-text";
+
+function centerAlign(len: number, longest: number) {
+ return Math.floor((longest - len) / 2);
+}
+
+const text = ["abc", "abc", "abc"];
+align(text, centerAlign);
diff --git a/types/align-text/test/simple.ts b/types/align-text/test/simple.ts
new file mode 100644
index 0000000000..65ef81fcf0
--- /dev/null
+++ b/types/align-text/test/simple.ts
@@ -0,0 +1,8 @@
+import align from "align-text";
+
+const text = ["abc", "abc", "abc"];
+align(text, 4);
+
+align("abc", 2);
+
+align("abc");
diff --git a/types/align-text/tsconfig.json b/types/align-text/tsconfig.json
new file mode 100644
index 0000000000..bdea3b3399
--- /dev/null
+++ b/types/align-text/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": ["es6"],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": ["../"],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true,
+ "allowSyntheticDefaultImports": true
+ },
+ "files": [
+ "index.d.ts",
+ "test/simple.ts",
+ "test/center-simple.ts",
+ "test/center-complex.ts",
+ "test/array.ts"
+ ]
+}
diff --git a/types/boxen/tslint.json b/types/align-text/tslint.json
similarity index 100%
rename from types/boxen/tslint.json
rename to types/align-text/tslint.json
diff --git a/types/alt/tslint.json b/types/alt/tslint.json
index d67ffb3a73..6c7fd03ccd 100644
--- a/types/alt/tslint.json
+++ b/types/alt/tslint.json
@@ -8,6 +8,7 @@
"callable-types": false,
"comment-format": false,
"dt-header": false,
+ "npm-naming": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
diff --git a/types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts b/types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts
new file mode 100644
index 0000000000..fb1b0d9b6b
--- /dev/null
+++ b/types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts
@@ -0,0 +1,108 @@
+declare const div: HTMLDivElement;
+
+const input = document.createElement('input');
+// $ExpectType Autocomplete
+const autoComplete = new AMap.Autocomplete();
+// $ExpectType Autocomplete
+new AMap.Autocomplete({});
+// $ExpectType Autocomplete
+new AMap.Autocomplete({
+ type: 'type',
+ city: 'city',
+ datatype: 'all',
+ citylimit: true,
+ input: 'input',
+ output: 'output',
+ outPutDirAuto: true
+});
+// $ExpectType Autocomplete
+new AMap.Autocomplete({
+ type: 'type',
+ city: 'city',
+ datatype: 'all',
+ citylimit: true,
+ input,
+ output: div,
+ outPutDirAuto: true
+});
+
+autoComplete.search('keyword', (status, result) => {
+ const temp: 'error' | 'complete' | 'no_data' = status;
+ if (typeof result !== 'string') {
+ // $ExpectType number
+ result.count;
+ // $ExpectType string
+ result.info;
+ // $ExpectType Tip[]
+ result.tips;
+ {
+ const tip = result.tips[0];
+ // $ExpectType string
+ tip.adcode;
+ // $ExpectType string
+ tip.address;
+ // $ExpectType any[]
+ tip.city;
+ // $ExpectType string
+ tip.district;
+ // $ExpectType string
+ tip.id;
+ // $ExpectType LngLat
+ tip.location;
+ // $ExpectType string
+ tip.name;
+ // $ExpectType string
+ tip.typecode;
+ }
+ } else {
+ // $ExpectType string
+ result;
+ }
+});
+
+// $ExpectType void
+autoComplete.setType();
+// $ExpectType void
+autoComplete.setType('type');
+
+// $ExpectType void
+autoComplete.setCity();
+// $ExpectType void
+autoComplete.setCity('city');
+
+// $ExpectType void
+autoComplete.setCityLimit(false);
+
+autoComplete.on('complete', (event: AMap.Autocomplete.EventMap['complete']) => {
+ // $ExpectType "complete"
+ event.type;
+ // $ExpectType string
+ event.info;
+ if ('tips' in event) {
+ // $ExpectType number
+ event.count;
+ // $ExpectType Tip[]
+ event.tips;
+ }
+});
+
+autoComplete.on('error', (event: AMap.Autocomplete.EventMap['error']) => {
+ // $ExpectType "error"
+ event.type;
+ // $ExpectType string
+ event.info;
+});
+
+autoComplete.on('select', (event: AMap.Autocomplete.EventMap['select']) => {
+ // $ExpectType "select"
+ event.type;
+ // $ExpectType Tip
+ event.tip;
+});
+
+autoComplete.on('choose', (event: AMap.Autocomplete.EventMap['choose']) => {
+ // $ExpectType "choose"
+ event.type;
+ // $ExpectType Tip
+ event.tip;
+});
diff --git a/types/amap-js-api-autocomplete/index.d.ts b/types/amap-js-api-autocomplete/index.d.ts
new file mode 100644
index 0000000000..4bfc934395
--- /dev/null
+++ b/types/amap-js-api-autocomplete/index.d.ts
@@ -0,0 +1,144 @@
+// Type definitions for non-npm package amap-js-api-autocomplete 1.4
+// Project: https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.Autocomplete
+// Definitions by: breeze9527
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+///
+
+declare namespace AMap {
+ namespace Autocomplete {
+ interface EventMap {
+ complete: Event<'complete', SearchResult | { info: string }>;
+ error: Event<'error', { info: string }>;
+ select: Event<'select', { tip: Tip }>;
+ choose: Event<'choose', { tip: Tip }>;
+ }
+ type DataType = 'all' | 'bus' | 'poi' | 'busline';
+ interface Options {
+ /**
+ * 输入提示时限定POI类型,多个类型用“|”分隔
+ */
+ type?: string;
+ /**
+ * 输入提示时限定城市
+ */
+ city?: string;
+ /**
+ * 返回的数据类型
+ */
+ datatype?: DataType;
+ /**
+ * 是否强制限制在设置的城市内搜索
+ */
+ citylimit?: boolean;
+ /**
+ * 指定输入框
+ */
+ input?: string | HTMLInputElement;
+ /**
+ * 指定输出面板
+ */
+ output?: string | HTMLDivElement;
+ /**
+ * 是否在input位于页面较下方的时候自动将输入面板显示在input上方以避免被遮挡
+ */
+ outPutDirAuto?: boolean;
+
+ // internal
+ closeResultOnScroll?: boolean;
+ lang?: Lang;
+ }
+ interface Tip {
+ /**
+ * 名称
+ */
+ name: string;
+ /**
+ * 所属区域
+ */
+ district: string;
+ /**
+ * 区域编码
+ */
+ adcode: string;
+ /**
+ * 地址
+ */
+ address: string;
+ /**
+ * 城市
+ */
+ city: any[];
+ /**
+ * ID
+ */
+ id: string;
+ /**
+ * 坐标经纬度
+ */
+ location: LngLat;
+ /**
+ * 类型编码
+ */
+ typecode: string;
+ }
+ interface SearchResult {
+ /**
+ * 查询状态说明
+ */
+ info: string;
+ /**
+ * 输入提示条数
+ */
+ count: number;
+ /**
+ * 输入提示列表
+ */
+ tips: Tip[];
+ }
+ type SearchStatus = 'complete' | 'error' | 'no_data';
+ }
+ class Autocomplete extends EventEmitter {
+ /**
+ * 输入提示,根据输入关键字提示匹配信息
+ * @param options 选项
+ */
+ constructor(options?: Autocomplete.Options);
+ /**
+ * 根据输入关键字提示匹配信息
+ * @param keyword 关键字
+ * @param callback 回调
+ */
+ search(
+ keyword: string,
+ callback: (status: Autocomplete.SearchStatus, result: Autocomplete.SearchResult | string) => void
+ ): void;
+ /**
+ * 设置提示Poi类型,多个类型用“|”分隔
+ * @param type Poi类型
+ */
+ setType(type?: string): void;
+ /**
+ * 设置城市
+ * @param city 城市
+ */
+ setCity(city?: string): void;
+ /**
+ * 设置是否强制限制城市
+ * @param cityLimit 是否强制限制城市
+ */
+ setCityLimit(cityLimit: boolean): void;
+
+ // internal
+ /**
+ * 设置查询语言
+ * @param lang 语言
+ */
+ setLang(lang?: Lang): void;
+ /**
+ * 返回查询语言
+ */
+ getLang(): Lang | undefined;
+ }
+}
diff --git a/types/amap-js-api-autocomplete/tsconfig.json b/types/amap-js-api-autocomplete/tsconfig.json
new file mode 100644
index 0000000000..f6019445f5
--- /dev/null
+++ b/types/amap-js-api-autocomplete/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6",
+ "dom"
+ ],
+ "noEmit": true,
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "amap-js-api-autocomplete-tests.ts"
+ ]
+}
diff --git a/types/elastic-apm-node/tslint.json b/types/amap-js-api-autocomplete/tslint.json
similarity index 100%
rename from types/elastic-apm-node/tslint.json
rename to types/amap-js-api-autocomplete/tslint.json
diff --git a/types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts b/types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts
new file mode 100644
index 0000000000..51feb02694
--- /dev/null
+++ b/types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts
@@ -0,0 +1,227 @@
+declare const lnglat: AMap.LngLat;
+declare const lnglatTuple: [number, number];
+
+// $ExpectType Geocoder
+new AMap.Geocoder();
+// $ExpectType Geocoder
+new AMap.Geocoder({});
+// $ExpectType Geocoder
+const geocoder = new AMap.Geocoder({
+ city: 'city',
+ radius: 10,
+ lang: 'zh_cn',
+ batch: true,
+ extensions: 'all'
+});
+
+// $ExpectType void
+geocoder.getLocation('address', (status, result) => {
+ // $ExpectType SearchStatus
+ status;
+ if (typeof result !== 'string') {
+ const geocode = result.geocodes[0];
+ const addressComponent = geocode.addressComponent;
+ // $ExpectType string
+ result.info;
+ // $ExpectType string
+ result.resultNum;
+ // $ExpectType string
+ geocode.adcode;
+ // $ExpectType string
+ geocode.formattedAddress;
+ // $ExpectType string
+ geocode.level;
+ // $ExpectType LngLat
+ geocode.location;
+ // $ExpectType string
+ addressComponent.building;
+ // $ExpectType string
+ addressComponent.building;
+ // $ExpectType string
+ addressComponent.buildingType;
+ // $ExpectType string
+ addressComponent.city;
+ // $ExpectType string
+ addressComponent.citycode;
+ // $ExpectType string
+ addressComponent.district;
+ // $ExpectType string
+ addressComponent.neighborhood;
+ // $ExpectType string
+ addressComponent.neighborhoodType;
+ // $ExpectType string
+ addressComponent.province;
+ // $ExpectType string
+ addressComponent.street;
+ // $ExpectType string
+ addressComponent.streetNumber;
+ // $ExpectType string
+ addressComponent.township;
+ } else {
+ // $ExpectType string
+ result;
+ }
+});
+
+// $ExpectType void
+geocoder.getLocation(['address', 'address'], () => { });
+
+// $ExpectType void
+geocoder.setCity();
+// $ExpectType void
+geocoder.setCity('city');
+
+// $ExpectType void
+geocoder.getAddress(lnglat, (status, result) => {
+ // $ExpectType SearchStatus
+ status;
+ if (typeof result !== 'string') {
+ // $ExpectType string
+ result.info;
+
+ // $ExpectType ReGeocode
+ const regeocode = result.regeocode;
+ // $ExpectType ReGeocodeAddressComponent
+ const addressComponent = regeocode.addressComponent;
+ {
+ // $ExpectType string
+ addressComponent.adcode;
+ // $ExpectType string
+ addressComponent.building;
+ // $ExpectType string
+ addressComponent.buildingType;
+ // $ExpectType BuildingArea[]
+ addressComponent.businessAreas;
+ {
+ const businessArea = addressComponent.businessAreas[0];
+ // $ExpectType string
+ businessArea.id;
+ // $ExpectType LngLat
+ businessArea.location;
+ // $ExpectType string
+ businessArea.name;
+ }
+ // $ExpectType string
+ addressComponent.city;
+ // $ExpectType string
+ addressComponent.citycode;
+ // $ExpectType string
+ addressComponent.district;
+ // $ExpectType string
+ addressComponent.neighborhood;
+ // $ExpectType string
+ addressComponent.neighborhoodType;
+ // $ExpectType string
+ addressComponent.province;
+ // $ExpectType string
+ addressComponent.street;
+ // $ExpectType string
+ addressComponent.streetNumber;
+ // $ExpectType string
+ addressComponent.township;
+ }
+ // $ExpectType Cross[]
+ regeocode.crosses;
+ {
+ const cross = regeocode.crosses[0];
+ // $ExpectType string
+ cross.direction;
+ // $ExpectType number
+ cross.distance;
+ // $ExpectType string
+ cross.first_id;
+ // $ExpectType string
+ cross.first_name;
+ // $ExpectType LngLat
+ cross.location;
+ // $ExpectType string
+ cross.second_id;
+ // $ExpectType string
+ cross.second_name;
+ }
+ // $ExpectType string
+ regeocode.formattedAddress;
+ // $ExpectType ReGeocodePoi[]
+ regeocode.pois;
+ {
+ const poi = regeocode.pois[0];
+ // $ExpectType string
+ poi.address;
+ // $ExpectType string
+ poi.businessArea;
+ // $ExpectType string
+ poi.direction;
+ // $ExpectType number
+ poi.distance;
+ // $ExpectType string
+ poi.id;
+ // $ExpectType LngLat
+ poi.location;
+ // $ExpectType string
+ poi.name;
+ // $ExpectType string
+ poi.tel;
+ // $ExpectType string
+ poi.type;
+ }
+ // $ExpectType Road[]
+ regeocode.roads;
+ {
+ const road = regeocode.roads[0];
+ // $ExpectType string
+ road.direction;
+ // $ExpectType number
+ road.distance;
+ // $ExpectType string
+ road.id;
+ // $ExpectType LngLat
+ road.location;
+ // $ExpectType string
+ road.name;
+ }
+ } else {
+ // $ExpectType string
+ result;
+ }
+});
+
+// $ExpectType void
+geocoder.getAddress([lnglat, lnglat], (status, result) => {
+ if (typeof result !== 'string') {
+ // $ExpectType ReGeocode[]
+ result.regeocodes;
+ }
+});
+
+geocoder.on('error', (event: AMap.Geocoder.EventMap['error']) => {
+ // $ExpectType "error"
+ event.type;
+ // $ExpectType string
+ event.info;
+});
+
+geocoder.on('complete', (event: AMap.Geocoder.EventMap['complete']) => {
+ // $ExpectType "complete"
+ event.type;
+ if ('info' in event) {
+ // $ExpectType string
+ event.info;
+ }
+ if ('geocodes' in event) {
+ // $ExpectType string
+ event.resultNum;
+ }
+ if ('regeocode' in event) {
+ // $ExpectType ReGeocode
+ event.regeocode;
+ }
+ if ('regeocodes' in event) {
+ // $ExpectType ReGeocode[]
+ event.regeocodes;
+ }
+});
+
+// $ExpectType void
+geocoder.getAddress(lnglatTuple, () => { });
+// $ExpectType void
+geocoder.getAddress([lnglatTuple, lnglatTuple], () => { });
diff --git a/types/amap-js-api-geocoder/index.d.ts b/types/amap-js-api-geocoder/index.d.ts
new file mode 100644
index 0000000000..91b0d12db5
--- /dev/null
+++ b/types/amap-js-api-geocoder/index.d.ts
@@ -0,0 +1,373 @@
+// Type definitions for non-npm package amap-js-api-geocoder 1.4
+// Project: https://lbs.amap.com/api/javascript-api/reference/lnglat-to-address#m_AMap.Geocoder
+// Definitions by: breeze9527
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+///
+
+declare namespace AMap {
+ namespace Geocoder {
+ interface EventMap {
+ complete: Event<'complete', GeocodeResult | {} | ReGeocodeResult | BatchReGeocodeResult>;
+ error: Event<'error', { info: string }>;
+ }
+ interface Options {
+ /**
+ * 城市
+ */
+ city?: string;
+ /**
+ * 中心点
+ */
+ radius?: number;
+ /**
+ * 语言类型
+ */
+ lang?: Lang;
+ /**
+ * 是否批量查询
+ */
+ batch?: boolean;
+ /**
+ * 是否返回详细信息
+ */
+ extensions?: 'base' | 'all';
+ }
+ interface BuildingArea {
+ /**
+ * 唯一标识
+ */
+ id: string;
+ /**
+ * 名称
+ */
+ name: string;
+ /**
+ * 中心点经纬度
+ */
+ location: LngLat;
+ }
+ interface GeocodeAddressComponent {
+ /**
+ * 社区
+ */
+ neighborhood: string;
+ /**
+ * 社区类型
+ */
+ neighborhoodType: string;
+ /**
+ * 楼/大厦
+ */
+ building: string;
+ /**
+ * 楼类型
+ */
+ buildingType: string;
+ /**
+ * 省
+ */
+ province: string;
+ /**
+ * 城市
+ */
+ city: string;
+ /**
+ * 区
+ */
+ district: string;
+ /**
+ * 乡镇
+ */
+ township: string;
+ /**
+ * 城市编码
+ */
+ citycode: string;
+ /**
+ * 街道
+ */
+ street: string;
+ /**
+ * 门牌号
+ */
+ streetNumber: string;
+ }
+ interface ReGeocodeAddressComponent {
+ /**
+ * 城市编码
+ */
+ citycode: string;
+ /**
+ * 区域编码
+ */
+ adcode: string;
+ /**
+ * 所属商圈信息
+ */
+ businessAreas: BuildingArea[];
+ /**
+ * 社区
+ */
+ neighborhoodType: string;
+ /**
+ * 社区类型
+ */
+ neighborhood: string;
+ /**
+ * 楼/大厦
+ */
+ building: string;
+ /**
+ * 楼类型
+ */
+ buildingType: string;
+ /**
+ * 街道
+ */
+ street: string;
+ /**
+ * 门牌号
+ */
+ streetNumber: string;
+ /**
+ * 省
+ */
+ province: string;
+ /**
+ * 城市
+ */
+ city: string;
+ /**
+ * 区
+ */
+ district: string;
+ /**
+ * 乡镇
+ */
+ township: string;
+ }
+ interface Geocode {
+ /**
+ * 地址组成元素
+ */
+ addressComponent: GeocodeAddressComponent;
+ /**
+ * 格式化地址
+ */
+ formattedAddress: string;
+ /**
+ * 坐标
+ */
+ location: LngLat;
+ /**
+ * 区域编码
+ */
+ adcode: string;
+ /**
+ * 给定地址匹配级别
+ */
+ level: string;
+ }
+ interface GeocodeResult {
+ /**
+ * 状态说明
+ */
+ info: string;
+ /**
+ * 地理编码结果数目
+ */
+ resultNum: string;
+ /**
+ * 地理编码结果
+ */
+ geocodes: Geocode[];
+ }
+ interface Road {
+ /**
+ * 唯一标识
+ */
+ id: string;
+ /**
+ * 名称
+ */
+ name: string;
+ /**
+ * 道路离查询点最近距离
+ */
+ distance: number;
+ /**
+ * 道路上离查询点最近的点坐标
+ */
+ location: LngLat;
+ /**
+ * 与查询点的相对方位
+ */
+ direction: string;
+ }
+ interface Cross {
+ /**
+ * 道路离查询点最近距离
+ */
+ distance: number;
+ /**
+ * 与查询点的相对方位
+ */
+ direction: string;
+ /**
+ * 经纬度
+ */
+ location: LngLat;
+ /**
+ * 第一条道路id
+ */
+ first_id: string;
+ /**
+ * 第一条道路名称
+ */
+ first_name: string;
+ /**
+ * 第二条道路id
+ */
+ second_id: string;
+ /**
+ * 第二条道路名称
+ */
+ second_name: string;
+ }
+ interface ReGeocodePoi {
+ /**
+ * 唯一标识
+ */
+ id: string;
+ /**
+ * 名称
+ */
+ name: string;
+ /**
+ * 类型
+ */
+ type: string;
+ /**
+ * 电话
+ */
+ tel: string;
+ /**
+ * 该Poi到请求坐标的距离
+ */
+ distance: number;
+ /**
+ * 该Poi相对于请求坐标的方向
+ */
+ direction: string;
+ /**
+ * 址信息
+ */
+ address: string;
+ /**
+ * 坐标
+ */
+ location: LngLat;
+ /**
+ * 商圈名称
+ */
+ businessArea: string;
+ }
+ interface ReGeocodeAoi {
+ adcode: string;
+ area: string;
+ id: string;
+ location: LngLat;
+ name: string;
+ type: string;
+ }
+ interface ReGeocode {
+ /**
+ * 地址组成元素
+ */
+ addressComponent: ReGeocodeAddressComponent;
+ /**
+ * 格式化地址
+ */
+ formattedAddress: string;
+ /**
+ * 道路信息列表
+ */
+ roads: Road[];
+ /**
+ * 道路路口列表
+ */
+ crosses: Cross[];
+ /**
+ * 兴趣点列表
+ */
+ pois: ReGeocodePoi[];
+ aois?: ReGeocodeAoi[];
+ }
+ interface ReGeocodeResult {
+ /**
+ * 状态说明
+ */
+ info: string;
+ /**
+ * 逆地理编码结果
+ */
+ regeocode: ReGeocode;
+ }
+ interface BatchReGeocodeResult {
+ /**
+ * 状态说明
+ */
+ info: string;
+ /**
+ * 批量逆地理编码结果
+ */
+ regeocodes: ReGeocode[];
+ }
+ type SearchStatus = 'complete' | 'no_data' | 'error';
+ }
+ class Geocoder extends EventEmitter {
+ /**
+ * 地理编码与逆地理编码
+ * @param options 选项
+ */
+ constructor(options?: Geocoder.Options);
+ /**
+ * 根据给定的地址描述进行解析
+ * @param address 地址描述
+ * @param callback 回调
+ */
+ getLocation(
+ address: string | string[],
+ callback: (status: Geocoder.SearchStatus, result: Geocoder.GeocodeResult | string) => void
+ ): void;
+ /**
+ * 设置地址描述所在城市
+ * @param city 城市
+ */
+ setCity(city?: string): void;
+ /**
+ * 根据给定坐标进行解析
+ * @param location 坐标
+ * @param callback 回调
+ */
+ getAddress(
+ location: LocationValue,
+ callback: (status: Geocoder.SearchStatus, result: Geocoder.ReGeocodeResult | string) => void
+ ): void;
+ /**
+ * 根据给定坐标进行解析
+ * @param locations 坐标数组
+ * @param callback 回调
+ */
+ getAddress(
+ locations: LocationValue[],
+ callback: (status: Geocoder.SearchStatus, result: Geocoder.BatchReGeocodeResult | string) => void
+ ): void;
+
+ // internal
+ setLang(lang?: Lang): void;
+ getLang(): Lang | undefined;
+ }
+}
diff --git a/types/amap-js-api-geocoder/tsconfig.json b/types/amap-js-api-geocoder/tsconfig.json
new file mode 100644
index 0000000000..58571ba460
--- /dev/null
+++ b/types/amap-js-api-geocoder/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6",
+ "dom"
+ ],
+ "noEmit": true,
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "amap-js-api-geocoder-tests.ts"
+ ]
+}
diff --git a/types/filenamify/tslint.json b/types/amap-js-api-geocoder/tslint.json
similarity index 100%
rename from types/filenamify/tslint.json
rename to types/amap-js-api-geocoder/tslint.json
diff --git a/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts
new file mode 100644
index 0000000000..f6efc2dc54
--- /dev/null
+++ b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts
@@ -0,0 +1,114 @@
+// $ExpectType IndoorMap
+new AMap.IndoorMap();
+// $ExpectType IndoorMap
+new AMap.IndoorMap({});
+// $ExpectType IndoorMap
+const indoorMap = new AMap.IndoorMap({
+ zIndex: 1,
+ opacity: 0.5,
+ cursor: 'cursor',
+ hideFloorBar: false,
+ alaysShow: true
+});
+
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId');
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId', (error, result) => {
+ // $ExpectType Error | null
+ error;
+ // $ExpectType SearchResult
+ result;
+ // $ExpectType string
+ result.id;
+ // $ExpectType 0 | 1
+ result.status;
+ if (result.status === 0) {
+ // $ExpectType Building
+ const building = result.building;
+ {
+ // $ExpectType number
+ building.floor;
+ // $ExpectType FloorDetails
+ const floorDetails = building.floor_details;
+ {
+ // $ExpectType number[]
+ floorDetails.floor_indexs;
+ // $ExpectType string[]
+ floorDetails.floor_names;
+ // $ExpectType string[]
+ floorDetails.floor_nonas;
+ }
+ // $ExpectType string
+ building.id;
+ // $ExpectType LngLat
+ building.lnglat;
+ // $ExpectType string
+ building.name;
+ }
+ } else {
+ // $ExpectType Error
+ result.error;
+ }
+});
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId', 1);
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId', 1, () => { });
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId', 1, 'shopId');
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', () => { });
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true);
+// $ExpectType void
+indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true, () => { });
+
+let floor: undefined | false;
+floor = indoorMap.showFloor(1);
+floor = indoorMap.showFloor(1, true);
+
+// $ExpectType void
+indoorMap.showFloorBar();
+
+// $ExpectType void
+indoorMap.hideFloorBar();
+
+// $ExpectType void
+indoorMap.hideLabels();
+
+// $ExpectType string | null
+indoorMap.getSelectedBuildingId();
+
+// $ExpectType Building | null
+const building = indoorMap.getSelectedBuilding();
+if (building) {
+ // $ExpectType number
+ building.floor;
+ // $ExpectType FloorDetails
+ building.floor_details;
+ // $ExpectType string
+ building.id;
+ // $ExpectType LngLat
+ building.lnglat;
+ // $ExpectType string
+ building.name;
+}
+
+indoorMap.on('complete', (event: AMap.IndoorMap.EventMap['complete']) => {
+ // $ExpectType "complete"
+ event.type;
+});
+
+indoorMap.on('click', (event: AMap.IndoorMap.EventMap['click']) => {
+ // $ExpectType string
+ event.building_id;
+ // $ExpectType number
+ event.floor;
+ // $ExpectType LngLat
+ event.lnglat;
+ // $ExpectType Shop
+ event.shop;
+ // $ExpectType "click"
+ event.type;
+});
diff --git a/types/amap-js-api-indoor-map/index.d.ts b/types/amap-js-api-indoor-map/index.d.ts
new file mode 100644
index 0000000000..9b30ea1722
--- /dev/null
+++ b/types/amap-js-api-indoor-map/index.d.ts
@@ -0,0 +1,239 @@
+// Type definitions for non-npm package amap-js-api-indoor-map 1.4
+// Project: https://lbs.amap.com/api/javascript-api/reference/indoormap
+// Definitions by: breeze9527
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+///
+
+declare namespace AMap {
+ namespace IndoorMap {
+ interface EventMap {
+ complete: Event<'complete'>;
+ click: MouseEvent<'click'>;
+
+ floor_complete: Event<'floor_complete', SearchResult>;
+ mouseover: MouseEvent<'mouseover'>;
+ mouseout: MouseEvent<'mouseout'>;
+ }
+ type MouseEvent = Event;
+ interface Options extends Layer.Options {
+ /**
+ * 图层叠加的顺序值
+ */
+ zIndex?: number;
+ /**
+ * 图层的透明度
+ */
+ opacity?: number;
+ /**
+ * 鼠标悬停到店铺面时的鼠标样式
+ */
+ cursor?: string;
+ /**
+ * 是否隐藏楼层切换控件
+ */
+ hideFloorBar?: boolean;
+ /**
+ * 是否持续显示
+ */
+ alaysShow?: boolean;
+
+ // internal
+ visible?: boolean;
+ featurezIndex?: number;
+ zooms?: [number, number];
+ disableIconRender?: boolean;
+ disableLabelRender?: boolean;
+ disableHoverMarker?: boolean;
+ autoLoadBuildingsInTile?: boolean;
+ }
+ interface FloorDetails {
+ /**
+ * 各楼层索引
+ */
+ floor_indexs: number[];
+ /**
+ * 各楼层英文
+ */
+ floor_nonas: string[];
+ /**
+ * 各楼层名字
+ */
+ floor_names: string[];
+ }
+ type ShopCategory = 'public' | 'connection' | 'shop';
+ interface Shop {
+ /**
+ * 店铺的id
+ */
+ id: string;
+ /**
+ * 兴趣点ID
+ */
+ poiId: string;
+ /**
+ * 店铺所属楼宇ID
+ */
+ building_id: string;
+ /**
+ * 店铺名称
+ */
+ name: string;
+ /**
+ * 店铺的经纬度
+ */
+ lnglat: LngLat;
+ /**
+ * 分类
+ */
+ category: ShopCategory;
+ }
+ interface Building {
+ /**
+ * 所属楼宇ID
+ */
+ id: string;
+ /**
+ * 楼层名称
+ */
+ name: string;
+ /**
+ * 楼层的经纬度
+ */
+ lnglat: LngLat;
+ /**
+ * 所在楼层
+ */
+ floor: number;
+ floor_details: FloorDetails;
+ }
+ interface SearchSuccessResult {
+ /**
+ * 楼层的id
+ */
+ id: string;
+ status: 0;
+ /**
+ * 建筑信息
+ */
+ building: Building;
+ }
+ interface SearchErrorResult {
+ /**
+ * 楼宇id
+ */
+ id: string;
+ status: 1;
+ error: Error;
+ }
+ type SearchResult = SearchSuccessResult | SearchErrorResult;
+ }
+
+ class IndoorMap extends Layer {
+ /**
+ * 室内地图
+ * @param options 选项
+ */
+ constructor(options?: IndoorMap.Options);
+ /**
+ * 显示指定室内地图信息
+ * @param indoorId 建筑物ID
+ * @param callback 回调
+ */
+ showIndoorMap(
+ indoorId: string,
+ callback?: (error: null | Error, result: IndoorMap.SearchResult) => void
+ ): void;
+ /**
+ * 显示指定室内地图信息
+ * @param indoorId 建筑物ID
+ * @param floor 楼层
+ * @param callback 回调
+ */
+ showIndoorMap(
+ indoorId: string,
+ floor?: number,
+ callback?: (error: null | Error, result: IndoorMap.SearchResult) => void
+ ): void;
+ /**
+ * 显示指定室内地图信息
+ * @param indoorId 建筑物ID
+ * @param floor 楼层
+ * @param shopId 商铺ID
+ * @param callback 回调
+ */
+ showIndoorMap(
+ indoorId: string,
+ floor?: number,
+ shopId?: string,
+ callback?: (error: null | Error, result: IndoorMap.SearchResult) => void
+ ): void;
+ /**
+ * 显示指定室内地图信息
+ * @param indoorId 建筑物ID
+ * @param floor 楼层
+ * @param shopId 商铺ID
+ * @param noMove 阻止移动
+ * @param callback 回调
+ */
+ showIndoorMap(
+ indoorId: string,
+ floor?: number,
+ shopId?: string,
+ noMove?: boolean,
+ callback?: (error: null | Error, result: IndoorMap.SearchResult) => void
+ ): void;
+ /**
+ * 显示指定的楼层
+ * @param floor 楼层
+ * @param noMove 禁止移动
+ */
+ showFloor(floor: number, noMove?: boolean): false | undefined;
+ /**
+ * 显示楼层切换控件
+ */
+ showFloorBar(): void;
+ /**
+ * 隐藏楼层切换控件
+ */
+ hideFloorBar(): void;
+ /**
+ * 显示室内地图标注
+ */
+ showLabels(): void;
+ /**
+ * 隐藏室内地图标注
+ */
+ hideLabels(): void;
+ /**
+ * 获取处于被选中状态的室内地图的ID
+ */
+ getSelectedBuildingId(): string | null;
+ /**
+ * 获取处于被选中状态的室内地图的一些基本信息
+ */
+ getSelectedBuilding(): IndoorMap.Building | null;
+
+ // internal
+ getFloorBar(): void;
+ setSelectedBuildingId(id: string): void;
+ }
+}
diff --git a/types/amap-js-api-indoor-map/tsconfig.json b/types/amap-js-api-indoor-map/tsconfig.json
new file mode 100644
index 0000000000..da736c3c7b
--- /dev/null
+++ b/types/amap-js-api-indoor-map/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6",
+ "dom"
+ ],
+ "noEmit": true,
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "amap-js-api-indoor-map-tests.ts"
+ ]
+}
diff --git a/types/get-port/tslint.json b/types/amap-js-api-indoor-map/tslint.json
similarity index 100%
rename from types/get-port/tslint.json
rename to types/amap-js-api-indoor-map/tslint.json
diff --git a/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts b/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts
new file mode 100644
index 0000000000..ec89b74476
--- /dev/null
+++ b/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts
@@ -0,0 +1,489 @@
+/**
+ * preset.ts
+ */
+
+declare const map: AMap.Map;
+declare const lnglat: AMap.LngLat;
+declare const size: AMap.Size;
+declare const lnglatTuple: [number, number];
+declare const pixel: AMap.Pixel;
+declare const layer: AMap.Layer;
+declare const ambientLight: AMap.Lights.AmbientLight;
+declare const directionLight: AMap.Lights.DirectionLight;
+declare const line: AMap.Object3D.Line;
+declare const mesh: AMap.Object3D.Mesh;
+declare const object3d: AMap.Object3D;
+declare const geometry: AMap.Geometry3D.Mesh;
+
+/**
+ * lights.ts
+ */
+
+// $ExpectType AmbientLight
+const testAmbientLight = new AMap.Lights.AmbientLight([0.1, 0, 0.1], 1);
+
+// $ExpectType void
+testAmbientLight.setColor([0.1, 1, 0.5]);
+
+// $ExpectType void
+testAmbientLight.setIntensity(1);
+
+// $ExpectType DirectionLight
+const testDirectionLight = new AMap.Lights.DirectionLight([1, 2, 3], [1, 2, 3], 1);
+
+// $ExpectType void
+testDirectionLight.setColor([1, 2, 3]);
+
+// $ExpectType void
+testDirectionLight.setIntensity(1);
+
+// $ExpectType void
+testDirectionLight.setDirection([1, 2, 3]);
+
+/**
+ * map3d.ts
+ */
+
+// $ExpectType Object3DResult | null
+map.getObject3DByContainerPos(pixel);
+
+// $ExpectType Object3DResult | null
+const containserPos = map.getObject3DByContainerPos(pixel, [layer], true);
+if (containserPos) {
+ // $ExpectType number
+ containserPos.index;
+ // $ExpectType Vector3
+ containserPos.point;
+ // $ExpectType number
+ containserPos.distance;
+ // $ExpectType Object3D
+ containserPos.object;
+} else {
+ // $ExpectType null
+ containserPos;
+}
+
+map.AmbientLight = ambientLight;
+map.AmbientLight = undefined;
+
+map.DirectionLight = directionLight;
+map.DirectionLight = undefined;
+
+/**
+ * object3d-group.ts
+ */
+
+// $ExpectType Object3DGroup
+const testObject3dGroup1 = new AMap.Object3DGroup();
+// $ExpectType Object3DGroup
+const testObject3dGroup2 = new AMap.Object3DGroup();
+
+// $ExpectType Object3D[]
+testObject3dGroup1.children;
+// $ExpectType Mesh[]
+testObject3dGroup2.children;
+
+// $ExoectType void
+testObject3dGroup1.add(line);
+// $ExoectType void
+testObject3dGroup1.add(mesh);
+// $ExoectType void
+testObject3dGroup2.add(mesh);
+// $ExpectError
+testObject3dGroup2.add(line);
+
+// $ExoectType void
+testObject3dGroup1.remove(line);
+// $ExoectType void
+testObject3dGroup1.remove(mesh);
+// $ExoectType void
+testObject3dGroup2.remove(mesh);
+// $ExpectError
+testObject3dGroup2.remove(line);
+
+/**
+ * object3d-Layer.ts
+ */
+
+// $ExpectType Object3DLayer
+new AMap.Object3DLayer();
+// $ExpectType Object3DLayer
+new AMap.Object3DLayer({});
+// $ExpectType Object3DLayer
+const testObject3DLayer = new AMap.Object3DLayer({
+ map,
+ visible: true,
+ opacity: 0.1,
+ zIndex: 2,
+ zooms: [1, 2]
+});
+
+// $ExpectType void
+testObject3DLayer.setMap(null);
+// $ExpectType void
+testObject3DLayer.setMap(map);
+
+// $ExpectType Map | null | undefined
+testObject3DLayer.getMap();
+
+// $ExpectType void
+testObject3DLayer.hide();
+
+// $ExpectType void
+testObject3DLayer.show();
+
+// $ExpectType void
+testObject3DLayer.setOpacity(1);
+
+// $ExpectType number
+testObject3DLayer.getOpacity();
+
+// $ExpectType void
+testObject3DLayer.setzIndex(1);
+
+// $ExpectType number
+testObject3DLayer.getzIndex();
+
+// $ExpectType [number, number]
+testObject3DLayer.getZooms();
+
+// $ExpectType void
+testObject3DLayer.add(object3d);
+
+// $ExpectType void
+testObject3DLayer.remove(object3d);
+
+// $ExpectType void
+testObject3DLayer.clear();
+
+// $ExpectType void
+testObject3DLayer.reDraw();
+
+/**
+ * vector3.ts
+ */
+
+// $ExpectType Vector3
+const testVector = new AMap.Vector3([1, 2, 3]);
+// $ExpectType Vector3
+new AMap.Vector3(testVector);
+
+// $ExpectType [number, number, number]
+testVector.elements;
+
+// $ExpectType void
+testVector.set(1, 2, 3);
+
+// $ExpectType number
+testVector.dot();
+
+// $ExpectType Vector3
+testVector.clone();
+
+// $ExpectType Vector3
+testVector.add(testVector);
+// $ExpectType Vector3
+testVector.add([1, 2, 3]);
+
+// $ExpectType Vector3
+testVector.sub(testVector);
+// $ExpectType Vector3
+testVector.sub([1, 2, 3]);
+
+// $ExpectType Vector3
+testVector.addVectors(testVector, testVector);
+
+// $ExpectType Vector3
+testVector.subVectors(testVector, testVector);
+
+// $ExpectType Vector3
+testVector.crossVectors(testVector, testVector);
+
+// $ExpectType Vector3
+testVector.normalize();
+
+// $ExpectType number
+testVector.length();
+
+/**
+ * object3d/mesh.ts
+ */
+
+// $ExpectType Mesh
+const testMesh = new AMap.Object3D.Mesh();
+
+// $ExpectError
+testMesh.geometry = geometry;
+
+// $ExpectType number[]
+testMesh.geometry.vertices;
+// $ExpectError
+testMesh.geometry.vertices = [];
+testMesh.geometry.vertices.shift();
+
+// $ExpectType number[]
+testMesh.geometry.vertexColors;
+// $ExpectError
+testMesh.geometry.vertexColors = [];
+testMesh.geometry.vertexColors.shift();
+
+// $ExpectType number[]
+testMesh.geometry.vertexUVs;
+// $ExpectError
+testMesh.geometry.vertexUVs = [];
+testMesh.geometry.vertexUVs.shift();
+
+// $ExpectType number[]
+testMesh.geometry.faces;
+// $ExpectError
+testMesh.geometry.faces = [];
+testMesh.geometry.faces.shift();
+
+// $ExpectType number[]
+testMesh.geometry.textureIndices;
+// $ExpectError
+testMesh.geometry.textureIndices = [];
+testMesh.geometry.textureIndices.shift();
+
+// $ExpectType (string | HTMLCanvasElement)[]
+testMesh.textures;
+
+// $ExpectType boolean
+testMesh.needUpdate;
+
+// $ExpectType boolean
+testMesh.transparent;
+
+// $ExpectType boolean
+testMesh.DEPTH_TEST;
+
+// $ExpectType void
+testMesh.reDraw();
+
+/**
+ * object3d/meshAcceptLights.ts
+ */
+
+// $ExpectType MeshAcceptLights
+const testMeshAcceptLights = new AMap.Object3D.MeshAcceptLights();
+
+// $ExpectError
+testMeshAcceptLights.geometry = geometry;
+
+// $ExpectType number[]
+testMeshAcceptLights.geometry.vertices;
+// $ExpectError
+testMeshAcceptLights.geometry.vertices = [];
+testMeshAcceptLights.geometry.vertices.shift();
+
+// $ExpectType number[]
+testMeshAcceptLights.geometry.vertexColors;
+// $ExpectError
+testMeshAcceptLights.geometry.vertexColors = [];
+testMeshAcceptLights.geometry.vertexColors.shift();
+
+// $ExpectType number[]
+testMeshAcceptLights.geometry.vertexUVs;
+// $ExpectError
+testMeshAcceptLights.geometry.vertexUVs = [];
+testMeshAcceptLights.geometry.vertexUVs.shift();
+
+// $ExpectType number[]
+testMeshAcceptLights.geometry.faces;
+// $ExpectError
+testMeshAcceptLights.geometry.faces = [];
+testMeshAcceptLights.geometry.faces.shift();
+
+// $ExpectType number[]
+testMeshAcceptLights.geometry.textureIndices;
+// $ExpectError
+testMeshAcceptLights.geometry.textureIndices = [];
+testMeshAcceptLights.geometry.textureIndices.shift();
+
+// $ExpectType number[]
+testMeshAcceptLights.geometry.vertexNormals;
+// $ExpectError
+testMeshAcceptLights.geometry.vertexNormals = [];
+testMeshAcceptLights.geometry.vertexNormals.shift();
+
+// $ExpectType (string | HTMLCanvasElement)[]
+testMeshAcceptLights.textures;
+
+// $ExpectType boolean
+testMeshAcceptLights.needUpdate;
+
+// $ExpectType boolean
+testMeshAcceptLights.transparent;
+
+// $ExpectType boolean
+testMeshAcceptLights.DEPTH_TEST;
+
+// $ExpectType void
+testMeshAcceptLights.reDraw();
+
+/**
+ * object3d/meshLine.ts
+ */
+
+// $ExpectError
+new AMap.Object3D.MeshLine();
+// $ExpectError
+new AMap.Object3D.MeshLine({});
+// $ExpectType MeshLine
+const testMeshLine = new AMap.Object3D.MeshLine({
+ path: [lnglat],
+ width: 1,
+ height: 1,
+ color: 'red'
+});
+// $ExpectType MeshLine
+new AMap.Object3D.MeshLine({
+ path: [lnglat],
+ color: [0, 0, 1, 1]
+});
+// $ExpectType MeshLine
+new AMap.Object3D.MeshLine({
+ path: [[1, 2]]
+});
+// $ExpectType MeshLine
+new AMap.Object3D.MeshLine({
+ path: [lnglat],
+ unit: 'meter'
+});
+// $ExpectType MeshLine
+new AMap.Object3D.MeshLine({
+ path: [pixel],
+ unit: 'px'
+});
+// $ExpectError
+new AMap.Object3D.MeshLine({
+ path: [lnglat],
+ unit: 'px'
+});
+// $ExpectError
+new AMap.Object3D.MeshLine({
+ path: [pixel],
+ unit: 'meter'
+});
+
+// $ExpectType number[]
+testMeshLine.geometry.vertices;
+// $ExpectError
+testMeshLine.geometry.vertices = [];
+testMeshLine.geometry.vertices.shift();
+
+// $ExpectType number[]
+testMeshLine.geometry.vertexUVs;
+// $ExpectError
+testMeshLine.geometry.vertexUVs = [];
+testMeshLine.geometry.vertexUVs.shift();
+
+// $ExpectType number[]
+testMeshLine.geometry.vertexColors;
+// $ExpectError
+testMeshLine.geometry.vertexColors = [];
+testMeshLine.geometry.vertexColors.shift();
+
+// $ExpectType number[]
+testMeshLine.geometry.vertexColors;
+// $ExpectError
+testMeshLine.geometry.vertexColors = [];
+testMeshLine.geometry.vertexColors.shift();
+
+// $ExpectType number[]
+testMeshLine.geometry.vertexIndices;
+// $ExpectError
+testMeshLine.geometry.vertexIndices = [];
+testMeshLine.geometry.vertexIndices.shift();
+
+// $ExpectType number[]
+testMeshLine.geometry.directions;
+// $ExpectError
+testMeshLine.geometry.directions = [];
+testMeshLine.geometry.directions.shift();
+
+// $ExpectType number[]
+testMeshLine.geometry.textureIndices;
+// $ExpectError
+testMeshLine.geometry.textureIndices = [];
+testMeshLine.geometry.textureIndices.shift();
+
+// $ExpectType number
+testMeshLine.width;
+
+// $ExpectType void
+testMeshLine.setPath([lnglat]);
+// $ExpectType void
+testMeshLine.setPath([lnglatTuple]);
+// $ExpectType void
+testMeshLine.setPath([pixel]);
+
+// $ExpectType void
+testMeshLine.setWidth(10);
+
+// $ExpectType void
+testMeshLine.setHeight(10);
+
+// $ExpectType void
+testMeshLine.setColor('red');
+
+/**
+ * object3d/prism.ts
+ */
+
+// $ExpectError
+new AMap.Object3D.Prism();
+// $ExpectError
+new AMap.Object3D.Prism({});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [lnglat],
+ color: 'red'
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [lnglat],
+ color: 'red',
+ height: 1,
+ color2: 'blue'
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [pixel],
+ color: 'red'
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [lnglat],
+ color: 'red'
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [[lnglat]],
+ color: 'red'
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [[pixel]],
+ color: 'red'
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [[lnglatTuple]],
+ color: 'red'
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [lnglat],
+ color: ['red']
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [lnglat],
+ color: [1, 1, 1, 1]
+});
+// $ExpectType Prism
+new AMap.Object3D.Prism({
+ path: [lnglat],
+ color: [[1, 1, 1, 1]]
+});
diff --git a/types/amap-js-api-map3d/geometry-3d.d.ts b/types/amap-js-api-map3d/geometry-3d.d.ts
new file mode 100644
index 0000000000..edb4fd2a85
--- /dev/null
+++ b/types/amap-js-api-map3d/geometry-3d.d.ts
@@ -0,0 +1,28 @@
+declare namespace AMap {
+ abstract class Geometry3D {
+ readonly vertices: number[];
+ readonly vertexUVs: number[];
+ readonly vertexColors: number[];
+ }
+
+ namespace Geometry3D {
+ class Mesh extends Geometry3D {
+ readonly type: 'mesh';
+ readonly faces: number[];
+ readonly textureIndices: number[];
+ }
+
+ class Line extends Geometry3D {
+ readonly type: 'line';
+ readonly segments: number[];
+ readonly textureIndices: number[];
+ }
+
+ class Points extends Geometry3D {
+ readonly type: 'points';
+ readonly pointSizes: number[];
+ readonly pointAreas: number[];
+ readonly textureIndices: number[];
+ }
+ }
+}
diff --git a/types/amap-js-api-map3d/index.d.ts b/types/amap-js-api-map3d/index.d.ts
new file mode 100644
index 0000000000..43be45eb13
--- /dev/null
+++ b/types/amap-js-api-map3d/index.d.ts
@@ -0,0 +1,15 @@
+// Type definitions for non-npm package amap-js-api-map3d 1.4
+// Project: https://lbs.amap.com/api/javascript-api/reference/maps-3d
+// Definitions by: breeze9527
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+///
+
+///
+///
+///
+///
+///
+///
+///
diff --git a/types/amap-js-api-map3d/lights.d.ts b/types/amap-js-api-map3d/lights.d.ts
new file mode 100644
index 0000000000..b637ee79ef
--- /dev/null
+++ b/types/amap-js-api-map3d/lights.d.ts
@@ -0,0 +1,17 @@
+declare namespace AMap {
+ namespace Lights {
+ class AmbientLight {
+ constructor(color: [number, number, number], intensity: number);
+ setColor(color: [number, number, number]): void;
+ setIntensity(intensity: number): void;
+ }
+
+ class DirectionLight {
+ constructor(direction: [number, number, number], color: [number, number, number], intensity: number);
+ update(): void;
+ setDirection(direction: [number, number, number]): void;
+ setColor(direction: [number, number, number]): void;
+ setIntensity(intensity: number): void;
+ }
+ }
+}
diff --git a/types/amap-js-api-map3d/map3d.d.ts b/types/amap-js-api-map3d/map3d.d.ts
new file mode 100644
index 0000000000..f2345f1a30
--- /dev/null
+++ b/types/amap-js-api-map3d/map3d.d.ts
@@ -0,0 +1,15 @@
+declare namespace AMap {
+ namespace Map {
+ interface Object3DResult {
+ index: number;
+ point: Vector3;
+ distance: number;
+ object: Object3D;
+ }
+ }
+ interface Map {
+ AmbientLight?: Lights.AmbientLight;
+ DirectionLight?: Lights.DirectionLight;
+ getObject3DByContainerPos(pixel: Pixel, layers?: Layer[], all?: boolean): Map.Object3DResult | null;
+ }
+}
diff --git a/types/amap-js-api-map3d/object3d-group.d.ts b/types/amap-js-api-map3d/object3d-group.d.ts
new file mode 100644
index 0000000000..4c1f4d90d3
--- /dev/null
+++ b/types/amap-js-api-map3d/object3d-group.d.ts
@@ -0,0 +1,8 @@
+declare namespace AMap {
+ class Object3DGroup extends Object3D {
+ constructor();
+ children: C[];
+ add(object3d: C): void;
+ remove(object3d: C): void;
+ }
+}
diff --git a/types/amap-js-api-map3d/object3d-layer.d.ts b/types/amap-js-api-map3d/object3d-layer.d.ts
new file mode 100644
index 0000000000..de29a0bfd9
--- /dev/null
+++ b/types/amap-js-api-map3d/object3d-layer.d.ts
@@ -0,0 +1,27 @@
+declare namespace AMap {
+ namespace Object3DLayer {
+ interface Options {
+ map?: Map;
+ visible?: boolean;
+ opacity?: number;
+ zIndex?: number;
+ zooms?: [number, number];
+ }
+ }
+
+ class Object3DLayer extends Layer {
+ constructor(options?: Object3DLayer.Options)
+ add(object3d: Object3D): void;
+ remove(object3d: Object3D): void;
+ clear(): void;
+ reDraw(): void;
+
+ // internal
+ setOption(options: {
+ position?: number;
+ scale?: number;
+ height?: number;
+ scene?: number;
+ }): void;
+ }
+}
diff --git a/types/amap-js-api-map3d/object3d.d.ts b/types/amap-js-api-map3d/object3d.d.ts
new file mode 100644
index 0000000000..32f63e2378
--- /dev/null
+++ b/types/amap-js-api-map3d/object3d.d.ts
@@ -0,0 +1,92 @@
+declare namespace AMap {
+ class Object3D {
+ readonly geometry: Geometry3D;
+ transparent: boolean;
+ DEPTH_TEST: boolean;
+ textures: Array;
+ needUpdate: boolean;
+ reDraw(): void;
+
+ // internal
+ reset(): void;
+ }
+
+ namespace Object3D {
+ class Mesh extends Object3D {
+ readonly geometry: Geometry3D.Mesh;
+ }
+
+ class MeshAcceptLights extends Mesh {
+ readonly geometry: Geometry3D.Mesh & { readonly vertexNormals: number[] };
+ }
+
+ namespace Prism {
+ interface Options {
+ path: LngLat[] | Pixel[] | Array>;
+ color: string | number[] | Array;
+ height?: number;
+ color2?: string | number[] | Array;
+ }
+ }
+ class Prism extends MeshAcceptLights {
+ constructor(options: Prism.Options);
+ }
+
+ // tslint:disable-next-line
+ class Wall extends Prism { }
+
+ class Line extends Object3D {
+ readonly geometry: Geometry3D.Line;
+ }
+
+ namespace ThinLine {
+ interface Options {
+ path: Array<[number, number]>;
+ color: string;
+ altitude?: number;
+ dashArray?: number[];
+ }
+ }
+ class ThinLine extends Line {
+ constructor(options: ThinLine.Options);
+ }
+
+ class Points extends Object3D {
+ readonly geometry: Geometry3D.Points;
+ borderColor: string;
+ borderWeight: number;
+ }
+
+ class RoundPoints extends Points {
+ merge: boolean;
+ }
+
+ namespace MeshLine {
+ type Options = {
+ width?: number;
+ height?: number | number[];
+ color?: string | number[];
+ } & ({
+ unit?: 'meter';
+ path: Array<[number, number]> | LngLat[];
+ } | {
+ unit: 'px';
+ path: Array<[number, number]> | Pixel[];
+ });
+ }
+ // inherit from WideLine
+ class MeshLine extends Object3D {
+ constructor(options: MeshLine.Options);
+ readonly geometry: Geometry3D & {
+ readonly vertexIndices: number[];
+ readonly directions: number[];
+ readonly textureIndices: number[];
+ };
+ width: number;
+ setPath(path: LngLat[] | Pixel[] | Array<[number, number]>): void;
+ setWidth(width: number): void;
+ setHeight(height: number | number[]): void;
+ setColor(color: string): void;
+ }
+ }
+}
diff --git a/types/amap-js-api-map3d/tsconfig.json b/types/amap-js-api-map3d/tsconfig.json
new file mode 100644
index 0000000000..e28735d963
--- /dev/null
+++ b/types/amap-js-api-map3d/tsconfig.json
@@ -0,0 +1,31 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6",
+ "dom"
+ ],
+ "noEmit": true,
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "geometry-3d.d.ts",
+ "index.d.ts",
+ "lights.d.ts",
+ "map3d.d.ts",
+ "object3d-group.d.ts",
+ "object3d-layer.d.ts",
+ "object3d.d.ts",
+ "vector3.d.ts",
+ "amap-js-api-map3d-tests.ts"
+ ]
+}
diff --git a/types/make-dir/tslint.json b/types/amap-js-api-map3d/tslint.json
similarity index 100%
rename from types/make-dir/tslint.json
rename to types/amap-js-api-map3d/tslint.json
diff --git a/types/amap-js-api-map3d/vector3.d.ts b/types/amap-js-api-map3d/vector3.d.ts
new file mode 100644
index 0000000000..1cb02fe9b0
--- /dev/null
+++ b/types/amap-js-api-map3d/vector3.d.ts
@@ -0,0 +1,16 @@
+declare namespace AMap {
+ class Vector3 {
+ readonly elements: [number, number, number];
+ constructor(elements: [number, number, number] | Vector3);
+ set(x: number, y: number, z: number): void;
+ dot(): number;
+ clone(): Vector3;
+ add(elements: [number, number, number] | Vector3): this;
+ sub(elements: [number, number, number] | Vector3): this;
+ addVectors(a: Vector3, b: Vector3): this;
+ subVectors(a: Vector3, b: Vector3): this;
+ crossVectors(a: Vector3, b: Vector3): this;
+ normalize(): this;
+ length(): number;
+ }
+}
diff --git a/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts b/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts
new file mode 100644
index 0000000000..b4c787c301
--- /dev/null
+++ b/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts
@@ -0,0 +1,435 @@
+declare const map: AMap.Map;
+declare const div: HTMLElement;
+declare const lnglat: AMap.LngLat;
+declare const lnglatTuple: [number, number];
+declare const bounds: AMap.Bounds;
+declare const polygon: AMap.Polygon;
+declare const lang: AMap.Lang;
+
+// $ExpectType PlaceSearch
+const placeSearch = new AMap.PlaceSearch();
+// $ExpectType PlaceSearch
+new AMap.PlaceSearch({});
+// $ExpectType PlaceSearch
+new AMap.PlaceSearch({
+ city: '深圳',
+ citylimit: true,
+ children: 1,
+ type: '餐饮服务',
+ lang: 'zh_cn',
+ pageSize: 10,
+ pageIndex: 10,
+ extensions: 'all',
+ map,
+ panel: div,
+ showCover: true,
+ renderStyle: 'newpc',
+ autoFitView: true
+});
+
+// $ExpectType void
+placeSearch.search('keyword', (status, result) => {
+ const temp: 'error' | 'complete' | 'no_data' = status;
+ // $ExpectType string | SearchResult
+ result;
+ if (typeof result !== 'string') {
+ // $ExpectType string
+ result.info;
+ // $ExpectType PoiList
+ result.poiList;
+ // $ExpectType string[] | undefined
+ result.keywordList;
+ // $ExpectType CityInfo[] | undefined
+ result.cityList;
+
+ const poiList = result.poiList;
+ // $ExpectType number
+ poiList.pageIndex;
+ // $ExpectType number
+ poiList.pageSize;
+ // $ExpectType number
+ poiList.count;
+
+ const poi = poiList.pois[0];
+ // $ExpectType string
+ poi.address;
+ // $ExpectType number
+ poi.distance;
+ // $ExpectType string
+ poi.id;
+ // $ExpectType LngLat | null
+ poi.location;
+ // $ExpectType string
+ poi.name;
+ // $ExpectType string
+ poi.shopinfo;
+ // $ExpectType string
+ poi.tel;
+ // $ExpectType string
+ poi.type;
+ if ('website' in poi) {
+ // $ExpectType string
+ poi.adcode;
+ // $ExpectType string
+ poi.adname;
+ // $ExpectType string
+ poi.citycode;
+ // $ExpectType string
+ poi.cityname;
+ // $ExpectType boolean
+ poi.discount;
+ // $ExpectType string
+ poi.email;
+ // $ExpectType LngLat | null
+ poi.entr_location;
+ // $ExpectType LngLat | null
+ poi.exit_location;
+ // $ExpectType boolean
+ poi.groupbuy;
+ if (poi.indoor_map) {
+ const indoorData = poi.indoor_data;
+ // $ExpectType string
+ indoorData.cpid;
+ // $ExpectType string
+ indoorData.floor;
+ // $ExpectType string
+ indoorData.truefloor;
+ }
+ poi.pcode;
+ // $ExpectType PoiPhoto[]
+ poi.photos;
+ // $ExpectType string
+ poi.pname;
+ // $ExpectType string
+ poi.postcode;
+ // $ExpectType string
+ poi.website;
+
+ const photo = poi.photos[0];
+ // $ExpectType string
+ photo.title;
+ // $ExpectType string
+ photo.url;
+ // $ExpectType Groupbuy[] | undefined
+ poi.groupbuys;
+ if (poi.groupbuys) {
+ const groupbuy = poi.groupbuys[0];
+ // $ExpectType string
+ groupbuy.title;
+ // $ExpectType string
+ groupbuy.type_code;
+ // $ExpectType string
+ groupbuy.type;
+ // $ExpectType string
+ groupbuy.detail;
+ // $ExpectType string
+ groupbuy.stime;
+ // $ExpectType string
+ groupbuy.etime;
+ // $ExpectType number
+ groupbuy.count;
+ // $ExpectType number
+ groupbuy.sold_num;
+ // $ExpectType number
+ groupbuy.original_price;
+ // $ExpectType number
+ groupbuy.groupbuy_price;
+ // $ExpectType number
+ groupbuy.discount;
+ // $ExpectType string
+ groupbuy.ticket_address;
+ // $ExpectType string
+ groupbuy.ticket_tel;
+ // $ExpectType PoiPhoto[]
+ groupbuy.photos;
+ // $ExpectType string
+ groupbuy.url;
+ // $ExpectType string
+ groupbuy.provider;
+ }
+ // $ExpectType Discount[] | undefined
+ poi.discounts;
+ if (poi.discounts) {
+ const discount = poi.discounts[0];
+ // $ExpectType string
+ discount.title;
+ // $ExpectType string
+ discount.detail;
+ // $ExpectType string
+ discount.start_time;
+ // $ExpectType string
+ discount.end_time;
+ // $ExpectType number
+ discount.sold_num;
+ // $ExpectType PoiPhoto[]
+ discount.photos;
+ // $ExpectType string
+ discount.url;
+ // $ExpectType string
+ discount.provider;
+ }
+ if (poi.deep_type === 'CINEMA') {
+ // $ExpectType Cinema
+ const cinema = poi.cinema;
+ // $ExpectType string
+ cinema.intro;
+ // $ExpectType string
+ cinema.rating;
+ // $ExpectType string
+ cinema.deep_src;
+ // $ExpectType string
+ cinema.parking;
+ // $ExpectType string
+ cinema.opentime_GDF;
+ // $ExpectType string
+ cinema.opentime;
+ // $ExpectType PoiPhoto[]
+ cinema.photos;
+ }
+ if (poi.deep_type === 'DINING') {
+ // $ExpectType Dining
+ const dining = poi.dining;
+ // $ExpectType string
+ dining.cuisines;
+ // $ExpectType string
+ dining.tag;
+ // $ExpectType string
+ dining.intro;
+ // $ExpectType string
+ dining.rating;
+ // $ExpectType string
+ dining.cp_rating;
+ // $ExpectType string
+ dining.deep_src;
+ // $ExpectType string
+ dining.taste_rating;
+ // $ExpectType string
+ dining.environment_rating;
+ // $ExpectType string
+ dining.service_rating;
+ // $ExpectType string
+ dining.cost;
+ // $ExpectType string
+ dining.recommend;
+ // $ExpectType string
+ dining.atmosphere;
+ // $ExpectType string
+ dining.ordering_wap_url;
+ // $ExpectType string
+ dining.ordering_web_url;
+ // $ExpectType string
+ dining.ordering_app_url;
+ // $ExpectType string
+ dining.opentime_GDF;
+ // $ExpectType string
+ dining.opentime;
+ // $ExpectType string
+ dining.addition;
+ // $ExpectType PoiPhoto[]
+ dining.photos;
+ }
+ if (poi.deep_type === 'SCENIC') {
+ // $ExpectType Scenic
+ const scenic = poi.scenic;
+ // $ExpectType string
+ scenic.intro;
+ // $ExpectType string
+ scenic.rating;
+ // $ExpectType string
+ scenic.deep_src;
+ // $ExpectType string
+ scenic.level;
+ // $ExpectType string
+ scenic.price;
+ // $ExpectType string
+ scenic.season;
+ // $ExpectType string
+ scenic.recommend;
+ // $ExpectType string
+ scenic.theme;
+ // $ExpectType string
+ scenic.ordering_wap_url;
+ // $ExpectType string
+ scenic.ordering_web_url;
+ // $ExpectType string
+ scenic.opentime_GDF;
+ // $ExpectType string
+ scenic.opentime;
+ // $ExpectType PoiPhoto[]
+ scenic.photos;
+ }
+ if (poi.deep_type === 'HOTEL') {
+ // $ExpectType Hotel
+ const hotel = poi.hotel;
+ // $ExpectType string
+ hotel.rating;
+ // $ExpectType string
+ hotel.star;
+ // $ExpectType string
+ hotel.intro;
+ // $ExpectType string
+ hotel.lowest_price;
+ // $ExpectType string
+ hotel.faci_rating;
+ // $ExpectType string
+ hotel.health_rating;
+ // $ExpectType string
+ hotel.environment_rating;
+ // $ExpectType string
+ hotel.service_rating;
+ // $ExpectType string
+ hotel.traffic;
+ // $ExpectType string
+ hotel.addition;
+ // $ExpectType string
+ hotel.deep_src;
+ // $ExpectType PoiPhoto[]
+ hotel.photos;
+ }
+ }
+
+ if (result.cityList) {
+ const city = result.cityList[0];
+ // $ExpectType string
+ city.adcode;
+ // $ExpectType string
+ city.citycode;
+ // $ExpectType number
+ city.count;
+ // $ExpectType string
+ city.name;
+ }
+ } else {
+ // $ExpectType string
+ result;
+ }
+});
+
+// $ExpectType void
+placeSearch.searchNearBy('keyword', lnglat, 10, (status, result) => {
+ const temp: 'error' | 'complete' | 'no_data' = status;
+ // $ExpectType string | SearchResult
+ result;
+});
+// $ExpectType void
+placeSearch.searchNearBy('keyword', lnglatTuple, 10, () => { });
+
+// $ExpectType void
+placeSearch.searchInBounds('keyword', bounds, (status, result) => {
+ const temp: 'error' | 'complete' | 'no_data' = status;
+ // $ExpectType string | SearchResult
+ result;
+});
+// $ExpectType void
+placeSearch.searchInBounds('keyword', polygon, () => { });
+
+// $ExpectType void
+placeSearch.getDetails('id', (status, result) => {
+ const temp: 'error' | 'complete' | 'no_data' = status;
+ // $ExpectType string | SearchResult
+ result;
+});
+
+// $ExpectType void
+placeSearch.setType('type');
+// $ExpectType void
+placeSearch.setType();
+
+// $ExpectType void
+placeSearch.setCityLimit(true);
+// $ExpectType void
+placeSearch.setCityLimit();
+
+// $ExpectType void
+placeSearch.setPageIndex(1);
+// $ExpectType void
+placeSearch.setPageIndex();
+
+// $ExpectType void
+placeSearch.setPageSize(1);
+// $ExpectType void
+placeSearch.setPageSize();
+
+// $ExpectType void
+placeSearch.setCity('city');
+// $ExpectType void
+placeSearch.setCity();
+
+// $ExpectType void
+placeSearch.setLang(lang);
+// $ExpectType void
+placeSearch.setLang();
+
+// $ExpectType "zh_cn" | "en" | "zh_en" | undefined
+placeSearch.getLang();
+
+// $ExpectType void
+placeSearch.clear();
+
+// $ExpectType void
+placeSearch.poiOnAMAP({
+ id: 'id',
+});
+// $ExpectType void
+placeSearch.poiOnAMAP({
+ location: lnglat,
+ id: 'id',
+ name: 'name'
+});
+
+// $ExpectType void
+placeSearch.detailOnAMAP({
+ id: 'id',
+});
+// $ExpectType void
+placeSearch.detailOnAMAP({
+ location: lnglat,
+ id: 'id',
+ name: 'name'
+});
+
+// $ExpectType void
+placeSearch.open();
+
+// $ExpectType void
+placeSearch.close();
+
+placeSearch.on('complete', (event: AMap.PlaceSearch.EventMap['complete']) => {
+ // $ExpectType "complete"
+ event.type;
+ // $ExpectType string
+ event.info;
+ // $ExpectType PoiList
+ event.poiList;
+ // $ExpectType string[] | undefined
+ event.keywordList;
+ // $ExpectType CityInfo[] | undefined
+ event.cityList;
+});
+
+placeSearch.on('listElementClick', (event: AMap.PlaceSearch.EventMap['listElementClick']) => {
+ // $ExpectType MouseEvent
+ event.event;
+ // $ExpectType string
+ event.id;
+ // $ExpectType number
+ event.index;
+ // $ExpectType Marker
+ event.marker;
+ // $ExpectType HTMLLIElement
+ event.listElement;
+});
+
+placeSearch.on('markerClick', (event: AMap.PlaceSearch.EventMap['markerClick']) => {
+ const markerEvent = event.event;
+ // $ExpectType Marker
+ markerEvent.target;
+ // $ExpectType string
+ event.id;
+ // $ExpectType number
+ event.index;
+ // $ExpectType Marker
+ event.marker;
+ // $ExpectType HTMLLIElement
+ event.listElement;
+});
diff --git a/types/amap-js-api-place-search/index.d.ts b/types/amap-js-api-place-search/index.d.ts
new file mode 100644
index 0000000000..4a333f3b2b
--- /dev/null
+++ b/types/amap-js-api-place-search/index.d.ts
@@ -0,0 +1,737 @@
+// Type definitions for non-npm package amap-js-api-place-search 1.4
+// Project: https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.PlaceSearch
+// Definitions by: breeze9527
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+///
+
+declare namespace AMap {
+ namespace PlaceSearch {
+ interface EventMap {
+ complete: Event<'complete', SearchResult>;
+ error: Event<'error', { info: string }>;
+ selectChanged: Event<'selectChanged', {
+ selected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick'];
+ lastSelected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick'] | null;
+ }>;
+ listElementClick: SelectChangeEvent<'listElementClick', MouseEvent>;
+ markerClick: SelectChangeEvent<'markerClick', Marker.EventMap['click']>;
+ // internal
+ renderComplete: Event<'renderComplete', {
+ result: SelectChangeEventData[];
+ markers: Marker[];
+ listElements: HTMLElement[];
+ }>;
+ infoWindowClick: Event<'infoWindowClick', SelectChangeEventData & {
+ event: MouseEvent;
+ infoWindow: InfoWindow;
+ infoWindowContentDom: HTMLDivElement;
+ }>;
+ willClear: Event<'willClear', {
+ id: string;
+ index: number;
+ data: Poi[];
+ }>;
+ markerDestoryed: Event<'markerDestoryed', SelectChangeEventData>; // typo in source code
+ listElementDetroyed: Event<'listElementDetroyed', SelectChangeEventData>; // typo too
+ }
+
+ interface SelectChangeEventData {
+ /**
+ * 当前选中的POI的ID
+ */
+ id: string;
+ /**
+ * 索引
+ */
+ index: number;
+ /**
+ * 当前选中的POI对应的在地图中的Marker对象
+ */
+ marker: Marker;
+ /**
+ * 当前选中的POI在结果面板中对应的列表项
+ */
+ listElement: HTMLLIElement;
+ /**
+ * 当前选中的POI的信息
+ */
+ data: Poi[];
+ }
+ type SelectChangeEvent = Event;
+ interface PoiPhoto {
+ /**
+ * 图片名称
+ */
+ title: string;
+ /**
+ * 图片url
+ */
+ url: string;
+ }
+ interface PoiBase {
+ /**
+ * 全局唯一ID
+ */
+ id: string;
+ /**
+ * 名称
+ */
+ name: string;
+ /**
+ * 兴趣点类型
+ */
+ type: string;
+ /**
+ * 兴趣点经纬度
+ */
+ location: LngLat | null;
+ /**
+ * 地址
+ */
+ address: string;
+ /**
+ * 离中心点距离
+ */
+ distance: number;
+ /**
+ * 电话
+ */
+ tel: string;
+ shopinfo: string;
+ children?: any[]; // TODO Array<{location: LngLat | null}>
+ }
+ interface Groupbuy {
+ /**
+ * 团购标题
+ */
+ title: string;
+ /**
+ * 团购分类代码
+ */
+ type_code: string;
+ /**
+ * 团购分类
+ */
+ type: string;
+ /**
+ * 团购详情
+ */
+ detail: string;
+ /**
+ * 团购开始时间
+ */
+ stime: string;
+ /**
+ * 团购结束时间
+ */
+ etime: string;
+ /**
+ * 团购总量
+ */
+ count: number;
+ /**
+ * 已卖出数量
+ */
+ sold_num: number;
+ /**
+ * 原价
+ */
+ original_price: number;
+ /**
+ * 折扣价
+ */
+ groupbuy_price: number;
+ /**
+ * 折扣
+ */
+ discount: number;
+ /**
+ * 取票地址
+ */
+ ticket_address: string;
+ /**
+ * 取票电话
+ */
+ ticket_tel: string;
+ /**
+ * 图片信息
+ */
+ photos: PoiPhoto[];
+ /**
+ * 来源url
+ */
+ url: string;
+ /**
+ * 来源标识
+ */
+ provider: string;
+ }
+ interface Discount {
+ /**
+ * 优惠标题
+ */
+ title: string;
+ /**
+ * 优惠详情
+ */
+ detail: string;
+ /**
+ * 开始时间
+ */
+ start_time: string;
+ /**
+ * 结束时间
+ */
+ end_time: string;
+ /**
+ * 已卖出数量
+ */
+ sold_num: number;
+ /**
+ * 图片信息列表
+ */
+ photos: PoiPhoto[];
+ /**
+ * 来源url
+ */
+ url: string;
+ /**
+ * 来源标识
+ */
+ provider: string;
+ }
+ interface Cinema {
+ /**
+ * 简介
+ */
+ intro: string;
+ /**
+ * 综合评分
+ */
+ rating: string;
+ /**
+ * 信息来源
+ */
+ deep_src: string;
+ /**
+ * 停车场设施
+ */
+ parking: string;
+ /**
+ * 规范格式的营业时间
+ */
+ opentime_GDF: string;
+ /**
+ * 非规范格式的营业时间
+ */
+ opentime: string;
+ /**
+ * 图片信息列表
+ */
+ photos: PoiPhoto[];
+ }
+ interface Dining {
+ /**
+ * 菜系
+ */
+ cuisines: string;
+ /**
+ * 标签
+ */
+ tag: string;
+ /**
+ * 简介
+ */
+ intro: string;
+ /**
+ * 综合评分
+ */
+ rating: string;
+ /**
+ * 单数据源的评分
+ */
+ cp_rating: string;
+ /**
+ * 信息来源
+ */
+ deep_src: string;
+ /**
+ * 口味评分
+ */
+ taste_rating: string;
+ /**
+ * 环境评分
+ */
+ environment_rating: string;
+ /**
+ * 服务评分
+ */
+ service_rating: string;
+ /**
+ * 人均消费
+ */
+ cost: string;
+ /**
+ * 特色菜
+ */
+ recommend: string;
+ /**
+ * 氛围
+ */
+ atmosphere: string;
+ /**
+ * 订餐wap链接
+ */
+ ordering_wap_url: string;
+ /**
+ * 订餐web链接
+ */
+ ordering_web_url: string;
+ /**
+ * 订餐APP URL
+ */
+ ordering_app_url: string;
+ /**
+ * 规范格式的营业时间
+ */
+ opentime_GDF: string;
+ /**
+ * 非规范格式的营业时间
+ */
+ opentime: string;
+ /**
+ * 餐厅特色
+ */
+ addition: string;
+ /**
+ * 图片信息列表
+ */
+ photos: PoiPhoto[];
+ }
+ interface Scenic {
+ /**
+ * 简介
+ */
+ intro: string;
+ /**
+ * 综合评分
+ */
+ rating: string;
+ /**
+ * 信息来源
+ */
+ deep_src: string;
+ /**
+ * 景区国标级别
+ */
+ level: string;
+ /**
+ * 门票价格
+ */
+ price: string;
+ /**
+ * 适合游玩的季节
+ */
+ season: string;
+ /**
+ * 推荐景点
+ */
+ recommend: string;
+ /**
+ * 景区主题
+ */
+ theme: string;
+ /**
+ * wap购票链接
+ */
+ ordering_wap_url: string;
+ /**
+ * web购票链接
+ */
+ ordering_web_url: string;
+ /**
+ * 规范格式的营业时间
+ */
+ opentime_GDF: string;
+ /**
+ * 非规范格式的营业时间
+ */
+ opentime: string;
+ /**
+ * 图片信息列表
+ */
+ photos: PoiPhoto[];
+ }
+ interface Hotel {
+ /**
+ * 综合评分
+ */
+ rating: string;
+ /**
+ * 星级
+ */
+ star: string;
+ /**
+ * 简介
+ */
+ intro: string;
+ /**
+ * 最低房价
+ */
+ lowest_price: string;
+ /**
+ * 设施评分
+ */
+ faci_rating: string;
+ /**
+ * 卫生评分
+ */
+ health_rating: string;
+ /**
+ * 环境评分
+ */
+ environment_rating: string;
+ /**
+ * 服务评分
+ */
+ service_rating: string;
+ /**
+ * 交通提示
+ */
+ traffic: string;
+ /**
+ * 特色服务
+ */
+ addition: string;
+ /**
+ * 信息来源
+ */
+ deep_src: string;
+ /**
+ * 图片信息列表
+ */
+ photos: PoiPhoto[];
+ }
+ type PoiExt = PoiBase & {
+ /**
+ * 网址
+ */
+ website: string;
+ /**
+ * 所在省份编码
+ */
+ pcode: string;
+ /**
+ * 所在城市编码
+ */
+ citycode: string;
+ /**
+ * 所在区域编码
+ */
+ adcode: string;
+ /**
+ * 邮编
+ */
+ postcode: string;
+ /**
+ * 所在省份
+ */
+ pname: string;
+ /**
+ * 所在城市名称
+ */
+ cityname: string;
+ /**
+ * 所在行政区名称
+ */
+ adname: string;
+ /**
+ * 电子邮箱
+ */
+ email: string;
+ /**
+ * 照片
+ */
+ photos: PoiPhoto[];
+ /**
+ * 入口经纬度
+ */
+ entr_location: LngLat | null;
+ /**
+ * 出口经纬度
+ */
+ exit_location: LngLat | null;
+ /**
+ * @deprecated 是否有团购信息
+ */
+ groupbuy: boolean;
+ /**
+ * @deprecated 是否有优惠信息
+ */
+ discount: boolean;
+ } & ({
+ indoor_map: true;
+ indoor_data: {
+ cpid: string;
+ floor: string;
+ truefloor: string;
+ };
+ } | {
+ indoor_map: false;
+ }) & {
+ /**
+ * @deprecated 团购信息
+ */
+ groupbuys?: Groupbuy[];
+ /**
+ * @deprecated 优惠信息
+ */
+ discounts?: Discount[];
+ } & ({
+ deep_type: 'CINEMA';
+ /**
+ * @deprecated 影院类深度信息
+ */
+ cinema: Cinema;
+ } | {
+ deep_type: 'DINING';
+ /**
+ * @deprecated 餐饮类深度信息
+ */
+ dining: Dining;
+ } | {
+ deep_type: 'SCENIC';
+ /**
+ * @deprecated 景点类深度信息
+ */
+ scenic: Scenic;
+ } | {
+ deep_type: 'HOTEL';
+ /**
+ * @deprecated 酒店类深度信息
+ */
+ hotel: Hotel;
+ });
+ interface Options {
+ /**
+ * 兴趣点城市
+ */
+ city?: string;
+ /**
+ * 是否强制限制在设置的城市内搜索
+ */
+ citylimit?: boolean;
+ /**
+ * 是否按照层级展示子POI数据
+ * children=1,展示子节点POI数据,children=0,不展示子节点数据
+ */
+ children?: number;
+ /**
+ * 兴趣点类别,多个类别用“|”分割
+ */
+ type?: string;
+ /**
+ * 检索语言类型
+ */
+ lang?: Lang;
+ /**
+ * 单页显示结果条数
+ */
+ pageSize?: number;
+ /**
+ * 页码
+ */
+ pageIndex?: number;
+ /**
+ * 是否返回详细信息
+ * base返回基本地址信息;all返回基本+详细信息
+ */
+ extensions?: 'base' | 'all';
+ /**
+ * Map对象
+ */
+ map?: Map;
+ /**
+ * 结果列表的HTML容器id或容器元素
+ */
+ panel?: string | HTMLElement;
+ /**
+ * 是否在地图上显示周边搜索的圆或者范围搜索的多边形
+ */
+ showCover?: boolean;
+ /**
+ * 绘制的UI风格
+ */
+ renderStyle?: 'newpc' | 'default';
+ /**
+ * 是否自动调整地图视野使绘制的Marker点都处于视口的可见范围
+ */
+ autoFitView?: boolean;
+
+ // internal
+ renderEngine?: string;
+ rankBy?: string;
+ }
+ interface PoiList {
+ /**
+ * Poi列表
+ */
+ pois: Poi[]; // PlaceSearchPoiBase[] | PlaceSearchPoiExt[];
+ /**
+ * 页码
+ */
+ pageIndex: number;
+ /**
+ * 单页结果数
+ */
+ pageSize: number;
+ /**
+ * 查询结果总数
+ */
+ count: number;
+ }
+ interface CityInfo {
+ /**
+ * 建议城市名称
+ */
+ name: string;
+ /**
+ * 城市编码
+ */
+ citycode: string;
+ /**
+ * 行政区编码
+ */
+ adcode: string;
+ /**
+ * 该城市的建议结果数目
+ */
+ count: number;
+ }
+ interface SearchResult {
+ /**
+ * 成功状态说明
+ */
+ info: string;
+ /**
+ * 兴趣点列表
+ */
+ poiList: PoiList;
+ /**
+ * 建议关键字列表
+ */
+ keywordList?: string[];
+ /**
+ * 城市建议列表
+ */
+ cityList?: CityInfo[];
+ }
+ type Poi = PoiBase | PoiExt;
+ type SearchStatus = 'complete' | 'error' | 'no_data';
+ }
+ class PlaceSearch extends EventEmitter {
+ /**
+ * 地点搜索服务
+ * @param options 选项
+ */
+ constructor(options?: PlaceSearch.Options);
+ /**
+ * 根据关键字搜索
+ * @param keyword 根据关键字搜索
+ * @param callback 回调
+ */
+ search(
+ keyword: string,
+ callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
+ ): void;
+ /**
+ * 周边查询
+ * @param keyword 关键字
+ * @param center 搜索中心
+ * @param radius 搜索半径
+ * @param callback 回调
+ */
+ searchNearBy(
+ keyword: string,
+ center: LocationValue,
+ radius: number,
+ callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
+ ): void;
+ /**
+ * 根据范围和关键词进行范围查询
+ * @param keyword 关键字
+ * @param bounds 搜索范围
+ * @param callback 回调
+ */
+ searchInBounds(
+ keyword: string,
+ bounds: Bounds | Polygon,
+ callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
+ ): void;
+ /**
+ * 根据POIID 查询POI 详细信息
+ * @param POIID POIID
+ * @param callback 搜索回调
+ */
+ getDetails(
+ POIID: string,
+ callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void
+ ): void;
+ /**
+ * 设置查询类别
+ * @param type 查询类别
+ */
+ setType(type?: string): void;
+ /**
+ * 设置是否强制限制城市
+ * @param limit 是否强制限制城市
+ */
+ setCityLimit(limit?: boolean): void;
+ /**
+ * 设置查询结果特定页数
+ * @param pageIndex 页码
+ */
+ setPageIndex(pageIndex?: number): void;
+ /**
+ * 设置查询单页结果数
+ * @param pageSize 结果数
+ */
+ setPageSize(pageSize?: number): void;
+ /**
+ * 设置查询城市
+ * @param city 城市
+ */
+ setCity(city?: string): void;
+ /**
+ * 设置检索语言类型
+ * @param lang 语言类型
+ */
+ setLang(lang?: Lang): void;
+ /**
+ * 获取检索语言类型
+ */
+ getLang(): Lang | undefined;
+ /**
+ * 清除搜索结果
+ */
+ clear(): void;
+ /**
+ * 唤起高德地图客户端marker页
+ * @param obj 唤起参数
+ */
+ poiOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void;
+ /**
+ * 唤起高德地图客户端POI详情页
+ * @param obj 唤起参数
+ */
+ detailOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void;
+
+ // internal
+ open(): void;
+ close(): void;
+ }
+}
diff --git a/types/amap-js-api-place-search/tsconfig.json b/types/amap-js-api-place-search/tsconfig.json
new file mode 100644
index 0000000000..e3259e1b01
--- /dev/null
+++ b/types/amap-js-api-place-search/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6",
+ "dom"
+ ],
+ "noEmit": true,
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "amap-js-api-place-search-tests.ts"
+ ]
+}
diff --git a/types/opn/tslint.json b/types/amap-js-api-place-search/tslint.json
similarity index 100%
rename from types/opn/tslint.json
rename to types/amap-js-api-place-search/tslint.json
diff --git a/types/amap-js-api/amap-js-api-tests.ts b/types/amap-js-api/amap-js-api-tests.ts
new file mode 100644
index 0000000000..0a2c1426b2
--- /dev/null
+++ b/types/amap-js-api/amap-js-api-tests.ts
@@ -0,0 +1,3421 @@
+/**
+ * preset.ts
+ */
+
+declare const map: AMap.Map;
+declare const lnglat: AMap.LngLat;
+declare const size: AMap.Size;
+declare const lnglatTuple: [number, number];
+declare const pixel: AMap.Pixel;
+declare const markerShape: AMap.MarkerShape;
+declare const icon: AMap.Icon;
+declare const bounds: AMap.Bounds;
+declare const div: HTMLDivElement;
+declare const lang: AMap.Lang;
+declare const domEle: HTMLElement;
+declare const canvasEle: HTMLCanvasElement;
+declare const imgEle: HTMLImageElement;
+
+declare const circle: AMap.Circle;
+declare const marker: AMap.Marker;
+declare const layer: AMap.Layer;
+declare const tileLayer: AMap.TileLayer;
+declare const massMarksLayer: AMap.MassMarks;
+
+// declare const videoLayer: AMap.VideoLayer;
+// declare const buildings: AMap.Buildings;
+// declare const canvasLayer: AMap.CanvasLayer;
+// declare const flexible: AMap.TileLayer.Flexible;
+// declare const imageLayer: AMap.ImageLayer;
+// declare const tileLayerGroup: AMap.LayerGroup;
+// declare const layerGroup: AMap.LayerGroup;
+// declare const trafficLayer: AMap.TileLayer.Traffic;
+// declare const bezierCurve: AMap.BezierCurve;
+// declare const contextMenu: AMap.ContextMenu;
+// declare const polyline: AMap.Polyline;
+// declare const polygon: AMap.Polygon;
+
+/**
+ * arryBounds.ts
+ */
+
+// $ExpectType ArrayBounds
+const testArrayBounds = new AMap.ArrayBounds([lnglat, lnglat, lnglat]);
+
+// $ExpectType LngLat[]
+testArrayBounds.bounds;
+
+// $ExpectType boolean
+testArrayBounds.contains(lnglat);
+
+// $ExpectType Bounds
+testArrayBounds.toBounds();
+
+// $ExpectType LngLat
+testArrayBounds.getCenter();
+
+/**
+ * bounds.ts
+ */
+
+// $ExpectType Bounds
+const testBounds = new AMap.Bounds(lnglat, lnglat);
+
+// $ExpectType boolean
+testBounds.contains(lnglat);
+// $ExpectType boolean
+testBounds.contains(lnglatTuple);
+
+// $ExpectType LngLat
+testBounds.getCenter();
+
+// $ExpectType LngLat
+testBounds.getSouthWest();
+
+// $ExpectType LngLat
+testBounds.getSouthEast();
+
+// $ExpectType LngLat
+testBounds.getNorthEast();
+
+// $ExpectType LngLat
+testBounds.getNorthWest();
+
+// $ExpectType string
+testBounds.toString();
+
+/**
+ * browser.ts
+ */
+
+const brwoser = AMap.Browser;
+
+// $ExpectType string
+brwoser.ua;
+
+// $ExpectType boolean
+brwoser.mobile;
+
+const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other' = brwoser.plat;
+
+// $ExpectType boolean
+brwoser.mac;
+
+// $ExpectType boolean
+brwoser.windows;
+
+// $ExpectType boolean
+brwoser.ios;
+
+// $ExpectType boolean
+brwoser.iPad;
+
+// $ExpectType boolean
+brwoser.iPhone;
+
+// $ExpectType boolean
+brwoser.android;
+
+// $ExpectType boolean
+brwoser.android23;
+
+// $ExpectType boolean
+brwoser.chrome;
+
+// $ExpectType boolean
+brwoser.firefox;
+
+// $ExpectType boolean
+brwoser.safari;
+
+// $ExpectType boolean
+brwoser.wechat;
+
+// $ExpectType boolean
+brwoser.uc;
+
+// $ExpectType boolean
+brwoser.qq;
+
+// $ExpectType boolean
+brwoser.ie;
+
+// $ExpectType boolean
+brwoser.ie6;
+
+// $ExpectType boolean
+brwoser.ie7;
+
+// $ExpectType boolean
+brwoser.ie8;
+
+// $ExpectType boolean
+brwoser.ie9;
+
+// $ExpectType boolean
+brwoser.ie10;
+
+// $ExpectType boolean
+brwoser.ie11;
+
+// $ExpectType boolean
+brwoser.edge;
+
+// $ExpectType boolean
+brwoser.ielt9;
+
+// $ExpectType boolean
+brwoser.baidu;
+
+// $ExpectType boolean
+brwoser.isLocalStorage;
+
+// $ExpectType boolean
+brwoser.isGeolocation;
+
+// $ExpectType boolean
+brwoser.mobileWebkit;
+
+// $ExpectType boolean
+brwoser.mobileWebkit3d;
+
+// $ExpectType boolean
+brwoser.mobileOpera;
+
+// $ExpectType boolean
+brwoser.retina;
+
+// $ExpectType boolean
+brwoser.touch;
+
+// $ExpectType boolean
+brwoser.msPointer;
+
+// $ExpectType boolean
+brwoser.pointer;
+
+// $ExpectType boolean
+brwoser.webkit;
+
+// $ExpectType boolean
+brwoser.ie3d;
+
+// $ExpectType boolean
+brwoser.webkit3d;
+
+// $ExpectType boolean
+brwoser.gecko3d;
+
+// $ExpectType boolean
+brwoser.opera3d;
+
+// $ExpectType boolean
+brwoser.any3d;
+
+// $ExpectType boolean
+brwoser.isCanvas;
+
+// $ExpectType boolean
+brwoser.isSvg;
+
+// $ExpectType boolean
+brwoser.isVML;
+
+// $ExpectType boolean
+brwoser.isWorker;
+
+// $ExpectType boolean
+brwoser.isWebsocket;
+
+// $ExpectType boolean
+brwoser.isWebGL();
+
+/**
+ * convert-from.ts
+ */
+
+declare const convertType: 'baidu' | 'mapbar' | 'gps' | null;
+// $ExpectType void
+AMap.convertFrom(lnglat, convertType, (status, result) => {
+ const temp: 'complete' | 'error' = status;
+ if (typeof result !== 'string') {
+ // $ExpectType string
+ result.info;
+ // $ExpectType LngLat[]
+ result.locations;
+ } else {
+ // $ExpectType string
+ result;
+ }
+});
+// $ExpectType void
+AMap.convertFrom([lnglat], null, () => { });
+// $ExpectType void
+AMap.convertFrom(lnglatTuple, null, () => { });
+// $ExpectType void
+AMap.convertFrom([lnglatTuple], null, () => { });
+
+/**
+ * dom-util.ts
+ */
+
+const domUtil = AMap.DomUtil;
+
+// $ExpectType Size
+domUtil.getViewport(div);
+
+// $ExpectType Pixel
+domUtil.getViewportOffset(div);
+
+// $ExpectType HTMLDivElement
+domUtil.create('div');
+// $ExpectType HTMLAnchorElement
+domUtil.create('a');
+// $ExpectType HTMLDivElement
+domUtil.create('div', div);
+// $ExpectType HTMLDivElement
+domUtil.create('div', div, 'className');
+
+// $ExpectType void
+domUtil.setClass(div);
+// $ExpectType void
+domUtil.setClass(div, 'className');
+
+// $ExpectType boolean
+domUtil.hasClass(div, 'className');
+
+// $ExpectType void
+domUtil.removeClass(div, 'className');
+
+// $ExpectType void
+domUtil.setOpacity(div, 1);
+
+// $ExpectType void
+domUtil.rotate(div, 10);
+// $ExpectType void
+domUtil.rotate(div, 10, { x: 10, y: 10 });
+
+const util2: typeof AMap.DomUtil = domUtil.setCss(div, { textAlign: 'left' });
+// $ExpectError
+domUtil.setCss(div, { textAlign: 10 });
+
+// $ExpectType void
+domUtil.empty(div);
+
+// $ExpectType void
+domUtil.remove(div);
+
+/**
+ * event.ts
+ */
+
+// $ExpectType Map
+map.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => {
+ // $ExpectType "hotspotclick"
+ event.type;
+ // $ExpectType string
+ event.id;
+ // $ExpectType LngLat
+ event.lnglat;
+});
+
+// $ExpectType EventListener<0>
+AMap.event.addDomListener(div, 'click', event => {
+ // $ExpectType number
+ event.clientX;
+});
+
+// $ExpectType EventListener<1>
+AMap.event.addListener(map, 'hotspotclick', function(event: AMap.Map.EventMap['hotspotclick']) {
+ // $ExpectType "hotspotclick"
+ event.type;
+ // $ExpectType string
+ event.id;
+ // $ExpectType LngLat
+ event.lnglat;
+ // $ExpectType number
+ this.test;
+}, { test: 1 });
+AMap.event.addListener(map, 'click', (event: AMap.Map.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType LngLat
+ event.lnglat;
+ // $ExpectType Map
+ event.target;
+});
+
+// $ExpectType EventListener<1>
+const eventListener = AMap.event.addListenerOnce(map, 'hotspotclick', function(event: AMap.Map.EventMap['hotspotclick']) {
+ // $ExpectType "hotspotclick"
+ event.type;
+ // $ExpectType string
+ event.id;
+ // $ExpectType LngLat
+ event.lnglat;
+ // $ExpectType number
+ this.test;
+}, { test: 1 });
+
+// $ExpectType void
+AMap.event.removeListener(eventListener);
+
+// $ExpectType void
+AMap.event.trigger(map, 'click', {
+ lnglat,
+ pixel,
+ target: map
+});
+// $ExpectType void
+AMap.event.trigger(map, 'hotspotclick', {
+ lnglat,
+ name: 'name',
+ id: 'id',
+ isIndoorPOI: true
+});
+// $ExpectType void
+AMap.event.trigger(map, 'complete');
+
+/**
+ * geometry-util.ts
+ */
+
+{
+ const point = lnglat;
+ const pointTuple = lnglatTuple;
+ const line = [point];
+ const lineTuple = [pointTuple];
+ const ring = [point];
+ const ringTuple = [pointTuple];
+ const polygon = [ring];
+ const polygonTuple = [ringTuple];
+ const geometryUtil = AMap.GeometryUtil;
+
+ // $ExpectType number
+ geometryUtil.distance(point, point);
+ // $ExpectType number
+ geometryUtil.distance(pointTuple, pointTuple);
+ // $ExpectType number
+ geometryUtil.distance(point, line);
+ // $ExpectType number
+ geometryUtil.distance(pointTuple, lineTuple);
+
+ // $ExpectType number
+ geometryUtil.ringArea(ring);
+ // $ExpectType number
+ geometryUtil.ringArea(ringTuple);
+
+ // $ExpectType boolean
+ geometryUtil.isClockwise(ring);
+ // $ExpectType boolean
+ geometryUtil.isClockwise(ringTuple);
+
+ // $ExpectType number
+ geometryUtil.distanceOfLine(line);
+ // $ExpectType number
+ geometryUtil.distanceOfLine(lineTuple);
+
+ // $ExpectType [number, number][]
+ geometryUtil.ringRingClip(ring, ring);
+ // $ExpectType [number, number][]
+ geometryUtil.ringRingClip(ringTuple, ringTuple);
+
+ // $ExpectType boolean
+ geometryUtil.doesRingRingIntersect(ring, ring);
+ // $ExpectType boolean
+ geometryUtil.doesRingRingIntersect(ringTuple, ringTuple);
+
+ // $ExpectType boolean
+ geometryUtil.doesLineRingIntersect(line, ring);
+ // $ExpectType boolean
+ geometryUtil.doesLineRingIntersect(lineTuple, ringTuple);
+
+ // $ExpectType boolean
+ geometryUtil.doesLineLineIntersect(line, line);
+ // $ExpectType boolean
+ geometryUtil.doesLineLineIntersect(lineTuple, lineTuple);
+
+ // $ExpectType boolean
+ geometryUtil.doesSegmentPolygonIntersect(point, point, polygon);
+ // $ExpectType boolean
+ geometryUtil.doesSegmentPolygonIntersect(pointTuple, pointTuple, polygonTuple);
+
+ // $ExpectType boolean
+ geometryUtil.doesSegmentRingIntersect(point, point, ring);
+ // $ExpectType boolean
+ geometryUtil.doesSegmentRingIntersect(pointTuple, pointTuple, ringTuple);
+
+ // $ExpectType boolean
+ geometryUtil.doesSegmentLineIntersect(point, point, line);
+ // $ExpectType boolean
+ geometryUtil.doesSegmentLineIntersect(pointTuple, pointTuple, lineTuple);
+
+ // $ExpectType boolean
+ geometryUtil.doesSegmentsIntersect(point, point, point, point);
+ // $ExpectType boolean
+ geometryUtil.doesSegmentsIntersect(pointTuple, pointTuple, pointTuple, pointTuple);
+
+ // $ExpectType boolean
+ geometryUtil.isPointInRing(point, ring);
+ // $ExpectType boolean
+ geometryUtil.isPointInRing(pointTuple, ringTuple);
+
+ // $ExpectType boolean
+ geometryUtil.isRingInRing(ring, ring);
+ // $ExpectType boolean
+ geometryUtil.isRingInRing(ringTuple, ringTuple);
+
+ // $ExpectType boolean
+ geometryUtil.isPointInPolygon(point, polygon);
+ // $ExpectType boolean
+ geometryUtil.isPointInPolygon(pointTuple, polygonTuple);
+
+ // $ExpectType [number, number][]
+ geometryUtil.makesureClockwise(lineTuple);
+
+ // $ExpectType [number, number][]
+ geometryUtil.makesureAntiClockwise(lineTuple);
+
+ // $ExpectType [number, number]
+ geometryUtil.closestOnSegment(point, point, point);
+ // $ExpectType [number, number]
+ geometryUtil.closestOnSegment(pointTuple, pointTuple, pointTuple);
+
+ // $ExpectType [number, number]
+ geometryUtil.closestOnSegment(point, point, point);
+ // $ExpectType [number, number]
+ geometryUtil.closestOnSegment(pointTuple, pointTuple, pointTuple);
+
+ // $ExpectType [number, number]
+ geometryUtil.closestOnLine(point, line);
+ // $ExpectType [number, number]
+ geometryUtil.closestOnLine(pointTuple, lineTuple);
+
+ // $ExpectType number
+ geometryUtil.distanceToSegment(point, point, point);
+ // $ExpectType number
+ geometryUtil.distanceToSegment(pointTuple, pointTuple, pointTuple);
+
+ // $ExpectType number
+ geometryUtil.distanceToLine(point, line);
+ // $ExpectType number
+ geometryUtil.distanceToLine(pointTuple, lineTuple);
+
+ // $ExpectType boolean
+ geometryUtil.isPointOnSegment(point, point, point);
+ // $ExpectType boolean
+ geometryUtil.isPointOnSegment(point, point, point, 1);
+ // $ExpectType boolean
+ geometryUtil.isPointOnSegment(pointTuple, pointTuple, pointTuple);
+ // $ExpectType boolean
+ geometryUtil.isPointOnSegment(pointTuple, pointTuple, pointTuple, 1);
+
+ // $ExpectType boolean
+ geometryUtil.isPointOnLine(point, line);
+ // $ExpectType boolean
+ geometryUtil.isPointOnLine(point, line, 1);
+ // $ExpectType boolean
+ geometryUtil.isPointOnLine(pointTuple, lineTuple);
+ // $ExpectType boolean
+ geometryUtil.isPointOnLine(pointTuple, lineTuple, 1);
+
+ // $ExpectType boolean
+ geometryUtil.isPointOnRing(point, ring);
+ // $ExpectType boolean
+ geometryUtil.isPointOnRing(point, ring, 1);
+ // $ExpectType boolean
+ geometryUtil.isPointOnRing(pointTuple, ringTuple);
+ // $ExpectType boolean
+ geometryUtil.isPointOnRing(pointTuple, ringTuple, 1);
+
+ // $ExpectType boolean
+ geometryUtil.isPointOnPolygon(point, polygon);
+ // $ExpectType boolean
+ geometryUtil.isPointOnPolygon(point, polygon, 1);
+ // $ExpectType boolean
+ geometryUtil.isPointOnPolygon(pointTuple, polygonTuple);
+ // $ExpectType boolean
+ geometryUtil.isPointOnPolygon(pointTuple, polygonTuple, 1);
+}
+
+/**
+ * lnglat.ts
+ */
+
+// $ExpectType LngLat
+new AMap.LngLat(114, 22);
+// $ExpectType LngLat
+const testLnglat = new AMap.LngLat(113, 21);
+
+// $ExpectType LngLat
+testLnglat.offset(1, 2);
+
+// $ExpectType number
+testLnglat.distance(testLnglat);
+// $ExpectType number
+testLnglat.distance([testLnglat]);
+
+// $ExpectType number
+testLnglat.getLng();
+
+// $ExpectType number
+testLnglat.getLat();
+
+// $ExpectType boolean
+testLnglat.equals(testLnglat);
+
+// $ExpectType string
+testLnglat.toString();
+
+// $ExpectType LngLat
+testLnglat.add(testLnglat);
+// $ExpectType LngLat
+testLnglat.add(testLnglat, true);
+
+// $ExpectType LngLat
+testLnglat.subtract(testLnglat);
+// $ExpectType LngLat
+testLnglat.subtract(testLnglat, true);
+
+// $ExpectType LngLat
+testLnglat.divideBy(1);
+// $ExpectType LngLat
+testLnglat.divideBy(1, true);
+
+// $ExpectType LngLat
+testLnglat.multiplyBy(1);
+// $ExpectType LngLat
+testLnglat.multiplyBy(1, true);
+
+/**
+ * map.ts
+ */
+
+// $ExpectType Map
+new AMap.Map('map');
+// $ExpectType Map
+new AMap.Map(div);
+
+// $ExpectType Map
+new AMap.Map(div, {});
+
+// $ExpectType Map
+const testMap = new AMap.Map(div, {
+ layers: [tileLayer],
+ zoom: 15,
+ center: [1, 2],
+ labelzIndex: 110,
+ zooms: [5, 15],
+ lang: 'zh_cn',
+ defaultCursor: 'default',
+ crs: 'EPSG4326',
+ animateEnable: true,
+ isHotspot: false,
+ defaultLayer: tileLayer,
+ rotateEnable: true,
+ resizeEnable: true,
+ showIndoorMap: true,
+ // indoorMap, // TODO
+ expandZoomRange: true,
+ dragEnable: true,
+ zoomEnable: true,
+ doubleClickZoom: true,
+ keyboardEnable: true,
+ jogEnable: true,
+ scrollWheel: true,
+ touchZoom: true,
+ mapStyle: '',
+ features: ['road'],
+ showBuildingBlock: true,
+ skyColor: '#fff',
+ preloadMode: true,
+ mask: [[1, 2], [2, 3], [3, 4]]
+});
+
+// $ExpectType number
+testMap.getZoom();
+
+// $ExpectType Layer[]
+testMap.getLayers();
+
+// $ExpectType LngLat
+testMap.getCenter();
+
+// $ExpectType HTMLElement | null
+testMap.getContainer();
+
+testMap.getCity(city => {
+ // $ExpectType string
+ city.city;
+ // $ExpectType string
+ city.citycode;
+ // $ExpectType string
+ city.district;
+ // $ExpectType string | never[]
+ city.province;
+});
+
+// $ExpectType Bounds
+testMap.getBounds();
+
+// $ExpectType number
+testMap.getLabelzIndex();
+
+// $ExpectType Lang
+testMap.getLang();
+
+// $ExpectType Size
+testMap.getSize();
+
+// $ExpectType number
+testMap.getRotation();
+
+// $ExpectType Status
+const mapStatus = testMap.getStatus();
+// $ExpectType boolean
+mapStatus.animateEnable;
+// $ExpectType boolean
+mapStatus.doubleClickZoom;
+// $ExpectType boolean
+mapStatus.dragEnable;
+// $ExpectType boolean
+mapStatus.isHotspot;
+// $ExpectType boolean
+mapStatus.jogEnable;
+// $ExpectType boolean
+mapStatus.keyboardEnable;
+// $ExpectType boolean
+mapStatus.pitchEnable;
+// $ExpectType boolean
+mapStatus.resizeEnable;
+// $ExpectType boolean
+mapStatus.rotateEnable;
+// $ExpectType boolean
+mapStatus.scrollWheel;
+// $ExpectType boolean
+mapStatus.touchZoom;
+// $ExpectType boolean
+mapStatus.zoomEnable;
+
+// $ExpectType string
+testMap.getDefaultCursor();
+
+// $ExpectType number
+testMap.getResolution();
+
+// $ExpectType number
+testMap.getScale();
+// $ExpectType number
+testMap.getScale(1);
+
+// $ExpectType void
+testMap.setZoom(1);
+
+// $ExpectType void
+testMap.setLabelzIndex(1);
+
+// $ExpectType void
+testMap.setLayers([tileLayer]);
+
+// $ExpectType void
+testMap.setCenter(lnglat);
+// $ExpectType void
+testMap.setCenter([1, 2]);
+
+// $ExpectType void
+testMap.setZoomAndCenter(13, lnglat);
+// $ExpectType void
+testMap.setZoomAndCenter(13, [1, 2]);
+
+// $ExpectType void
+testMap.setCity('city', (coord, zoom) => {
+ // $ExpectType string
+ coord[0];
+ // $ExpectType string
+ coord[1];
+ // $ExpectType number
+ zoom;
+});
+
+// $ExpectType Bounds
+testMap.setBounds(bounds);
+
+// $ExpectType void
+testMap.setLimitBounds(bounds);
+
+// $ExpectType void
+testMap.clearLimitBounds();
+
+// $ExpectType void
+testMap.setLang('zh_cn');
+
+// $ExpectType void
+testMap.setRotation(1);
+
+// $ExpectType void
+testMap.setStatus({});
+// $ExpectType void
+testMap.setStatus({
+ animateEnable: true,
+ doubleClickZoom: true,
+ dragEnable: true,
+ isHotspot: true,
+ jogEnable: true,
+ keyboardEnable: true,
+ pitchEnable: false,
+ resizeEnable: false,
+ rotateEnable: false,
+ scrollWheel: true,
+ touchZoom: true,
+ zoomEnable: true
+});
+
+// $ExpectType void
+testMap.setDefaultCursor('default');
+
+// $ExpectType void
+testMap.zoomIn();
+
+// $ExpectType void
+testMap.zoomOut();
+
+// $ExpectType void
+testMap.panTo([1, 2]);
+// $ExpectType void
+testMap.panTo(lnglat);
+
+// $ExpectType void
+testMap.panBy(1, 2);
+
+// $ExpectType void
+testMap.clearMap();
+
+// $ExpectType Map
+testMap.plugin('plugin name', () => { });
+// $ExpectType Map
+testMap.plugin(['plugin name'], () => { });
+
+// $ExpectType void
+testMap.clearInfoWindow();
+
+// $ExpectType LngLat
+testMap.pixelToLngLat(pixel);
+// $ExpectType LngLat
+testMap.pixelToLngLat(pixel, 1);
+
+// $ExpectType Pixel
+testMap.lnglatToPixel(lnglat);
+// $ExpectType Pixel
+testMap.lnglatToPixel(lnglat, 1);
+
+// $ExpectType LngLat
+testMap.containerToLngLat(pixel);
+
+// $ExpectType Pixel
+testMap.lngLatToContainer(lnglat);
+// $ExpectType Pixel
+testMap.lnglatTocontainer(lnglat);
+
+// $ExpectType void
+testMap.setMapStyle('');
+// $ExpectType string
+testMap.getMapStyle();
+
+// $ExpectType void
+testMap.setFeatures('all');
+// $ExpectType void
+testMap.setFeatures(['bg']);
+
+const feature: 'all' | 'bg' | 'point' | 'road' | 'building' | AMap.Map.Feature[] = testMap.getFeatures();
+
+// $ExpectType void
+testMap.setDefaultLayer(tileLayer);
+
+// $ExpectType void
+testMap.setPitch(1);
+// $ExpectType number
+testMap.getPitch();
+
+// $ExpectType ViewMode
+testMap.getViewMode_();
+
+// $ExpectType Pixel
+testMap.lngLatToGeodeticCoord(lnglat);
+// $ExpectType Pixel
+testMap.lngLatToGeodeticCoord(lnglatTuple);
+
+// $ExpectType LngLat
+testMap.geodeticCoordToLngLat(pixel);
+
+// $ExpectType void
+testMap.destroy();
+
+declare function dblClickHandler(this: AMap.Map, event: AMap.Map.EventMap['dblclick']): void;
+
+// $ExpectType Map
+testMap.on('click', (event: AMap.Map.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Pixel
+ event.pixel;
+ // $ExpectType LngLat
+ event.lnglat;
+ // $ExpectType Map
+ event.target;
+});
+// $ExpectType Map
+testMap.on('dblclick', dblClickHandler);
+// $ExpectType Map
+testMap.on('complete', (event: AMap.Map.EventMap['complete']) => {
+ // $ExpectType "complete"
+ event.type;
+ // $ExpectError
+ event.value;
+});
+// $ExpectType Map
+testMap.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => {
+ // $ExpectType string
+ event.id;
+ // $ExpectType LngLat
+ event.lnglat;
+ // $ExpectType string
+ event.name;
+ // $ExpectType "hotspotclick"
+ event.type;
+});
+// $ExpectType Map
+testMap.on('custom', (event: AMap.Event<'custom', { test: string }>) => {
+ // $ExpectType "custom"
+ event.type;
+ // $ExpectType string
+ event.test;
+});
+
+// $ExpectType Map
+testMap.off('dblclick', dblClickHandler);
+// $ExpectType Map
+testMap.off('click', 'mv');
+
+// $ExpectType Map
+testMap.emit('click', {
+ target: testMap,
+ lnglat,
+ pixel
+});
+
+testMap.emit('complete');
+// $ExpectType Map
+testMap.emit('hotspotclick', {
+ lnglat,
+ name: '123',
+ id: '123',
+ isIndoorPOI: true
+});
+// $ExpectType Map
+testMap.emit('custom', {
+ test: 1
+});
+// $ExpectType Map
+testMap.emit('custom', undefined);
+
+/**
+ * pixel.ts
+ */
+
+// $ExpectType Pixel
+new AMap.Pixel(10, 20);
+// $ExpectType Pixel
+const testPixel = new AMap.Pixel(10, 20);
+
+// $ExpectType number
+testPixel.getX();
+
+// $ExpectType number
+testPixel.getY();
+
+// $ExpectType boolean
+testPixel.equals(testPixel);
+
+// $ExpectType string
+testPixel.toString();
+
+// $ExpectType Pixel
+testPixel.add({ x: 1, y: 2 });
+// $ExpectType Pixel
+testPixel.add({ x: 1, y: 2 }, false);
+
+// $ExpectType Pixel
+testPixel.round();
+
+// $ExpectType Pixel
+testPixel.floor();
+
+// $ExpectType number
+testPixel.length();
+
+// $ExpectType number | null
+testPixel.direction();
+
+// $ExpectType Pixel
+testPixel.toFixed();
+// $ExpectType Pixel
+testPixel.toFixed(2);
+
+/**
+ * size.ts
+ */
+
+// $ExpectType Size
+const testSize = new AMap.Size(10, 20);
+
+// $ExpectType number
+testSize.getHeight();
+
+// $ExpectType number
+testSize.getWidth();
+
+// $ExpectType string
+testSize.toString();
+
+// $ExpectType boolean
+testSize.contains({ x: 10, y: 10 });
+
+/**
+ * util.ts
+ */
+
+const util = AMap.Util;
+
+// $ExpectType string
+util.colorNameToHex('colorName');
+
+// $ExpectType string
+util.rgbHex2Rgba('rgbHex');
+
+// $ExpectType string
+util.argbHex2Rgba('argbHex');
+
+// $ExpectType boolean
+util.isEmpty({});
+// $ExpectError
+util.isEmpty(1);
+
+// $ExpectType number[]
+util.deleteItemFromArray([1], 1);
+
+// $ExpectType number[]
+util.deleteItemFromArrayByIndex([1], 1);
+
+// $ExpectType number
+util.indexOf([1], 1);
+// $ExpectError
+util.indexOf([1], '1');
+
+// $ExpectType number
+util.format(1);
+// $ExpectType number
+util.format(1, 1);
+
+declare const value1: number | number[];
+// $ExpectType boolean
+util.isArray(value1);
+if (util.isArray(value1)) {
+ // $ExpectType number[]
+ value1;
+} else {
+ // $ExpectType number
+ value1;
+}
+
+declare const value2: number | HTMLElement;
+// $ExpectType boolean
+util.isDOM(value2);
+if (util.isDOM(value2)) {
+ // $ExpectType HTMLElement
+ value2;
+} else {
+ // $ExpectType number
+ value2;
+}
+
+// $ExpectType boolean
+util.includes([1], 1);
+// $ExpectError
+util.includes([1], '1');
+
+// $ExpectType number
+util.requestIdleCallback(() => { });
+// $ExpectType number
+const idleCallbackHandle = util.requestIdleCallback(() => { }, { timeout: 1 });
+
+// $ExpectType void
+util.cancelIdleCallback(idleCallbackHandle);
+
+// $ExpectType number
+util.requestAnimFrame(() => { });
+// $ExpectType number
+const animFrameHandle = util.requestAnimFrame(function() {
+ // $ExpectType number
+ this.test;
+}, { test: 1 });
+
+// $ExpectType void
+util.cancelAnimFrame(animFrameHandle);
+
+/**
+ * view2d.ts
+ */
+
+// $ExpectType View2D
+new AMap.View2D();
+// $ExpectType View2D
+new AMap.View2D({});
+
+// $ExpectType View2D
+new AMap.View2D({
+ center: [1, 2],
+ rotation: 1,
+ zoom: 10,
+ crs: 'EPGS3395'
+});
+
+// $ExpectType View2D
+const testView2d = new AMap.View2D({
+ center: lnglat
+});
+
+// $ExpectType View2D
+testView2d.on('complete', () => { });
+
+/**
+ * layer/buildings.ts
+ */
+
+// $ExpectType Buildings
+new AMap.Buildings();
+// $ExpectType Buildings
+new AMap.Buildings();
+// $ExpectType Buildings
+const testBuildings = new AMap.Buildings({
+ zooms: [1, 18],
+ opacity: 0.8,
+ heightFactor: 1,
+ visible: true,
+ zIndex: 10,
+ map
+});
+
+testBuildings.setStyle({
+ hideWithoutStyle: false,
+ areas: [
+ {
+ visible: true,
+ rejectTexture: true,
+ color1: 'ffffff00',
+ color2: 'ffffcc00',
+ path: [[1, 2]]
+ },
+ {
+ visible: true,
+ rejectTexture: true,
+ color1: 'ffffff00',
+ color2: 'ffffcc00',
+ path: [lnglat]
+ },
+ {
+ color1: 'ff99ff00',
+ path: [lnglat]
+ },
+ ]
+});
+
+/**
+ * layer/canvasLayer.ts
+ */
+
+// $ExpectType CanvasLayer
+new AMap.CanvasLayer({
+ map,
+ bounds,
+ visible: true,
+ zooms: [1, 2],
+ opacity: 1
+});
+
+// $ExpectType CanvasLayer
+new AMap.CanvasLayer();
+// $ExpectType CanvasLayer
+new AMap.CanvasLayer({});
+// $ExpectType CanvasLayer
+const testCanvasLayer = new AMap.CanvasLayer({
+ bounds
+});
+
+// $ExpectType void
+testCanvasLayer.setMap(null);
+// $ExpectType void
+testCanvasLayer.setMap(map);
+
+// $ExpectType Map | null | undefined
+testCanvasLayer.getMap();
+
+// $ExpectType void
+testCanvasLayer.show();
+
+// $ExpectType void
+testCanvasLayer.hide();
+
+// $ExpectType number
+testCanvasLayer.getzIndex();
+
+// $ExpectType void
+testCanvasLayer.setzIndex(10);
+
+// $ExpectType HTMLCanvasElement | null
+testCanvasLayer.getElement();
+
+// $ExpectType void
+testCanvasLayer.setCanvas(canvasEle);
+
+// $ExpectType HTMLCanvasElement | undefined
+testCanvasLayer.getCanvas();
+
+/**
+ * layer/flexible.ts
+ */
+
+// $ExpectType Flexible
+new AMap.TileLayer.Flexible();
+// $ExpectType Flexible
+new AMap.TileLayer.Flexible({});
+// $ExpectType Flexible
+const testFlexible = new AMap.TileLayer.Flexible({
+ createTile(x, y, z, success, fail) {
+ // $ExpectType number
+ x;
+ // $ExpectType number
+ y;
+ // $ExpectType number
+ z;
+ // $ExpectType void
+ success(imgEle);
+ // $ExpectType void
+ success(canvasEle);
+ // $ExpectType void
+ fail();
+ },
+ cacheSize: 10,
+ opacity: 1,
+ visible: true,
+ map,
+ zIndex: 1,
+ zooms: [1, 2]
+});
+
+// $ExpectType void
+testFlexible.setMap(null);
+// $ExpectType void
+testFlexible.setMap(map);
+
+// $ExpectType Map | null | undefined
+testFlexible.getMap();
+
+// $ExpectType void
+testFlexible.show();
+
+// $ExpectType void
+testFlexible.hide();
+
+// $ExpectType void
+testFlexible.setzIndex(10);
+
+// $ExpectType number
+testFlexible.getzIndex();
+
+/**
+ * layer/imageLayer.ts
+ */
+
+// $ExpectType ImageLayer
+new AMap.ImageLayer({
+ map,
+ bounds,
+ visible: true,
+ zooms: [1, 2],
+ opacity: 1
+});
+
+// $ExpectType ImageLayer
+new AMap.ImageLayer();
+// $ExpectType ImageLayer
+new AMap.ImageLayer({});
+// $ExpectType ImageLayer
+const testImageLayer = new AMap.ImageLayer({
+ bounds
+});
+
+// $ExpectType void
+testImageLayer.setMap(null);
+// $ExpectType void
+testImageLayer.setMap(map);
+
+// $ExpectType Map | null | undefined
+testImageLayer.getMap();
+
+// $ExpectType void
+testImageLayer.show();
+
+// $ExpectType void
+testImageLayer.hide();
+
+// $ExpectType number
+testImageLayer.getzIndex();
+
+// $ExpectType void
+testImageLayer.setzIndex(10);
+
+// $ExpectType HTMLImageElement | null
+testImageLayer.getElement();
+
+// $ExpectType void
+testImageLayer.setImageUrl('url');
+
+// $ExpectType string | undefined
+testImageLayer.getImageUrl();
+
+/**
+ * layer/layer.ts
+ */
+
+// $ExpectError
+new AMap.Layer();
+
+// $ExpectType HTMLDivElement | undefined
+layer.getContainer();
+
+// $ExpectType [number, number]
+layer.getZooms();
+
+// $ExpectType void
+layer.setOpacity(1);
+
+// $ExpectType number
+layer.getOpacity();
+
+// $ExpectType void
+layer.show();
+
+// $ExpectType void
+layer.hide();
+
+// $ExpectType void
+layer.setMap();
+// $ExpectType void
+layer.setMap(map);
+
+// $ExpectType void
+layer.setzIndex(1);
+
+// $ExpectType number
+layer.getzIndex();
+
+/**
+ * layer/layerGroup.ts
+ */
+
+// $ExpectError
+new AMap.LayerGroup();
+
+// $ExpectType LayerGroup
+new AMap.LayerGroup(tileLayer);
+// $ExpectType LayerGroup
+const testTileLayerGroup = new AMap.LayerGroup([tileLayer]);
+// $ExpectType LayerGroup
+const testAnyLauerGroup = new AMap.LayerGroup([]);
+
+// $ExpectType LayerGroup
+testTileLayerGroup.addLayer(tileLayer);
+// $ExpectType LayerGroup
+testTileLayerGroup.addLayer([tileLayer]);
+// $ExpectError
+testTileLayerGroup.addLayer(massMarksLayer);
+
+// $ExpectType TileLayer[]
+testTileLayerGroup.getLayers();
+
+// $ExpectType TileLayer | null
+testTileLayerGroup.getLayer(function(item, index, list) {
+ // $ExpectType TileLayer
+ item;
+ // $ExpectType number
+ index;
+ // $ExpectType TileLayer[]
+ list;
+ // $ExpectType null
+ this;
+
+ return true;
+});
+
+testTileLayerGroup.hasLayer(function(item, index, list) {
+ // $ExpectType TileLayer
+ item;
+ // $ExpectType number
+ index;
+ // $ExpectType TileLayer[]
+ list;
+ // $ExpectType null
+ this;
+
+ return true;
+});
+testTileLayerGroup.hasLayer(tileLayer);
+
+// $ExpectType LayerGroup
+testTileLayerGroup.removeLayer(tileLayer);
+// $ExpectType LayerGroup
+testTileLayerGroup.removeLayer([tileLayer]);
+
+// $ExpectType LayerGroup
+testTileLayerGroup.clearLayers();
+
+testTileLayerGroup.eachLayer(function(item, index, list) {
+ // $ExpectType TileLayer
+ item;
+ // $ExpectType number
+ index;
+ // $ExpectType TileLayer[]
+ list;
+ // $ExpectType TileLayer
+ this;
+});
+testTileLayerGroup.eachLayer(function(item, index, list) {
+ // $ExpectType TileLayer
+ item;
+ // $ExpectType number
+ index;
+ // $ExpectType TileLayer[]
+ list;
+ // $ExpectType number
+ this.test;
+}, { test: 1 });
+
+// $ExpectType LayerGroup
+testTileLayerGroup.setMap(map);
+
+// $ExpectType LayerGroup
+testTileLayerGroup.hide();
+
+// $ExpectType LayerGroup
+testTileLayerGroup.show();
+
+// $ExpectType LayerGroup
+testTileLayerGroup.reload();
+
+// $ExpectType LayerGroup
+testTileLayerGroup.setOptions({});
+
+// $ExpectType LayerGroup
+testTileLayerGroup.setOptions({
+ tileSize: 256
+});
+// layerGruop.setOptions({
+// // $ExpectError
+// interval: 1
+// });
+
+testAnyLauerGroup.addLayer(tileLayer);
+
+testAnyLauerGroup.addLayer(massMarksLayer);
+
+testAnyLauerGroup.setOptions({
+ test: 1
+});
+
+/**
+ * layer/massMarks.ts
+ */
+
+const massMarksStyle1 = {
+ anchor: pixel,
+ url: '',
+ size,
+ rotation: 1
+};
+const massMarksStyle2 = {
+ anchor: pixel,
+ url: '',
+ size
+};
+const massMarksData1 = {
+ lnglat
+};
+
+interface MassMarksCustomData extends AMap.MassMarks.Data {
+ name: string;
+ id: string;
+}
+const massMarksMassMarksCustomData: MassMarksCustomData = {
+ lnglat: [1, 2],
+ style: 1,
+ name: '',
+ id: ''
+};
+
+// $ExpectError
+new AMap.MassMarks();
+// $ExpectError
+new AMap.MassMarks([], {});
+
+new AMap.MassMarks([], {
+ style: [massMarksStyle1, massMarksStyle2]
+});
+new AMap.MassMarks([massMarksData1], {
+ style: [massMarksStyle1, massMarksStyle2]
+});
+
+// $ExpectType MassMarks
+const testMassMarks = new AMap.MassMarks([massMarksMassMarksCustomData], {
+ style: [massMarksStyle1, massMarksStyle2]
+});
+
+// $ExpectType void
+testMassMarks.setStyle(massMarksStyle1);
+// $ExpectType void
+testMassMarks.setStyle([massMarksStyle1]);
+
+// $ExpectType Style | Style[]
+testMassMarks.getStyle();
+
+// $ExpectType void
+testMassMarks.setData('');
+
+// $ExpectError
+testMassMarks.setData(massMarksData1);
+// $ExpectError
+testMassMarks.setData(massMarksMassMarksCustomData);
+
+const massMarksCustomData = testMassMarks.getData()[0];
+// $ExpectType string
+massMarksCustomData.name;
+// $ExpectType string
+massMarksCustomData.id;
+// $ExpectType LngLat
+massMarksCustomData.lnglat;
+
+// $ExpectType void
+testMassMarks.clear();
+
+testMassMarks.on('click', (event: AMap.MassMarks.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+
+ // $ExpectType MassMarksCustomData
+ event.data;
+
+ // $ExpectType MassMarks
+ event.target;
+});
+
+/**
+ * layer/tileLayer.ts
+ */
+
+// $ExpectType TileLayer
+new AMap.TileLayer();
+
+// $ExpectType TileLayer
+new AMap.TileLayer({});
+
+// $ExpectType TileLayer
+const testTileLayer = new AMap.TileLayer({
+ map,
+ tileSize: 256,
+ tileUrl: '',
+ errorUrl: '',
+ getTileUrl: (x, y, z) => '',
+ zIndex: 1,
+ opacity: 0.1,
+ zooms: [3, 18],
+ detectRetina: true
+});
+
+// $ExpectType string[]
+testTileLayer.getTiles();
+
+// $ExpectType void
+testTileLayer.reload();
+
+// $ExpectType void
+testTileLayer.setTileUrl('');
+// $ExpectType void
+testTileLayer.setTileUrl((x, y, level) => {
+ // $ExpectType number
+ x;
+ // $ExpectType number
+ y;
+ // $ExpectType number
+ level;
+ return '';
+});
+
+// $ExpectType TileLayer
+testTileLayer.on('complete', () => { });
+
+testTileLayer.off('complete', () => { });
+
+testTileLayer.emit('complete');
+
+// $ExpectType Traffic
+const testTrafficLayer = new AMap.TileLayer.Traffic({});
+// $ExpectType Traffic
+new AMap.TileLayer.Traffic({
+ autoRefresh: true,
+ interval: 180
+});
+
+testTrafficLayer.on('complete', () => { });
+
+/**
+ * layer/videoLayer.ts
+ */
+
+// $ExpectType VideoLayer
+new AMap.VideoLayer({
+ map,
+ bounds,
+ visible: true,
+ zooms: [1, 2],
+ opacity: 1
+});
+
+// $ExpectType VideoLayer
+new AMap.VideoLayer();
+// $ExpectType VideoLayer
+new AMap.VideoLayer({});
+// $ExpectType VideoLayer
+const testVideoLayer = new AMap.VideoLayer({
+ bounds
+});
+
+// $ExpectType void
+testVideoLayer.setMap(null);
+// $ExpectType void
+testVideoLayer.setMap(map);
+
+// $ExpectType Map | null | undefined
+testVideoLayer.getMap();
+
+// $ExpectType void
+testVideoLayer.show();
+
+// $ExpectType void
+testVideoLayer.hide();
+
+// $ExpectType number
+testVideoLayer.getzIndex();
+
+// $ExpectType void
+testVideoLayer.setzIndex(10);
+
+// $ExpectType HTMLVideoElement | null
+testVideoLayer.getElement();
+
+// $ExpectType void
+testVideoLayer.setVideoUrl('url');
+
+// $ExpectType string | string[] | undefined
+testVideoLayer.getVideoUrl();
+
+/**
+ * layer/wms.ts
+ */
+
+// $ExpectType WMS
+new AMap.TileLayer.WMS({
+ url: 'url',
+ params: {}
+});
+// $ExpectType WMS
+const testWms = new AMap.TileLayer.WMS({
+ url: 'url',
+ blend: true,
+ params: {
+ VERSION: 'version',
+ LAYERS: 'layers',
+ STYLES: 'styles',
+ FORMAT: 'format',
+ TRANSPARENT: 'TRUE',
+ BGCOLOR: '#000',
+ EXCEPTIONS: 'exceptions',
+ TIME: 'time',
+ ELEVATION: 'elevation'
+ },
+ zooms: [1, 2],
+ tileSize: 256,
+ opacity: 1,
+ zIndex: 10,
+ visible: true
+});
+
+// $ExpectType void
+testWms.setMap(map);
+// $ExpectType void
+testWms.setMap(null);
+
+// $ExpectType Map | null | undefined
+testWms.getMap();
+
+// $ExpectType void
+testWms.show();
+
+// $ExpectType void
+testWms.hide();
+
+// $ExpectType void
+testWms.setzIndex(10);
+
+// $ExpectType number
+testWms.getzIndex();
+
+// $ExpectType void
+testWms.setUrl('url');
+
+// $ExpectType string
+testWms.getUrl();
+
+// $ExpectType void
+testWms.setParams({
+ VERSION: 'version',
+ LAYERS: 'layers',
+ STYLES: 'styles',
+ FORMAT: 'format',
+ TRANSPARENT: 'TRUE',
+ BGCOLOR: '#000',
+ EXCEPTIONS: 'exceptions',
+ TIME: 'time',
+ ELEVATION: 'elevation'
+});
+
+{
+ const params = testWms.getParams();
+ // $ExpectType string | undefined
+ params.VERSION;
+ // $ExpectType string | undefined
+ params.LAYERS;
+ // $ExpectType string | undefined
+ params.STYLES;
+ // $ExpectType string | undefined
+ params.FORMAT;
+ // $ExpectType "TRUE" | "FALSE" | undefined
+ params.TRANSPARENT;
+ // $ExpectType string | undefined
+ params.BGCOLOR;
+ // $ExpectType string | undefined
+ params.EXCEPTIONS;
+ // $ExpectType string | undefined
+ params.TIME;
+ // $ExpectType string | undefined
+ params.ELEVATION;
+}
+
+/**
+ * layer/wmts.ts
+ */
+
+// $ExpectType WMTS
+new AMap.TileLayer.WMTS({
+ url: 'url',
+ params: {}
+});
+// $ExpectType WMTS
+const testWmts = new AMap.TileLayer.WMTS({
+ url: 'url',
+ blend: true,
+ tileSize: 256,
+ zooms: [1, 2],
+ opacity: 1,
+ zIndex: 10,
+ visible: true,
+ params: {
+ Version: 'version',
+ Layer: 'layers',
+ Style: 'style',
+ Format: 'format'
+ }
+});
+
+// $ExpectType void
+testWmts.setMap(map);
+// $ExpectType void
+testWmts.setMap(null);
+
+// $ExpectType Map | null | undefined
+testWmts.getMap();
+
+// $ExpectType void
+testWmts.show();
+
+// $ExpectType void
+testWmts.hide();
+
+// $ExpectType void
+testWmts.setzIndex(10);
+
+// $ExpectType number
+testWmts.getzIndex();
+
+// $ExpectType void
+testWmts.setUrl('url');
+
+// $ExpectType string
+testWmts.getUrl();
+
+// $ExpectType void
+testWmts.setParams({
+ Version: 'version',
+ Layer: 'layers',
+ Style: 'style',
+ Format: 'format'
+});
+
+{
+ const params = testWmts.getParams();
+ // $ExpectType string | undefined
+ params.Version;
+ // $ExpectType string | undefined
+ params.Layer;
+ // $ExpectType string | undefined
+ params.Style;
+ // $ExpectType string | undefined
+ params.Format;
+}
+
+/**
+ * overlay/bezierCurve.ts
+ */
+
+interface BezierCurveExtraData {
+ test: number;
+}
+
+const bezierCurvePath = [
+ [1, 2, 3, 4],
+ [1, 2, 3],
+ [
+ [1, 2, 3],
+ [1, 2]
+ ],
+ [1, 2]
+];
+
+// $ExpectError
+new AMap.BezierCurve();
+// $ExpectError
+new AMap.BezierCurve({});
+// $ExpectType BezierCurve
+const testBezierCurve = new AMap.BezierCurve({
+ map,
+ path: bezierCurvePath,
+ strokeColor: '#FF0000',
+ strokeOpacity: 0.6,
+ strokeWeight: 10,
+ strokeStyle: 'dashed',
+ strokeDasharray: [1, 5],
+ zIndex: 10,
+ bubble: false,
+ showDir: true,
+ cursor: 'pointer',
+ isOutline: true,
+ outlineColor: '#00FF00',
+ borderWeight: 2
+});
+
+// $ExpectType void
+testBezierCurve.setPath(bezierCurvePath);
+
+// $ExpectType void
+testBezierCurve.setPath(bezierCurvePath);
+
+// $ExpectType void
+testBezierCurve.setOptions({});
+testBezierCurve.setOptions({
+ map,
+ path: bezierCurvePath,
+ strokeColor: '#FF0000',
+ strokeOpacity: 0.6,
+ strokeWeight: 10,
+ strokeStyle: 'dashed',
+ strokeDasharray: [1, 5],
+ zIndex: 10,
+ bubble: false,
+ showDir: true,
+ cursor: 'pointer',
+ isOutline: true,
+ outlineColor: '#00FF00',
+ borderWeight: 2
+});
+
+{
+ const options = testBezierCurve.getOptions();
+
+ // $ExpectType number | undefined
+ options.borderWeight;
+ // $ExpectType boolean | undefined
+ options.bubble;
+ // $ExpectType boolean | undefined
+ options.clickable;
+ // $ExpectType string | undefined
+ options.dirColor;
+ // $ExpectType string | undefined
+ options.dirImg;
+ // $ExpectType {} | BezierCurveExtraData | undefined
+ options.extData;
+ // $ExpectType boolean | undefined
+ options.geodesic;
+ // $ExpectType boolean | undefined
+ options.isOutline;
+ // $ExpectType "round" | "butt" | "square" | undefined
+ options.lineCap;
+ // $ExpectType "miter" | "round" | "bevel" | undefined
+ options.lineJoin;
+ // $ExpectType Map | undefined
+ options.map;
+ // $ExpectType string | undefined
+ options.outlineColor;
+ // $ExpectType (LngLat & { controlPoints: LngLat[]; })[] | undefined
+ options.path;
+ // $ExpectType boolean | undefined
+ options.showDir;
+ // $ExpectType string | undefined
+ options.strokeColor;
+ // $ExpectType number[] | undefined
+ options.strokeDasharray;
+ // $ExpectType number | undefined
+ options.strokeOpacity;
+ // $ExpectType "dashed" | "solid" | undefined
+ options.strokeStyle;
+ // $ExpectType number | undefined
+ options.strokeWeight;
+ // $ExpectType number | undefined
+ options.zIndex;
+}
+
+// $ExpectType number
+testBezierCurve.getLength();
+
+// $ExpectType Bounds | null
+testBezierCurve.getBounds();
+
+// $ExpectType void
+testBezierCurve.show();
+
+// $ExpectType void
+testBezierCurve.hide();
+
+// $ExpectType void
+testBezierCurve.setMap(null);
+testBezierCurve.setMap(map);
+
+// $ExpectType void
+testBezierCurve.setExtData({ test: 1 });
+// $ExpectError
+testBezierCurve.setExtData({ test: '123' });
+
+// $ExpectType {} | BezierCurveExtraData
+testBezierCurve.getExtData();
+
+testBezierCurve.on('click', (event: AMap.BezierCurve.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType LngLat
+ event.lnglat;
+ // $ExpectType BezierCurve
+ event.target;
+});
+
+testBezierCurve.on('show', (event: AMap.BezierCurve.EventMap['show']) => {
+ // $ExpectType "show"
+ event.type;
+ // $ExpectType BezierCurve
+ event.target;
+});
+
+testBezierCurve.on('options', (event: AMap.BezierCurve.EventMap['options']) => {
+ // $ExpectType "options"
+ event.type;
+ // $ExpectError
+ event.target;
+});
+
+/**
+ * overlay/circle.ts
+ */
+
+interface CircleExtraData {
+ test: number;
+}
+
+// $ExpectType Circle
+new AMap.Circle();
+new AMap.Circle({});
+// $ExpectType Circle
+const testCircle = new AMap.Circle({
+ map,
+ zIndex: 10,
+ center: lnglat,
+ bubble: true,
+ cursor: 'pointer',
+ radius: 1000,
+ strokeColor: '#FF0000',
+ strokeOpacity: 0.8,
+ strokeWeight: 3,
+ fillColor: '#00FF00',
+ fillOpacity: 0.5,
+ strokeStyle: 'dashed',
+ extData: { test: 1 },
+ strokeDasharray: [2, 4]
+});
+
+// $ExpectType void
+testCircle.setCenter(lnglat);
+// $ExpectType void
+testCircle.setCenter(lnglatTuple);
+
+// $ExpectType LngLat | undefined
+testCircle.getCenter();
+
+// $ExpectType Bounds | null
+testCircle.getBounds();
+
+// $ExpectType void
+testCircle.setRadius(100);
+
+// $ExpectType number
+testCircle.getRadius();
+
+// $ExpectType void
+testCircle.setOptions({});
+testCircle.setOptions({
+ map,
+ zIndex: 10,
+ center: lnglat,
+ bubble: true,
+ cursor: 'pointer',
+ radius: 1000,
+ strokeColor: '#FF0000',
+ strokeOpacity: 0.8,
+ strokeWeight: 3,
+ fillColor: '#00FF00',
+ fillOpacity: 0.5,
+ strokeStyle: 'dashed',
+ extData: { test: 1 },
+ strokeDasharray: [2, 4]
+});
+
+{
+ const options = testCircle.getOptions();
+ // $ExpectType boolean | undefined
+ options.bubble;
+ // $ExpectType LngLat | undefined
+ options.center;
+ // $ExpectType boolean | undefined
+ options.clickable;
+ // $ExpectType {} | CircleExtraData | undefined
+ options.extData;
+ // $ExpectType string | undefined
+ options.fillColor;
+ // $ExpectType number | undefined
+ options.fillOpacity;
+ // $ExpectType "miter" | "round" | "bevel" | undefined
+ options.lineJoin;
+ // $ExpectType Map | undefined
+ options.map;
+ // $ExpectType LngLat[] | undefined
+ options.path;
+ // $ExpectType number | undefined
+ options.radius;
+ // $ExpectType string | undefined
+ options.strokeColor;
+ // $ExpectType number[] | undefined
+ options.strokeDasharray;
+ // $ExpectType number | undefined
+ options.strokeOpacity;
+ // $ExpectType "dashed" | "solid" | undefined
+ options.strokeStyle;
+ // $ExpectType number | undefined
+ options.strokeWeight;
+ // $ExpectType string | undefined
+ options.texture;
+ // $ExpectType number | undefined
+ options.zIndex;
+}
+
+// $ExpectType Bounds | null
+testCircle.getBounds();
+
+// $ExpectType void
+testCircle.hide();
+
+// $ExpectType void
+testCircle.show();
+
+// $ExpectType void
+testCircle.setMap(null);
+// $ExpectType void
+testCircle.setMap(map);
+
+// $ExpectType void
+testCircle.setExtData({ test: 2 });
+// $ExpectError
+testCircle.setExtData({ test: '1' });
+
+// $ExpectType {} | CircleExtraData
+testCircle.getExtData();
+
+// $ExpectType boolean
+testCircle.contains(lnglat);
+// $ExpectType boolean
+testCircle.contains(lnglatTuple);
+
+testCircle.on('click', (event: AMap.Circle.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Circle
+ event.target;
+});
+
+testCircle.on('setCenter', (event: AMap.Circle.EventMap['setCenter']) => {
+ // $ExpectType "setCenter"
+ event.type;
+ // $ExpectError
+ event.target;
+});
+
+testCircle.on('change', (event: AMap.Circle.EventMap['change']) => {
+ // $ExpectType "change"
+ event.type;
+ // $ExpectType Circle
+ event.target;
+});
+
+/**
+ * overlay/contextMenu.ts
+ */
+
+interface ContextMenuExtraData {
+ test: number;
+}
+// $ExpectType ContextMenu
+new AMap.ContextMenu();
+// $ExpectType ContextMenu
+new AMap.ContextMenu({});
+// $ExpectType ContextMenu
+const testContextMenu = new AMap.ContextMenu({
+ content: 'content
',
+});
+
+// $ExpectType void
+testContextMenu.addItem('item', function() {
+ // $ExpectType HTMLLIElement
+ this;
+});
+// $ExpectType void
+testContextMenu.addItem('item', () => { }, 1);
+
+// $ExpectType void
+testContextMenu.removeItem('item', () => {});
+
+// $ExpectType void
+testContextMenu.open(map, lnglatTuple);
+// $ExpectType void
+testContextMenu.open(map, lnglat);
+
+// $ExpectType void
+testContextMenu.close();
+
+testContextMenu.on('items', (event: AMap.ContextMenu.EventMap['items']) => {
+ // $ExpectType "items"
+ event.type;
+});
+
+testContextMenu.on('open', (event: AMap.ContextMenu.EventMap['open']) => {
+ // $ExpectType "open"
+ event.type;
+ // $ExpectType ContextMenu
+ event.target;
+});
+
+/**
+ * overlay/ellipse.ts
+ */
+
+interface EllipseExtraData {
+ test: number;
+}
+// $ExpectType Ellipse
+new AMap.Ellipse();
+// $ExpectType Ellipse
+new AMap.Ellipse({});
+// $ExpectType Ellipse
+const testEllipse = new AMap.Ellipse({
+ map,
+ zIndex: 10,
+ center: lnglat,
+ radius: [10000, 15000],
+ bubble: false,
+ cursor: 'pointer',
+ strokeColor: '#FF0000',
+ strokeOpacity: 0.8,
+ strokeWeight: 2,
+ fillColor: '#0000FF',
+ fillOpacity: 0.5,
+ strokeStyle: 'dashed',
+ extData: { test: 1 },
+ strokeDasharray: [1, 5]
+});
+
+// $ExpectType LngLat | undefined
+testEllipse.getCenter();
+
+// $ExpectType void
+testEllipse.setCenter(lnglat);
+// $ExpectType void
+testEllipse.setCenter(lnglatTuple);
+
+// $ExpectType Bounds | null
+testEllipse.getBounds();
+
+// $ExpectType void
+testEllipse.setOptions({
+ map,
+ zIndex: 10,
+ center: lnglat,
+ radius: [10000, 15000],
+ bubble: false,
+ cursor: 'pointer',
+ strokeColor: '#FF0000',
+ strokeOpacity: 0.8,
+ strokeWeight: 2,
+ fillColor: '#0000FF',
+ fillOpacity: 0.5,
+ strokeStyle: 'dashed',
+ extData: { test: 1 },
+ strokeDasharray: [1, 5]
+});
+
+{
+ const options = testEllipse.getOptions();
+
+ // $ExpectType boolean | undefined
+ options.bubble;
+ // $ExpectType LngLat | undefined
+ options.center;
+ // $ExpectType boolean | undefined
+ options.clickable;
+ // $ExpectType {} | EllipseExtraData | undefined
+ options.extData;
+ // $ExpectType string | undefined
+ options.fillColor;
+ // $ExpectType number | undefined
+ options.fillOpacity;
+ // $ExpectType "miter" | "round" | "bevel" | undefined
+ options.lineJoin;
+ // $ExpectType Map | undefined
+ options.map;
+ // $ExpectType LngLat[] | undefined
+ options.path;
+ // $ExpectType [number, number] | undefined
+ options.radius;
+ // $ExpectType string | undefined
+ options.strokeColor;
+ // $ExpectType number[] | undefined
+ options.strokeDasharray;
+ // $ExpectType number | undefined
+ options.strokeOpacity;
+ // $ExpectType "dashed" | "solid" | undefined
+ options.strokeStyle;
+ // $ExpectType number | undefined
+ options.strokeWeight;
+ // $ExpectType string | undefined
+ options.texture;
+ // $ExpectType number | undefined
+ options.zIndex;
+}
+
+// $ExpectType void
+testEllipse.hide();
+
+// $ExpectType void
+testEllipse.show();
+
+// $ExpectType void
+testEllipse.setMap(null);
+// $ExpectType void
+testEllipse.setMap(map);
+
+// $ExpectType void
+testEllipse.setExtData({ test: 2 });
+// $ExpectType {} | EllipseExtraData
+testEllipse.getExtData();
+
+// $ExpectType boolean
+testEllipse.contains(lnglat);
+// $ExpectType boolean
+testEllipse.contains(lnglatTuple);
+
+/**
+ * overlay/geoJSON.ts
+ */
+
+interface GeoJSONExtraData {
+ test: number;
+}
+
+const geoJSONObject: AMap.GeoJSON.GeoJSONObject[] = [
+ {
+ type: 'Feature',
+ properties: {},
+ geometry: {
+ type: 'Point',
+ coordinates: lnglatTuple
+ }
+ },
+ {
+ type: 'Feature',
+ properties: { test: 1 },
+ geometry: {
+ type: 'LineString',
+ coordinates: [lnglatTuple, lnglatTuple]
+ }
+ }
+];
+
+// $ExpectType GeoJSON
+new AMap.GeoJSON();
+// $ExpectType GeoJSON
+new AMap.GeoJSON({});
+// $ExpectType GeoJSON
+const testGeoJSON = new AMap.GeoJSON({
+ geoJSON: geoJSONObject,
+ getMarker(obj, lnglat) {
+ // $ExpectType GeoJSONObject
+ obj;
+ // $ExpectType LngLat
+ lnglat;
+ return marker;
+ },
+ getPolyline(obj, lnglats) {
+ // $ExpectType GeoJSONObject
+ obj;
+ // $ExpectType LngLat[]
+ lnglats;
+ return testPolyline;
+ },
+ getPolygon(obj, lnglats) {
+ // $ExpectType GeoJSONObject
+ obj;
+ // $ExpectType LngLat[]
+ lnglats;
+ return testPolygon;
+ },
+ coordsToLatLng(coord) {
+ // $ExpectType LngLat
+ coord;
+ return coord;
+ }
+});
+
+// $ExpectType void
+testGeoJSON.importData(geoJSONObject);
+
+// $ExpectType GeoJSON
+testGeoJSON.removeOverlay(marker);
+// $ExpectType GeoJSON
+testGeoJSON.removeOverlay([marker]);
+
+// $ExpectType boolean
+testGeoJSON.hasOverlay(marker);
+// $ExpectType boolean
+testGeoJSON.hasOverlay(m => m === marker);
+
+// $ExpectType GeoJSON
+testGeoJSON.addOverlay(marker);
+// $ExpectType GeoJSON
+testGeoJSON.addOverlay([marker]);
+
+// $ExpectType GeoJSONObject[]
+testGeoJSON.toGeoJSON();
+
+// $ExpectType GeoJSON
+testGeoJSON.setMap(null);
+// $ExpectType GeoJSON
+testGeoJSON.setMap(map);
+
+// $ExpectType GeoJSON
+testGeoJSON.hide();
+
+// $ExpectType GeoJSON
+testGeoJSON.show();
+
+testGeoJSON.on('click', (event: AMap.MapsEvent<'click', AMap.Overlay>) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Overlay
+ event.target;
+});
+
+/**
+ * overlay/icon.ts
+ */
+
+// $ExpectType Icon
+new AMap.Icon();
+// $ExpectType Icon
+new AMap.Icon({});
+// $ExpectType Icon
+new AMap.Icon({
+ size,
+ imageOffset: pixel,
+ image: 'image uri',
+ imageSize: size
+});
+// $ExpectType Icon
+const testIcon = new AMap.Icon({
+ size: [1, 2],
+ imageOffset: pixel,
+ image: 'image uri',
+ imageSize: [1, 2]
+});
+
+// $ExpectType Size
+testIcon.getImageSize();
+
+// $ExpectType void
+testIcon.setImageSize(size);
+// $ExpectType void
+testIcon.setImageSize([1, 2]);
+
+/**
+ * overlay/infoWindow.ts
+ */
+
+interface InfoWindowExtraData {
+ test: number;
+}
+
+// $ExpectType InfoWindow
+new AMap.InfoWindow();
+// $ExpectType InfoWindow
+new AMap.InfoWindow({});
+// $ExpectType InfoWindow
+const testInfoWindow = new AMap.InfoWindow({
+ isCustom: false,
+ autoMove: false,
+ closeWhenClickMap: false,
+ content: 'content',
+ size: [100, 100],
+ anchor: 'bottom-center',
+ offset: new AMap.Pixel(10, 10),
+ position: lnglat,
+ showShadow: true
+});
+
+// $ExpectType void
+testInfoWindow.open(map);
+// $ExpectType void
+testInfoWindow.open(map, lnglat);
+// $ExpectType void
+testInfoWindow.open(map, lnglatTuple);
+
+// $ExpectType void
+testInfoWindow.close();
+
+// $ExpectType boolean
+testInfoWindow.getIsOpen();
+
+// $ExpectType void
+testInfoWindow.setContent('content');
+// $ExpectType void
+testInfoWindow.setContent(div);
+
+// $ExpectType string | HTMLElement | undefined
+testInfoWindow.getContent();
+
+// $ExpectType void
+testInfoWindow.setPosition(lnglat);
+// $ExpectType void
+testInfoWindow.setPosition(lnglatTuple);
+
+// $ExpectType LngLat | undefined
+testInfoWindow.getPosition();
+
+const testInfoWindowAnchor = testInfoWindow.getAnchor();
+if (testInfoWindowAnchor !== undefined) {
+ // $ExpectType Anchor
+ testInfoWindowAnchor;
+} else {
+ // $ExpectType undefined
+ testInfoWindowAnchor;
+}
+
+// $ExpectType void
+testInfoWindow.setAnchor();
+// $ExpectType void
+testInfoWindow.setAnchor(testInfoWindowAnchor);
+
+// $ExpectType Size | undefined
+testInfoWindow.getSize();
+
+testInfoWindow.on('change', (event: AMap.InfoWindow.EventMap['change']) => {
+ // $ExpectType "change"
+ event.type;
+ // $ExpectType InfoWindow
+ event.target;
+});
+
+testInfoWindow.on('close', (event: AMap.InfoWindow.EventMap['close']) => {
+ // $ExpectType "close"
+ event.type;
+ // $ExpectType InfoWindow
+ event.target;
+});
+
+testInfoWindow.on('open', (event: AMap.InfoWindow.EventMap['open']) => {
+ // $ExpectType "open"
+ event.type;
+ // $ExpectType InfoWindow
+ event.target;
+});
+
+/**
+ * overlay/marker.ts
+ */
+
+interface MarkerExtraData {
+ test: number;
+}
+
+// $ExpectType Marker
+new AMap.Marker();
+// $ExpectType Marker
+new AMap.Marker();
+// $ExpectType Marker
+new AMap.Marker({});
+// $ExpectType Marker
+export const testMarker = new AMap.Marker({
+ map,
+ position: lnglat,
+ anchor: 'bottom-center',
+ offset: pixel,
+ icon: 'iconUrl',
+ content: 'htmlString',
+ topWhenClick: true,
+ raiseOnDrag: true,
+ cursor: 'default',
+ visible: true,
+ zIndex: 10,
+ angle: 10,
+ autoRotation: true,
+ animation: 'AMAP_ANIMATION_BOUNCE',
+ shadow: icon,
+ title: '123',
+ clickable: true,
+ shape: markerShape,
+ extData: {
+ test: 123
+ }
+});
+
+// $ExpectType void
+testMarker.markOnAMAP({
+ name: '123',
+ position: [1, 2]
+});
+// $ExpectType void
+testMarker.markOnAMAP();
+// $ExpectType void
+testMarker.markOnAMAP({});
+// $ExpectType void
+testMarker.markOnAMAP({
+ position: [1, 2],
+ name: '123'
+});
+
+const testMarkerAnchor = testMarker.getAnchor();
+if (testMarkerAnchor) {
+ // $ExpectType Anchor
+ testMarkerAnchor;
+} else {
+ // $ExpectType undefined
+ testMarkerAnchor;
+}
+
+// $ExpectType void
+testMarker.setAnchor(testMarkerAnchor);
+// $ExpectType void
+testMarker.setAnchor();
+
+// $ExpectType Pixel
+testMarker.getOffset();
+
+// $ExpectType void
+testMarker.setOffset(pixel);
+
+// $ExpectType void
+testMarker.setAnimation('AMAP_ANIMATION_BOUNCE');
+
+// $ExpectType AnimationName
+testMarker.getAnimation();
+
+// $ExpectType void
+testMarker.setClickable(true);
+
+// $ExpectType boolean
+testMarker.getClickable();
+
+// $ExpectType LngLat | undefined
+testMarker.getPosition();
+
+// $ExpectType void
+testMarker.setPosition(lnglat);
+
+// $ExpectType void
+testMarker.setAngle(0);
+
+// $ExpectType void
+testMarker.setLabel();
+// $ExpectType void
+testMarker.setLabel({});
+// $ExpectType void
+testMarker.setLabel({
+ content: 'label content',
+ offset: pixel
+});
+
+// $ExpectType Label | undefined
+testMarker.getLabel();
+
+// $ExpectType number
+testMarker.getAngle();
+
+// $ExpectType void
+testMarker.setzIndex(100);
+
+// $ExpectType number
+testMarker.getzIndex();
+
+// $ExpectType void
+testMarker.setIcon('icon uri');
+// $ExpectType void
+testMarker.setIcon(icon);
+
+// $ExpectType string | Icon | undefined
+testMarker.getIcon();
+
+// $ExpectType void
+testMarker.setDraggable(true);
+
+// $ExpectType boolean
+testMarker.getDraggable();
+
+// $ExpectType void
+testMarker.setCursor('default');
+
+// $ExpectType void
+testMarker.setContent('content');
+// $ExpectType void
+testMarker.setContent(domEle);
+
+// $ExpectType string | HTMLElement
+testMarker.getContent();
+
+// $ExpectType void
+testMarker.moveAlong([lnglat], 100);
+// $ExpectError
+testMarker.moveAlong([[1, 2]], 100);
+// $ExpectType void
+testMarker.moveAlong([lnglat], 100, t => t, false);
+
+// $ExpectType void
+testMarker.moveTo(lnglat, 100);
+// $ExpectType void
+testMarker.moveTo([1, 2], 100);
+// $ExpectType void
+testMarker.moveTo([1, 2], 100, t => t);
+
+// $ExpectType void
+testMarker.stopMove();
+
+// $ExpectType boolean
+testMarker.pauseMove();
+
+// $ExpectType boolean
+testMarker.resumeMove();
+
+// $ExpectType void
+testMarker.setMap(map);
+
+// $ExpectType void
+testMarker.setTitle('title');
+// $ExpectError
+testMarker.setTitle();
+
+// $ExpectType string | undefined
+testMarker.getTitle();
+
+// $ExpectType void
+testMarker.setTop(true);
+
+// $ExpectType boolean
+testMarker.getTop();
+
+// $ExpectType void
+testMarker.setShadow();
+// $ExpectType void
+testMarker.setShadow(icon);
+// $ExpectType void
+testMarker.setShadow('shadow url');
+
+// $ExpectType string | Icon | undefined
+testMarker.getShadow();
+
+// $ExpectType void
+testMarker.setShape();
+// $ExpectType void
+testMarker.setShape(markerShape);
+
+// $ExpectType MarkerShape | undefined
+testMarker.getShape();
+
+testMarker.on('click', (event: AMap.Marker.EventMap['click']) => {
+ // $ExpectType {} | MarkerExtraData
+ event.target.getExtData();
+});
+
+/**
+ * overlay/markerShape.ts
+ */
+
+// $ExpectType MarkerShape
+new AMap.MarkerShape({
+ type: 'circle',
+ coords: [1, 1, 1]
+});
+// $ExpectType MarkerShape
+new AMap.MarkerShape({
+ type: 'rect',
+ coords: [1, 1, 1, 2]
+});
+// $ExpectType MarkerShape
+new AMap.MarkerShape({
+ type: 'poly',
+ coords: [1, 2, 3, 4, 5]
+});
+
+// $ExpectError
+new AMap.MarkerShape({
+ type: 'circle',
+ coords: [1, 1]
+});
+// $ExpectError
+new AMap.MarkerShape({
+ type: 'rect',
+ coords: [1, 1, 1, 2, 2]
+});
+
+/**
+ * overlay/overlay.ts
+ */
+
+interface OverlayExtraData {
+ test: number;
+}
+declare const testOverlay: AMap.Overlay;
+
+// $ExpectType void
+testOverlay.show();
+
+// $ExpectType void
+testOverlay.hide();
+
+// $ExpectType Map | null | undefined
+testOverlay.getMap();
+
+// $ExpectType void
+testOverlay.setMap(map);
+// $ExpectType void
+testOverlay.setMap(null);
+
+// $ExpectError
+testOverlay.setExtData({ any: 123 });
+
+// $ExpectError OverlayExtraData
+testOverlay.getExtData();
+
+/**
+ * overlay/overlayGroup.ts
+ */
+
+// $ExpectType OverlayGroup, any>
+const testOverlayGroup2 = new AMap.OverlayGroup();
+// $ExpectType OverlayGroup, any>
+new AMap.OverlayGroup(marker);
+// $ExpectType OverlayGroup, any>
+const testOverlayGroup = new AMap.OverlayGroup([marker]);
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.addOverlay(marker);
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.addOverlay([marker]);
+// $ExpectError
+testOverlayGroup.addOverlay([testCircle]);
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.addOverlays(marker);
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.addOverlays([marker]);
+
+// $ExpectType Marker[]
+testOverlayGroup.getOverlays();
+
+// $ExpectType boolean
+testOverlayGroup.hasOverlay(marker);
+// $ExpectType boolean
+testOverlayGroup.hasOverlay(o => o === marker);
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.removeOverlay(marker);
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.removeOverlay([marker]);
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.removeOverlays(marker);
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.removeOverlays([marker]);
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.clearOverlays();
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.eachOverlay(function(overlay, index, overlays) {
+ // $ExpectType Marker
+ overlay;
+ // $ExpectType number
+ index;
+ // $ExpectType Marker[]
+ overlays;
+ // $ExpectType Marker
+ this;
+});
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.setMap(null);
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.setMap(map);
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup2.setOptions({
+ test: 1
+});
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.setOptions({
+ map,
+ position: lnglat,
+ offset: pixel,
+ icon: 'iconUrl',
+ content: 'htmlString',
+ topWhenClick: true,
+ raiseOnDrag: true,
+ cursor: 'default',
+ visible: true,
+ zIndex: 10,
+ angle: 10,
+ autoRotation: true,
+ animation: 'AMAP_ANIMATION_BOUNCE',
+ shadow: icon,
+ title: '123',
+ clickable: true,
+ shape: markerShape,
+ extData: {
+ test: 123
+ }
+});
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.show();
+
+// $ExpectType OverlayGroup, any>
+testOverlayGroup.hide();
+
+testOverlayGroup.on('click', (event: AMap.MapsEvent<'click', AMap.Overlay>) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Overlay
+ event.target;
+});
+
+/**
+ * overlay/polygon.ts
+ */
+
+interface PolygonExtraData {
+ test: number;
+}
+
+const polygonPath1 = [lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple];
+const polygonPath2 = [lnglat, lnglat, lnglat, lnglat, lnglat];
+
+// $ExpectType Polygon
+new AMap.Polygon();
+// $ExpectType Polygon
+new AMap.Polygon({});
+// $ExpectType Polygon
+const testPolygon = new AMap.Polygon({
+ map,
+ zIndex: 10,
+ bubble: true,
+ cursor: 'pointer',
+ strokeColor: '#00FF00',
+ strokeOpacity: 0.3,
+ strokeWeight: 5,
+ fillColor: '#0000FF',
+ fillOpacity: 0.5,
+ draggable: true,
+ extData: { test: 1 },
+ strokeStyle: 'dashed',
+ strokeDasharray: [2, 4],
+ path: polygonPath1
+});
+
+// $ExpectType void
+testPolygon.setPath(polygonPath1);
+// $ExpectType void
+testPolygon.setPath(polygonPath2);
+// $ExpectType void
+testPolygon.setPath([polygonPath1, polygonPath2]);
+
+// $ExpectType LngLat[] | LngLat[][]
+testPolygon.getPath();
+
+// $ExpectType void
+testPolygon.setOptions({
+ map,
+ zIndex: 10,
+ bubble: true,
+ cursor: 'pointer',
+ strokeColor: '#00FF00',
+ strokeOpacity: 0.8,
+ strokeWeight: 5,
+ fillColor: '#0000FF',
+ fillOpacity: 0.5,
+ draggable: true,
+ extData: { test: 1 },
+ strokeStyle: 'dashed',
+ strokeDasharray: [4, 2],
+ path: [polygonPath2, polygonPath1]
+});
+
+{
+ const options = testPolygon.getOptions();
+ // $ExpectType boolean | undefined
+ options.bubble;
+ // $ExpectType boolean | undefined
+ options.clickable;
+ // $ExpectType {} | PolygonExtraData | undefined
+ options.extData;
+ // $ExpectType string | undefined
+ options.fillColor;
+ // $ExpectType number | undefined
+ options.fillOpacity;
+ // $ExpectType "miter" | "round" | "bevel" | undefined
+ options.lineJoin;
+ // $ExpectType Map | undefined
+ options.map;
+ // $ExpectType LngLat[] | LngLat[][] | undefined
+ options.path;
+ // $ExpectType string | undefined
+ options.strokeColor;
+ // $ExpectType number[] | undefined
+ options.strokeDasharray;
+ // $ExpectType number | undefined
+ options.strokeOpacity;
+ // $ExpectType "dashed" | "solid" | undefined
+ options.strokeStyle;
+ // $ExpectType number | undefined
+ options.strokeWeight;
+ // $ExpectType string | undefined
+ options.texture;
+ // $ExpectType number | undefined
+ options.zIndex;
+}
+
+// $ExpectType Bounds | null
+testPolygon.getBounds();
+
+// $ExpectType number
+testPolygon.getArea();
+
+// $ExpectType void
+testPolygon.setMap(null);
+// $ExpectType void
+testPolygon.setMap(map);
+
+// $ExpectType void
+testPolygon.setExtData({ test: 1 });
+
+// $ExpectType {} | PolygonExtraData
+testPolygon.getExtData();
+
+// $ExpectType boolean
+testPolygon.contains(lnglat);
+// $ExpectType boolean
+testPolygon.contains(lnglatTuple);
+
+testPolygon.on('click', (event: AMap.Polygon.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Polygon
+ event.target;
+});
+
+/**
+ * overlay/polyline.ts
+ */
+
+interface PolylineExtraData {
+ test: number;
+}
+
+// $ExpectType Polyline
+new AMap.Polyline();
+// $ExpectType Polyline
+new AMap.Polyline({});
+// $ExpectType Polyline
+const testPolyline = new AMap.Polyline({
+ map,
+ zIndex: 10,
+ bubble: true,
+ cursor: 'default',
+ geodesic: true,
+ isOutline: true,
+ borderWeight: 1,
+ outlineColor: '#AA0000',
+ path: [lnglat],
+ strokeColor: '#0000AA',
+ strokeOpacity: 0.5,
+ strokeWeight: 10,
+ strokeStyle: 'dashed',
+ strokeDasharray: [20, 10, 20],
+ lineJoin: 'bevel',
+ lineCap: 'butt',
+ draggable: true,
+ extData: { test: 1 },
+ showDir: true
+});
+// Polyline
+
+// $ExpectType void
+testPolyline.setPath([lnglat]);
+// $ExpectType void
+testPolyline.setPath([lnglatTuple]);
+
+// $ExpectType void
+testPolyline.setOptions({});
+// $ExpectType void
+testPolyline.setOptions({
+ map,
+ zIndex: 10,
+ bubble: true,
+ cursor: 'default',
+ geodesic: true,
+ isOutline: true,
+ borderWeight: 1,
+ outlineColor: '#AA0000',
+ path: [lnglat, lnglat],
+ strokeColor: '#0000AA',
+ strokeOpacity: 0.5,
+ strokeWeight: 10,
+ strokeStyle: 'dashed',
+ strokeDasharray: [20, 10, 20],
+ lineJoin: 'bevel',
+ lineCap: 'butt',
+ draggable: true,
+ extData: { test: 1 },
+ showDir: true
+});
+
+{
+ const options = testPolyline.getOptions();
+ // $ExpectType number | undefined
+ options.borderWeight;
+ // $ExpectType boolean | undefined
+ options.bubble;
+ // $ExpectType boolean | undefined
+ options.clickable;
+ // $ExpectType string | undefined
+ options.dirColor;
+ // $ExpectType string | undefined
+ options.dirImg;
+ // $ExpectType {} | PolylineExtraData | undefined
+ options.extData;
+ // $ExpectType boolean | undefined
+ options.geodesic;
+ // $ExpectType boolean | undefined
+ options.isOutline;
+ // $ExpectType "round" | "butt" | "square" | undefined
+ options.lineCap;
+ // $ExpectType "miter" | "round" | "bevel" | undefined
+ options.lineJoin;
+ // $ExpectType Map | undefined
+ options.map;
+ // $ExpectType string | undefined
+ options.outlineColor;
+ // $ExpectType LngLat[] | undefined
+ options.path;
+ // $ExpectType boolean | undefined
+ options.showDir;
+ // $ExpectType string | undefined
+ options.strokeColor;
+ // $ExpectType number[] | undefined
+ options.strokeDasharray;
+ // $ExpectType number | undefined
+ options.strokeOpacity;
+ // $ExpectType "dashed" | "solid" | undefined
+ options.strokeStyle;
+ // $ExpectType number | undefined
+ options.strokeWeight;
+ // $ExpectType number | undefined
+ options.zIndex;
+}
+
+// $ExpectType number
+testPolyline.getLength();
+
+// $ExpectType Bounds | null
+testPolyline.getBounds();
+
+// $ExpectType void
+testPolyline.hide();
+
+// $ExpectType void
+testPolyline.show();
+
+// $ExpectType void
+testPolyline.setMap(null);
+// $ExpectType void
+testPolyline.setMap(map);
+
+// $ExpectType void
+testPolyline.setExtData({ test: 1 });
+
+// $ExpectType {} | PolylineExtraData
+testPolyline.getExtData();
+
+testPolyline.on('click', (event: AMap.Polyline.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Polyline
+ event.target;
+});
+
+/**
+ * overlay/rectangle.ts
+ */
+
+interface RectangleExtraData {
+ test: number;
+}
+
+// $ExpectType Rectangle
+new AMap.Rectangle();
+// $ExpectType Rectangle
+new AMap.Rectangle({});
+// $ExpectType Rectangle
+const testRectangle = new AMap.Rectangle({
+ map,
+ zIndex: 10,
+ bounds,
+ bubble: false,
+ cursor: 'pointer',
+ strokeColor: '#00FF00',
+ strokeOpacity: 0.8,
+ strokeWeight: 2,
+ fillColor: '#0000FF',
+ fillOpacity: 0.5,
+ strokeStyle: 'solid',
+ extData: { test: 1 },
+ strokeDasharray: [1, 5]
+});
+
+// $ExpectType Bounds | undefined
+testRectangle.getBounds();
+
+// $ExpectType void
+testRectangle.setBounds(bounds);
+
+// $ExpectType void
+testRectangle.setOptions({});
+// $ExpectType void
+testRectangle.setOptions({
+ map,
+ zIndex: 10,
+ bounds,
+ bubble: false,
+ cursor: 'pointer',
+ strokeColor: '#00FF00',
+ strokeOpacity: 0.8,
+ strokeWeight: 2,
+ fillColor: '#0000FF',
+ fillOpacity: 0.5,
+ strokeStyle: 'solid',
+ extData: { test: 1 },
+ strokeDasharray: [1, 5]
+});
+
+{
+ const options = testRectangle.getOptions();
+ // $ExpectType Bounds | undefined
+ options.bounds;
+ // $ExpectType boolean | undefined
+ options.bubble;
+ // $ExpectType boolean | undefined
+ options.clickable;
+ // $ExpectType {} | RectangleExtraData | undefined
+ options.extData;
+ // $ExpectType string | undefined
+ options.fillColor;
+ // $ExpectType number | undefined
+ options.fillOpacity;
+ // $ExpectType "miter" | "round" | "bevel" | undefined
+ options.lineJoin;
+ // $ExpectType Map | undefined
+ options.map;
+ // $ExpectType LngLat[] | undefined
+ options.path;
+ // $ExpectType string | undefined
+ options.strokeColor;
+ // $ExpectType number[] | undefined
+ options.strokeDasharray;
+ // $ExpectType number | undefined
+ options.strokeOpacity;
+ // $ExpectType "dashed" | "solid" | undefined
+ options.strokeStyle;
+ // $ExpectType number | undefined
+ options.strokeWeight;
+ // $ExpectType string | undefined
+ options.texture;
+ // $ExpectType number | undefined
+ options.zIndex;
+}
+
+// $ExpectType void
+testRectangle.hide();
+
+// $ExpectType void
+testRectangle.show();
+
+// $ExpectType void
+testRectangle.setExtData({test: 2});
+
+// $ExpectType {} | RectangleExtraData
+testRectangle.getExtData();
+
+// $ExpectType boolean
+testRectangle.contains(lnglat);
+// $ExpectType boolean
+testRectangle.contains(lnglatTuple);
+
+testRectangle.on('click', (event: AMap.Rectangle.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Rectangle
+ event.target;
+});
+
+testRectangle.on('setBounds', (event: AMap.Rectangle.EventMap['setBounds']) => {
+ // $ExpectType "setBounds"
+ event.type;
+ // $ExpectError
+ event.target;
+});
+
+/**
+ * overlay/text.ts
+ */
+
+interface TextExtraData {
+ test: number;
+}
+
+// $ExpectType Text
+new AMap.Text();
+// $ExpectType Text
+new AMap.Text({});
+// $ExpectType Text
+const testText = new AMap.Text({
+ text: 'content',
+ textAlign: 'center',
+ verticalAlign: 'top',
+ map,
+ position: lnglat,
+ anchor: 'bottom-center',
+ offset: pixel,
+ topWhenClick: true,
+ bubble: true,
+ draggable: true,
+ raiseOnDrag: true,
+ cursor: 'default',
+ visible: true,
+ zIndex: 100,
+ angle: 45,
+ autoRotation: true,
+ animation: 'AMAP_ANIMATION_BOUNCE',
+ shadow: 'https://webapi.amap.com/theme/v1.3/markers/0.png',
+ title: 'title',
+ clickable: true,
+ extData: { test: 1 }
+});
+
+const testTextAnchor = testText.getAnchor();
+if (testTextAnchor) {
+ // $ExpectType Anchor
+ testTextAnchor;
+} else {
+ // $ExpectType undefined
+ testTextAnchor;
+}
+
+// $ExpectType void
+testText.setAnchor(testTextAnchor);
+// $ExpectType void
+testText.setAnchor();
+
+// $ExpectType string
+testText.getText();
+
+// $ExpectType void
+testText.setText('123');
+
+// $ExpectType void
+testText.setStyle({
+ background: 'red',
+ width: '200px'
+});
+
+// $ExpectType void
+testText.markOnAMAP({
+ name: '123',
+ position: lnglatTuple
+});
+
+// $ExpectType Pixel
+testText.getOffset();
+
+// $ExpectType void
+testText.setOffset(pixel);
+
+// $ExpectType void
+testText.setAnimation('AMAP_ANIMATION_BOUNCE');
+
+// $ExpectType AnimationName
+testText.getAnimation();
+
+// $ExpectType void
+testText.setClickable(true);
+
+// $ExpectType boolean
+testText.getClickable();
+
+// $ExpectType LngLat | undefined
+testText.getPosition();
+
+// $ExpectType void
+testText.setAngle(10);
+
+// $ExpectType number
+testText.getAngle();
+
+// $ExpectType void
+testText.setzIndex(1);
+
+// $ExpectType number
+testText.getzIndex();
+
+// $ExpectType void
+testText.setDraggable(true);
+
+// $ExpectType boolean
+testText.getDraggable();
+
+// $ExpectType void
+testText.hide();
+
+// $ExpectType void
+testText.show();
+
+// $ExpectType void
+testText.setCursor('default');
+
+// $ExpectType void
+testText.moveAlong([lnglat], 100);
+
+// $ExpectType void
+testText.moveAlong([lnglat], 100);
+// $ExpectError
+testText.moveAlong([[1, 2]], 100);
+// $ExpectType void
+testText.moveAlong([lnglat], 100, t => t, false);
+
+// $ExpectType void
+testText.moveTo(lnglat, 100);
+// $ExpectType void
+testText.moveTo([1, 2], 100);
+// $ExpectType void
+testText.moveTo([1, 2], 100, t => t);
+
+// $ExpectType void
+testText.stopMove();
+
+// $ExpectType boolean
+testText.pauseMove();
+
+// $ExpectType boolean
+testText.resumeMove();
+
+// $ExpectType void
+testText.setMap(map);
+
+// $ExpectType void
+testText.setTitle('title');
+// $ExpectError
+testText.setTitle();
+
+// $ExpectType string | undefined
+testText.getTitle();
+
+// $ExpectType void
+testText.setTop(true);
+
+// $ExpectType boolean
+testText.getTop();
+
+// $ExpectType void
+testText.setShadow();
+// $ExpectType void
+testText.setShadow(icon);
+// $ExpectType void
+testText.setShadow('shadow url');
+
+// $ExpectType void
+testText.setExtData({ test: 1 });
+
+// $ExpectType {} | TextExtraData
+testText.getExtData();
+
+testText.on('click', (event: AMap.Text.EventMap['click']) => {
+ // $ExpectType "click"
+ event.type;
+ // $ExpectType Text
+ event.target;
+});
diff --git a/types/amap-js-api/array-bounds.d.ts b/types/amap-js-api/array-bounds.d.ts
new file mode 100644
index 0000000000..3e0145e049
--- /dev/null
+++ b/types/amap-js-api/array-bounds.d.ts
@@ -0,0 +1,15 @@
+declare namespace AMap {
+ class ArrayBounds {
+ constructor(bounds: LocationValue[]);
+ bounds: LngLat[];
+ /**
+ * 判断传入的点是否在ArrayBounds内
+ * @param point 目标点
+ */
+ contains(point: LocationValue): boolean;
+
+ // internal
+ toBounds(): Bounds;
+ getCenter(): LngLat;
+ }
+}
diff --git a/types/amap-js-api/bounds.d.ts b/types/amap-js-api/bounds.d.ts
new file mode 100644
index 0000000000..f594969292
--- /dev/null
+++ b/types/amap-js-api/bounds.d.ts
@@ -0,0 +1,39 @@
+declare namespace AMap {
+ class Bounds {
+ /**
+ * 地物对象的经纬度矩形范围。
+ * @param southWest 西南角经纬度
+ * @param northEast 东北角经纬度
+ */
+ constructor(southWest: LngLat, northEast: LngLat);
+ /**
+ * 指定点坐标是否在矩形范围内
+ * @param point 制定坐标
+ */
+ contains(point: LocationValue): boolean;
+ /**
+ * 获取当前Bounds的中心点经纬度坐标
+ */
+ getCenter(): LngLat;
+ /**
+ * 获取西南角坐标
+ */
+ getSouthWest(): LngLat;
+ /**
+ * 获取东南角坐标
+ */
+ getSouthEast(): LngLat;
+ /**
+ * 获取东北角坐标
+ */
+ getNorthEast(): LngLat;
+ /**
+ * 获取西北角坐标
+ */
+ getNorthWest(): LngLat;
+ /**
+ * 以字符串形式返回地物对象的矩形范围
+ */
+ toString(): string;
+ }
+}
diff --git a/types/amap-js-api/browser.d.ts b/types/amap-js-api/browser.d.ts
new file mode 100644
index 0000000000..26b3956aa1
--- /dev/null
+++ b/types/amap-js-api/browser.d.ts
@@ -0,0 +1,192 @@
+declare namespace AMap {
+ namespace Browser {
+ /**
+ * 当前浏览器userAgent
+ */
+ const ua: string;
+ /**
+ * 是否移动设备
+ */
+ const mobile: boolean;
+ /**
+ * 平台类型,如:'windows'、'mac'、'ios'、'android'、'other'
+ */
+ const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other';
+ /**
+ * 是否mac设备
+ */
+ const mac: boolean;
+ /**
+ * 是否windows设备
+ */
+ const windows: boolean;
+ /**
+ * 是否iOS设备
+ */
+ const ios: boolean;
+ /**
+ * 是否iPad
+ */
+ const iPad: boolean;
+ /**
+ * 是否iPhone
+ */
+ const iPhone: boolean;
+ /**
+ * 是否安卓设备
+ */
+ const android: boolean;
+ /**
+ * 是否安卓4以下系统
+ */
+ const android23: boolean;
+ /**
+ * 是否Chrome浏览器
+ */
+ const chrome: boolean;
+ /**
+ * 是否火狐浏览器
+ */
+ const firefox: boolean;
+ /**
+ * 是否Safari浏览器
+ */
+ const safari: boolean;
+ /**
+ * 是否微信
+ */
+ const wechat: boolean;
+ /**
+ * 是否UC浏览器
+ */
+ const uc: boolean;
+ /**
+ * 是否QQ或者QQ浏览器
+ */
+ const qq: boolean;
+ /**
+ * 是否IE
+ */
+ const ie: boolean;
+ /**
+ * 是否IE6
+ */
+ const ie6: boolean;
+ /**
+ * 是否IE7
+ */
+ const ie7: boolean;
+ /**
+ * 是否IE8
+ */
+ const ie8: boolean;
+ /**
+ * 是否IE9
+ */
+ const ie9: boolean;
+ /**
+ * 是否IE10
+ */
+ const ie10: boolean;
+ /**
+ * 是否IE11
+ */
+ const ie11: boolean;
+ /**
+ * 是否Edge浏览器
+ */
+ const edge: boolean;
+ /**
+ * 是否IE9以下
+ */
+ const ielt9: boolean;
+ /**
+ * 是否百度浏览器
+ */
+ const baidu: boolean;
+ /**
+ * 是否支持LocaStorage
+ */
+ const isLocalStorage: boolean;
+ /**
+ * 是否支持Geolocation
+ */
+ const isGeolocation: boolean;
+ /**
+ * 是否Webkit移动浏览器
+ */
+ const mobileWebkit: boolean;
+ /**
+ * 是否支持Css3D的Webkit移动端浏览器
+ */
+ const mobileWebkit3d: boolean;
+ /**
+ * 是否Opera移动浏览器
+ */
+ const mobileOpera: boolean;
+ /**
+ * 是否高清屏幕,devicePixelRatio>1
+ */
+ const retina: boolean;
+ /**
+ * 是否触屏
+ */
+ const touch: boolean;
+ /**
+ * 是否msPointer设备
+ */
+ const msPointer: boolean;
+ /**
+ * 是否pointer设备
+ */
+ const pointer: boolean;
+ /**
+ * 是否webkit浏览器
+ */
+ const webkit: boolean;
+ /**
+ * 是否支持Css3D的ie浏览器
+ */
+ const ie3d: boolean;
+ /**
+ * 是否支持Css3D的Webkit浏览器
+ */
+ const webkit3d: boolean;
+ /**
+ * 是否支持Css3D的gecko浏览器
+ */
+ const gecko3d: boolean;
+ /**
+ * 是否支持Css3D的opera浏览器
+ */
+ const opera3d: boolean;
+ /**
+ * 是否支持Css3D的浏览器
+ */
+ const any3d: boolean;
+ /**
+ * 是否支持canvas
+ */
+ const isCanvas: boolean;
+ /**
+ * 是否支持svg
+ */
+ const isSvg: boolean;
+ /**
+ * 是否支持vml
+ */
+ const isVML: boolean;
+ /**
+ * 是否支持WebWorker
+ */
+ const isWorker: boolean;
+ /**
+ * 是否支持WebSocket
+ */
+ const isWebsocket: boolean;
+ /**
+ * 判断是否支持webgl
+ */
+ function isWebGL(): boolean;
+ }
+}
diff --git a/types/amap-js-api/common.d.ts b/types/amap-js-api/common.d.ts
new file mode 100644
index 0000000000..8b442ad0a3
--- /dev/null
+++ b/types/amap-js-api/common.d.ts
@@ -0,0 +1,31 @@
+declare namespace AMap {
+ type SizeValue = Size | [number, number];
+ type LocationValue = LngLat | [number, number];
+ type Lang = 'zh_cn' | 'en' | 'zh_en';
+
+ type Event = { type: N } &
+ (V extends HTMLElement ? { value: V }
+ : V extends object ? V
+ : V extends undefined ? {}
+ : { value: V });
+ type MapsEvent = Event;
+
+ type StrokeLineJoin = 'miter' | 'round' | 'bevel';
+ type StrokeLineCap = 'butt' | 'round' | 'square';
+ type StrokeStyle = 'dashed' | 'solid';
+
+ type AnimationName = 'AMAP_ANIMATION_NONE' | 'AMAP_ANIMATION_DROP' | 'AMAP_ANIMATION_BOUNCE';
+}
diff --git a/types/amap-js-api/convert-from.d.ts b/types/amap-js-api/convert-from.d.ts
new file mode 100644
index 0000000000..61f83f9b94
--- /dev/null
+++ b/types/amap-js-api/convert-from.d.ts
@@ -0,0 +1,27 @@
+declare namespace AMap {
+ namespace convertFrom {
+ interface Result {
+ /**
+ * 成功状态文字描述
+ */
+ info: string; // 'ok'
+ /**
+ * 高德坐标集合
+ */
+ locations: LngLat[];
+ }
+ type Type = 'gps' | 'baidu' | 'mapbar';
+ type SearchStatus = 'complete' | 'error';
+ }
+ /**
+ * 为坐标转换类,支持将其他坐标系的坐标点转换为高德坐标系。
+ * @param lnglat 待转换坐标
+ * @param type 用于说明是哪个服务商的坐标
+ * @param callback 转换完成后的回调函数
+ */
+ function convertFrom(
+ lnglat: LocationValue | LocationValue[],
+ type: convertFrom.Type | null,
+ callback: (status: convertFrom.SearchStatus, result: string | convertFrom.Result) => void
+ ): void;
+}
diff --git a/types/amap-js-api/dom-util.d.ts b/types/amap-js-api/dom-util.d.ts
new file mode 100644
index 0000000000..e39793f006
--- /dev/null
+++ b/types/amap-js-api/dom-util.d.ts
@@ -0,0 +1,78 @@
+declare namespace AMap {
+ namespace DomUtil {
+ /**
+ * 获取DOM元素的大小
+ * @param dom DOM元素
+ */
+ function getViewport(dom: HTMLElement): Size;
+ /**
+ * 获取DOM元素距离窗口左上角的距离
+ * @param dom DOM元素
+ */
+ function getViewportOffset(dom: HTMLElement): Pixel;
+ /**
+ * 在parentNode内部创建一个className类名的tagName元素
+ * @param tagName 标签名称
+ * @param parent 父节点
+ * @param className 类名
+ */
+ function create(
+ tagName: K,
+ parent?: HTMLElement,
+ className?: string
+ ): HTMLElementTagNameMap[K];
+ /**
+ * 给DOM元素设置为className样式
+ * @param dom DOM元素
+ * @param className 类名
+ */
+ function setClass(dom: HTMLElement, className?: string): void;
+ /**
+ * DOM元素是否包含className
+ * @param dom DOM元素
+ * @param className 类名
+ */
+ function hasClass(dom: HTMLElement, className: string): boolean;
+ /**
+ * 给DOM元素添加一个className
+ * @param dom DOM元素
+ * @param className 类名
+ */
+ function addClass(dom: HTMLElement, className: string): void;
+ /**
+ * 给DOM元素删除一个className
+ * @param dom DOM元素
+ * @param className 类名
+ */
+ function removeClass(dom: HTMLElement, className: string): void;
+ /**
+ * 给DOM元素设定一个透明度
+ * @param dom DOM元素
+ * @param opacity 透明度(0-1)
+ */
+ function setOpacity(dom: HTMLElement, opacity: number): void;
+ /**
+ * 给DOM元素旋转一个角度,以center为中心,center以元素左上角为坐标原点
+ * @param dom DOM元素
+ * @param deg 旋转角度
+ * @param origin 旋转中心
+ */
+ function rotate(dom: HTMLElement, deg: number, origin?: { x: number, y: number }): void;
+ /**
+ * 给DOM元素删除一组样式,Object同样式表
+ * @param dom DOM元素
+ * @param style 样式
+ */
+ function setCss(dom: HTMLElement | HTMLElement[], style: Partial): typeof DomUtil; // this
+ /**
+ * 清空DOM元素
+ * @param dom DOM元素
+ */
+ function empty(dom: HTMLElement): void;
+ /**
+ * 将DOM元素从父节点删除
+ * @param dom DOM元素
+ */
+ function remove(dom: HTMLElement): void;
+ }
+}
diff --git a/types/amap-js-api/event.d.ts b/types/amap-js-api/event.d.ts
new file mode 100644
index 0000000000..d90ee4c720
--- /dev/null
+++ b/types/amap-js-api/event.d.ts
@@ -0,0 +1,102 @@
+declare namespace AMap {
+ abstract class EventEmitter {
+ /**
+ * 注册事件
+ * @param eventName 事件名称
+ * @param handler 事件回调函数
+ * @param context 事件回调中的上下文
+ * @param once 触发一次
+ * @param unshift 更改事件顺序
+ */
+ on(
+ eventName: string,
+ // tslint:disable-next-line:no-unnecessary-generics
+ handler: (this: C, event: E) => void,
+ context?: C,
+ once?: boolean,
+ unshift?: boolean
+ ): this;
+ /**
+ * 移除事件绑定
+ * @param eventName 事件名称
+ * @param handler 事件功能函数
+ * @param context 事件上下文
+ */
+ off(
+ eventName: string,
+ // tslint:disable-next-line
+ handler: ((this: C, event: E) => void) | 'mv',
+ context?: C
+ ): this;
+ /**
+ * 触发事件
+ * @param eventName 事件名称
+ * @param data 事件数据
+ */
+ emit(eventName: string, data?: any): this;
+ }
+
+ namespace event {
+ interface EventListener {
+ type: T;
+ }
+ /**
+ * 注册DOM对象事件
+ * @param instance 需注册事件的DOM对象
+ * @param eventName 事件名称
+ * @param handler 事件功能函数
+ * @param context 事件上下文
+ */
+ function addDomListener(
+ // tslint:disable-next-line: no-unnecessary-generics
+ instance: HTMLElementTagNameMap[N],
+ eventName: E,
+ handler: (this: C, event: HTMLElementEventMap[E]) => void,
+ context?: C
+ ): EventListener<0>;
+ /**
+ * 给对象注册事件
+ * @param instance 需注册事件的对象
+ * @param eventName 事件名称
+ * @param handler 事件功能函数
+ * @param context 事件上下文
+ */
+ function addListener(
+ // tslint:disable-next-line: no-unnecessary-generics
+ instance: I,
+ eventName: string,
+ // tslint:disable-next-line: no-unnecessary-generics
+ handler: (this: C, event: E) => void,
+ // tslint:disable-next-line: no-unnecessary-generics
+ context?: C
+ ): EventListener<1>;
+ /**
+ * 给对象注册一次性事件
+ * @param instance 需注册事件的对象
+ * @param eventName 事件名称
+ * @param handler 事件功能函数
+ * @param context 事件上下文
+ */
+ function addListenerOnce(
+ // tslint:disable-next-line: no-unnecessary-generics
+ instance: I,
+ eventName: string,
+ // tslint:disable-next-line: no-unnecessary-generics
+ handler: (this: C, event: E) => void,
+ // tslint:disable-next-line: no-unnecessary-generics
+ context?: C
+ ): EventListener<1>;
+ /**
+ * 删除事件
+ * @param listener 侦听器
+ */
+ function removeListener(listener: EventListener<0 | 1>): void;
+ /**
+ * 触发非DOM事件
+ * @param instance 触发对象
+ * @param eventName 事件名称
+ * @param data 事件数据
+ */
+ function trigger(instance: EventEmitter, eventName: string, data?: any): void;
+ }
+}
diff --git a/types/amap-js-api/geometry-util.d.ts b/types/amap-js-api/geometry-util.d.ts
new file mode 100644
index 0000000000..c8a5eae2e9
--- /dev/null
+++ b/types/amap-js-api/geometry-util.d.ts
@@ -0,0 +1,192 @@
+declare namespace AMap {
+ namespace GeometryUtil {
+ /**
+ * 计算两个经纬度点之间的实际距离
+ */
+ function distance(
+ point1: LocationValue,
+ point2: LocationValue | LocationValue[]
+ ): number;
+ /**
+ * 计算一个经纬度路径围成区域的实际面积
+ */
+ function ringArea(ring: LocationValue[]): number;
+ /**
+ * 判断一个经纬度路径是否为顺时针
+ */
+ function isClockwise(path: LocationValue[]): boolean;
+ /**
+ * 计算一个经纬度路径的实际长度
+ */
+ function distanceOfLine(line: LocationValue[]): number;
+ /**
+ * 计算两个经纬度面的交叉区域
+ */
+ function ringRingClip(
+ ring1: LocationValue[],
+ ring2: LocationValue[]
+ ): Array<[number, number]>;
+ /**
+ * 判断两个经纬度面是否交叉
+ */
+ function doesRingRingIntersect(
+ ring1: LocationValue[],
+ ring2: LocationValue[]
+ ): boolean;
+ /**
+ * 判断经纬度路径和经纬度面是否交叉
+ */
+ function doesLineRingIntersect(
+ line: LocationValue[],
+ ring: LocationValue[]
+ ): boolean;
+ /**
+ * 判断两个经纬度路径是否相交
+ */
+ function doesLineLineIntersect(
+ line1: LocationValue[],
+ line2: LocationValue[]
+ ): boolean;
+ /**
+ * 判断线段和多个环是否相交
+ */
+ function doesSegmentPolygonIntersect(
+ point1: LocationValue,
+ point2: LocationValue,
+ polygon: LocationValue[][]
+ ): boolean;
+ /**
+ * 判断线段和一个环是否相交
+ */
+ function doesSegmentRingIntersect(
+ point1: LocationValue,
+ point2: LocationValue,
+ ring: LocationValue[]
+ ): boolean;
+ /**
+ * 判断线段和一个路径是否相交
+ */
+ function doesSegmentLineIntersect(
+ point1: LocationValue,
+ point2: LocationValue,
+ line: LocationValue[]
+ ): boolean;
+ /**
+ * 判断两个线段是否相交
+ */
+ function doesSegmentsIntersect(
+ point1: LocationValue,
+ point2: LocationValue,
+ point3: LocationValue,
+ point4: LocationValue
+ ): boolean;
+ /**
+ * 判断点是否在环内
+ */
+ function isPointInRing(point: LocationValue, ring: LocationValue[]): boolean;
+ /**
+ * 判断环是否在另一个环内
+ */
+ function isRingInRing(ring1: LocationValue[], ring2: LocationValue[]): boolean;
+ /**
+ * 判断点是否在多个环组成区域内
+ */
+ function isPointInPolygon(point: LocationValue, polygon: LocationValue[][]): boolean;
+ /**
+ * 判断点是否在多个环组成区域内
+ */
+ function makesureClockwise(path: Array<[number, number]>): Array<[number, number]>;
+ /**
+ * 将一个路径变为逆时针
+ */
+ function makesureAntiClockwise(path: Array<[number, number]>): Array<[number, number]>;
+ /**
+ * 计算P2P3上距离P1最近的点
+ * @param point1 P1
+ * @param point2 P2
+ * @param point3 P3
+ */
+ function closestOnSegment(
+ point1: LocationValue,
+ point2: LocationValue,
+ point3: LocationValue
+ ): [number, number];
+ /**
+ * 计算line上距离P最近的点
+ */
+ function closestOnLine(point: LocationValue, line: LocationValue[]): [number, number];
+ /**
+ * 计算P2P3到P1的距离
+ * @param point1 P1
+ * @param point2 P2
+ * @param point3 P3
+ */
+ function distanceToSegment(
+ point1: LocationValue,
+ point2: LocationValue,
+ point3: LocationValue
+ ): number;
+ /**
+ * 计算P到line的距离
+ */
+ function distanceToLine(point: LocationValue, line: LocationValue[]): number;
+ /**
+ * 判断P1是否在P2P3上
+ * @param point1 P1
+ * @param point2 P2
+ * @param point3 P3
+ * @param tolerance 误差范围
+ */
+ function isPointOnSegment(
+ point1: LocationValue,
+ point2: LocationValue,
+ point3: LocationValue,
+ tolerance?: number
+ ): boolean;
+ /**
+ * 判断P是否在line上
+ * @param point 点P
+ * @param line 线
+ * @param tolerance 误差范围
+ */
+ function isPointOnLine(
+ point: LocationValue,
+ line: LocationValue[],
+ tolerance?: number
+ ): boolean;
+ /**
+ * 判断P是否在ring的边上
+ * @param point 点P
+ * @param ring 环
+ * @param tolerance 误差范围
+ */
+ function isPointOnRing(
+ point: LocationValue,
+ ring: LocationValue[],
+ tolerance?: number
+ ): boolean;
+ /**
+ * 判断P是否在多个ring的边上
+ * @param point 点P
+ * @param polygon 多边形
+ * @param tolerance 误差范围
+ */
+ function isPointOnPolygon(
+ point: LocationValue,
+ polygon: LocationValue[][],
+ tolerance?: number
+ ): boolean;
+
+ function doesPolygonPolygonIntersect(
+ polygon1: LocationValue[],
+ polygon2: LocationValue[]
+ ): boolean;
+
+ function distanceToPolygon(point: LocationValue, polygon: LocationValue[]): number;
+
+ function triangulateShape(
+ shape1: LngLat[] | Pixel[] | [number, number],
+ shape2: LngLat[] | Pixel[] | [number, number]
+ ): number[];
+ }
+}
diff --git a/types/amap-js-api/index.d.ts b/types/amap-js-api/index.d.ts
new file mode 100644
index 0000000000..5b8c1a5b94
--- /dev/null
+++ b/types/amap-js-api/index.d.ts
@@ -0,0 +1,48 @@
+// Type definitions for non-npm package amap-js-api 1.4
+// Project: https://lbs.amap.com/api/javascript-api/summary
+// Definitions by: breeze9527
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
diff --git a/types/amap-js-api/layer/building.d.ts b/types/amap-js-api/layer/building.d.ts
new file mode 100644
index 0000000000..1b7426e28d
--- /dev/null
+++ b/types/amap-js-api/layer/building.d.ts
@@ -0,0 +1,54 @@
+declare namespace AMap {
+ namespace Buildings {
+ interface Options extends Layer.Options {
+ /**
+ * 可见级别范围
+ */
+ zooms?: [number, number];
+ /**
+ * 不透明度
+ */
+ opacity?: number;
+ /**
+ * 高度比例系数,可控制3D视图下的楼块高度
+ */
+ heightFactor?: number;
+ /**
+ * 是否可见
+ */
+ visible?: boolean;
+ /**
+ * 层级
+ */
+ zIndex?: number;
+
+ // inner
+ merge?: boolean;
+ sort?: boolean;
+ }
+ interface AreaStyle {
+ color1: string;
+ path: LocationValue[];
+ color2?: string;
+ visible?: boolean;
+ rejectTexture?: boolean;
+ }
+ interface Style {
+ hideWithoutStyle?: boolean;
+ areas: AreaStyle[];
+ }
+ }
+
+ class Buildings extends Layer {
+ /**
+ * 楼块图层,单独展示矢量化的楼块图层
+ * @param opts 图层选项
+ */
+ constructor(opts?: Buildings.Options);
+ /**
+ * 按区域设置楼块的颜色
+ * @param style 颜色设置
+ */
+ setStyle(style: Buildings.Style): void;
+ }
+}
diff --git a/types/amap-js-api/layer/flexible.d.ts b/types/amap-js-api/layer/flexible.d.ts
new file mode 100644
index 0000000000..d91970dc31
--- /dev/null
+++ b/types/amap-js-api/layer/flexible.d.ts
@@ -0,0 +1,38 @@
+declare namespace AMap {
+ namespace TileLayer {
+ namespace Flexible {
+ interface Options extends TileLayer.Options {
+ /**
+ * 创建切片回调
+ * @param x 横坐标
+ * @param y 纵坐标
+ * @param z 层级
+ * @param success 成功回调
+ * @param fail 失败回调
+ */
+ createTile?(
+ x: number,
+ y: number,
+ z: number,
+ success: (tile: HTMLImageElement | HTMLCanvasElement) => void,
+ fail: () => void
+ ): void;
+ /**
+ * 内存中缓存的切片的数量上限
+ */
+ cacheSize?: number;
+ /**
+ * 是否显示
+ */
+ visible?: boolean;
+ }
+ }
+ class Flexible extends TileLayer {
+ /**
+ * 灵活切片图层
+ * @param options 图层选项
+ */
+ constructor(options?: Flexible.Options);
+ }
+ }
+}
diff --git a/types/amap-js-api/layer/layer.d.ts b/types/amap-js-api/layer/layer.d.ts
new file mode 100644
index 0000000000..64714bc68f
--- /dev/null
+++ b/types/amap-js-api/layer/layer.d.ts
@@ -0,0 +1,56 @@
+declare namespace AMap {
+ namespace Layer {
+ interface Options {
+ /**
+ * 所属的地图对象
+ */
+ map?: Map;
+ }
+ }
+
+ abstract class Layer extends EventEmitter {
+ /**
+ * 图层获取DOM节点
+ */
+ getContainer(): HTMLDivElement | undefined;
+ /**
+ * 获取图层缩放范围
+ */
+ getZooms(): [number, number];
+ /**
+ * 设置透明度
+ * @param alpha 透明度
+ */
+ setOpacity(alpha: number): void;
+ /**
+ * 设置透明度
+ */
+ getOpacity(): number;
+ /**
+ * 显示图层
+ */
+ show(): void;
+ /**
+ * 隐藏图层
+ */
+ hide(): void;
+ /**
+ * 设置图层所属地图
+ * @param map map对象
+ */
+ setMap(map?: Map | null): void;
+ /**
+ * 获取图层所属地图
+ */
+ getMap(): Map | null | undefined;
+ /**
+ * 设置图层的层级
+ * @param index 层级
+ */
+ setzIndex(index: number): void;
+ /**
+ * 获取图层的层级
+ */
+ getzIndex(): number;
+ }
+}
diff --git a/types/amap-js-api/layer/layerGroup.d.ts b/types/amap-js-api/layer/layerGroup.d.ts
new file mode 100644
index 0000000000..6a07c8fc72
--- /dev/null
+++ b/types/amap-js-api/layer/layerGroup.d.ts
@@ -0,0 +1,56 @@
+declare namespace AMap {
+ class LayerGroup extends Layer {
+ /**
+ * 图层集合
+ * @param layers 集合中的图层
+ */
+ constructor(layers: L | L[]);
+ /**
+ * 添加单个图层到集合中,不支持添加重复的图层
+ * @param layer 图层
+ */
+ addLayer(layer: L | L[]): this;
+ /**
+ * 添加图层数组到集合中,不支持添加重复的图层
+ * @param layers 图层数组
+ */
+ addLayers(layers: L | L[]): this;
+ /**
+ * 返回当前集合中所有的图层
+ */
+ getLayers(): L[];
+ getLayer(finder: (this: null, item: L, index: number, list: L[]) => boolean): L | null;
+ /**
+ * 判断传入的图层实例是否在集合中
+ * @param layer 目标图层
+ */
+ hasLayer(layer: L | ((this: null, item: L, index: number, list: L[]) => boolean)): boolean;
+ /**
+ * 从集合中删除传入的图层实例
+ * @param layer 图层
+ */
+ removeLayer(layer: L | L[]): this;
+ /**
+ * 从集合中删除传入的图层实例数组
+ * @param layers 图层数组
+ */
+ removeLayers(layers: L | L[]): this;
+ /**
+ * 清空集合
+ */
+ clearLayers(): this;
+ /**
+ * 对集合中的图层做迭代操作
+ * @param iterator 迭代回调
+ * @param context 执行上下文
+ */
+ eachLayer(iterator: (this: C, layer: L, index: number, list: L[]) => void, context?: C): void;
+
+ // overwrite
+ setMap(map?: Map): this;
+ hide(): this;
+ show(): this;
+ reload(): this;
+ setOptions(options: any): this;
+ }
+}
diff --git a/types/amap-js-api/layer/massMarks.d.ts b/types/amap-js-api/layer/massMarks.d.ts
new file mode 100644
index 0000000000..963f7e2ec6
--- /dev/null
+++ b/types/amap-js-api/layer/massMarks.d.ts
@@ -0,0 +1,99 @@
+declare namespace AMap {
+ namespace MassMarks {
+ interface EventMap {
+ click: UIEvent<'click', I>;
+ dblclick: UIEvent<'dblclick', I>;
+ mousedown: UIEvent<'mousedown', I>;
+ mouseup: UIEvent<'mouseup', I>;
+ mouseover: UIEvent<'mouseover', I>;
+ mouseout: UIEvent<'mouseout', I>;
+ touchstart: UIEvent<'touchstart', I>;
+ touchend: UIEvent<'touchend', I>;
+ }
+
+ interface Style {
+ /**
+ * 图标显示位置偏移量,以图标的左上角为基准点(0,0)点
+ */
+ anchor: Pixel;
+ /**
+ * 图标的地址
+ */
+ url: string;
+ /**
+ * 图标的尺寸
+ */
+ size: Size;
+ /**
+ * 旋转角度
+ */
+ rotation?: number;
+ }
+
+ type UIEvent = Event ? D : Data;
+ }>;
+
+ interface Options extends Layer.Options {
+ /**
+ * 显示层级
+ */
+ zIndex?: number;
+ /**
+ * 指针样式
+ */
+ cursor?: string;
+ /**
+ * 是否在拖拽缩放过程中实时重绘
+ */
+ alwayRender?: boolean;
+ /**
+ * 设置点的样式
+ */
+ style: Style | Style[];
+ // rejectMapMask
+ }
+ interface Data {
+ lnglat: LocationValue;
+ style?: number;
+ }
+ }
+
+ class MassMarks extends Layer {
+ /**
+ * 海量点类,利用该类可同时在地图上展示万级别的点
+ * @param data 点对象数组或url
+ * @param opts 选项
+ */
+ constructor(data: D[] | string, opts: MassMarks.Options);
+ /**
+ * 设置显示样式
+ * @param style 样式设置
+ */
+ setStyle(style: MassMarks.Style | MassMarks.Style[]): void;
+ /**
+ * 获取显示样式
+ */
+ getStyle(): MassMarks.Style | MassMarks.Style[];
+ /**
+ * 设置数据集
+ * @param data 数据集
+ */
+ setData(data: D[] | string): void;
+ /**
+ * 获取数据集
+ */
+ getData(): Array> & { lnglat: LngLat }>;
+ /**
+ * 清除海量点
+ */
+ clear(): void;
+ }
+}
diff --git a/types/amap-js-api/layer/mediaLayer.d.ts b/types/amap-js-api/layer/mediaLayer.d.ts
new file mode 100644
index 0000000000..43fee214bb
--- /dev/null
+++ b/types/amap-js-api/layer/mediaLayer.d.ts
@@ -0,0 +1,94 @@
+declare namespace AMap {
+ namespace MediaLayer {
+ interface Options extends Layer.Options {
+ /**
+ * 显示范围
+ */
+ bounds?: Bounds;
+ /**
+ * 是否可见
+ */
+ visible?: boolean;
+ /**
+ * 缩放范围
+ */
+ zooms?: [number, number];
+ /**
+ * 透明度
+ */
+ opacity?: number;
+ }
+ }
+
+ abstract class MediaLayer extends Layer {
+ /**
+ * @param options 图层选项
+ */
+ constructor(options?: MediaLayer.Options);
+ /**
+ * 设置显示范围
+ * @param bounds 显示范围
+ */
+ setBounds(bounds: Bounds): void;
+ /**
+ * 获取显示的范围
+ */
+ getBounds(): Bounds;
+ /**
+ * 设置图层选项
+ * @param options 图层选项
+ */
+ setOptions(options: Partial): void;
+ /**
+ * 获取图层选项
+ */
+ getOptions(): Partial;
+ /**
+ * 获取元素
+ */
+ getElement(): E | null;
+ }
+
+ /**
+ * 图片图层
+ */
+ class ImageLayer extends MediaLayer {
+ /**
+ * 修改Image的Url
+ * @param url url
+ */
+ setImageUrl(url: string): void;
+ /**
+ * 返回Image的Url
+ */
+ getImageUrl(): string | undefined;
+ }
+
+ class VideoLayer extends MediaLayer {
+ /**
+ * 修改Video的Url
+ * @param source url
+ */
+ setVideoUrl(source: string | string[]): void;
+ /**
+ * 返回Video的Url
+ */
+ getVideoUrl(): string | string[] | undefined;
+ }
+
+ class CanvasLayer extends MediaLayer {
+ /**
+ * 修改显示的Canvas
+ * @param canvas Canvas对象
+ */
+ setCanvas(canvas: HTMLCanvasElement): void;
+ /**
+ * 返回Canvas对象
+ */
+ getCanvas(): HTMLCanvasElement | undefined;
+ /**
+ * 当canvas的内容发生改变是用于刷新图层
+ */
+ reFresh(): void;
+ }
+}
diff --git a/types/amap-js-api/layer/tileLayer.d.ts b/types/amap-js-api/layer/tileLayer.d.ts
new file mode 100644
index 0000000000..1a146b964c
--- /dev/null
+++ b/types/amap-js-api/layer/tileLayer.d.ts
@@ -0,0 +1,91 @@
+declare namespace AMap {
+ namespace TileLayer {
+ interface EventMap {
+ complete: Event<'complete'>;
+ }
+
+ interface Options extends Layer.Options {
+ /**
+ * 切片大小
+ */
+ tileSize?: number;
+ /**
+ * 切片取图地址(自1.3版本起,该属性与getTileUrl属性合并)
+ */
+ tileUrl?: string;
+ /**
+ * 取图错误时的代替地址
+ */
+ errorUrl?: string;
+ /**
+ * 获取图块取图地址
+ */
+ getTileUrl?: string | ((x: number, y: number, level: number) => string);
+ /**
+ * 图层叠加的顺序值
+ */
+ zIndex?: number;
+ /**
+ * 图层的透明度
+ */
+ opacity?: number;
+ /**
+ * 支持的缩放级别范围
+ */
+ zooms?: [number, number];
+ /**
+ * 是否在高清屏下进行清晰度适配
+ */
+ detectRetina?: boolean;
+ }
+ /**
+ * 卫星图层
+ */
+ class Satellite extends TileLayer { }
+ /**
+ * 路网图层
+ */
+ class RoadNet extends TileLayer { }
+
+ namespace Traffic {
+ interface Options extends TileLayer.Options {
+ /**
+ * 是否设置可以自动刷新实时路况信息
+ */
+ autoRefresh?: boolean;
+ /**
+ * 设置刷新间隔时长
+ */
+ interval?: number;
+ }
+ }
+ class Traffic extends TileLayer {
+ /**
+ * 实时交通图层
+ * @param options 图层选项
+ */
+ constructor(options?: Traffic.Options);
+ }
+ }
+
+ class TileLayer extends Layer {
+ /**
+ * 切片图层
+ * @param options 图层选项
+ */
+ constructor(options?: TileLayer.Options);
+ /**
+ * 获取当前图层所有切片号
+ */
+ getTiles(): string[];
+ /**
+ * 重新加载此图层
+ */
+ reload(): void;
+ /**
+ * 设置图层的取图地址
+ * @param url 取图地址
+ */
+ setTileUrl(url: string | ((x: number, y: number, level: number) => string)): void;
+ }
+}
diff --git a/types/amap-js-api/layer/wms.d.ts b/types/amap-js-api/layer/wms.d.ts
new file mode 100644
index 0000000000..043975d856
--- /dev/null
+++ b/types/amap-js-api/layer/wms.d.ts
@@ -0,0 +1,56 @@
+declare namespace AMap {
+ namespace TileLayer {
+ namespace WMS {
+ interface Params {
+ VERSION?: string;
+ LAYERS?: string;
+ STYLES?: string;
+ FORMAT?: string;
+ TRANSPARENT?: 'TRUE' | 'FALSE';
+ BGCOLOR?: string;
+ EXCEPTIONS?: string;
+ TIME?: string;
+ ELEVATION?: string;
+ }
+ interface Options extends Flexible.Options {
+ /**
+ * wms服务的url地址
+ */
+ url: string;
+ /**
+ * OGC标准的WMS地图服务的GetMap接口的参数
+ */
+ params: Params;
+ /**
+ * 地图级别切换时,不同级别的图片是否进行混合
+ */
+ blend?: boolean;
+ }
+ }
+ class WMS extends Flexible {
+ /**
+ * WMS图层
+ * @param options 图层选项
+ */
+ constructor(options: WMS.Options);
+ /**
+ * 设置wms服务地址
+ * @param url 服务地址
+ */
+ setUrl(url: string): void;
+ /**
+ * 返回wms服务地址
+ */
+ getUrl(): string;
+ /**
+ * 设置OGC标准的WMS getMap接口的参数
+ * @param params 接口参数
+ */
+ setParams(params: WMS.Params): void;
+ /**
+ * 返回OGC标准的WMS getMap接口的参数
+ */
+ getParams(): WMS.Params;
+ }
+ }
+}
diff --git a/types/amap-js-api/layer/wmts.d.ts b/types/amap-js-api/layer/wmts.d.ts
new file mode 100644
index 0000000000..7a122dd6b9
--- /dev/null
+++ b/types/amap-js-api/layer/wmts.d.ts
@@ -0,0 +1,52 @@
+declare namespace AMap {
+ namespace TileLayer {
+ namespace WMTS {
+ interface Params {
+ Version?: string;
+ Layer?: string;
+ Style?: string;
+ Format?: string;
+ }
+ interface Options extends Flexible.Options {
+ /**
+ * wmts服务的url地址
+ */
+ url: string;
+ /**
+ * OGC标准的WMTS地图服务的GetTile接口的参数
+ */
+ params: Params;
+ /**
+ * 地图级别切换时,不同级别的图片是否进行混合
+ */
+ blend?: boolean;
+ }
+ }
+
+ class WMTS extends Flexible {
+ /**
+ * WMTS图层
+ * @param options 图层选项
+ */
+ constructor(options: WMTS.Options);
+ /**
+ * 设置wmts服务地址
+ * @param url 服务地址
+ */
+ setUrl(url: string): void;
+ /**
+ * 返回wmts服务地址
+ */
+ getUrl(): string;
+ /**
+ * 设置OGC标准的WMTS getTile接口的参数
+ * @param params 接口参数
+ */
+ setParams(params: WMTS.Params): void;
+ /**
+ * 返回OGC标准的WMTS getTile接口的参数
+ */
+ getParams(): WMTS.Params;
+ }
+ }
+}
diff --git a/types/amap-js-api/lngLat.d.ts b/types/amap-js-api/lngLat.d.ts
new file mode 100644
index 0000000000..f649a78de8
--- /dev/null
+++ b/types/amap-js-api/lngLat.d.ts
@@ -0,0 +1,45 @@
+declare namespace AMap {
+ class LngLat {
+ /**
+ * 构造一个地理坐标对象
+ * @param lng 经度
+ * @param lat 纬度
+ * @param noAutofix 是否自动修正
+ */
+ constructor(lng: number, lat: number, noAutofix?: boolean);
+ /**
+ * 移动当前经纬度坐标得到新的坐标
+ * @param east 移动经度,向右为正值
+ * @param north 移动维度,向上为正值
+ */
+ offset(east: number, north: number): LngLat;
+ /**
+ * 当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米
+ * @param lnglat 对比目标
+ */
+ distance(lnglat: LngLat | LngLat[]): number;
+ /**
+ * 获取经度值
+ */
+ getLng(): number;
+ /**
+ * 获取纬度值
+ */
+ getLat(): number;
+ /**
+ * 判断当前坐标对象与传入坐标对象是否相等
+ * @param lnglat 判断目标
+ */
+ equals(lnglat: LngLat): boolean;
+ /**
+ * 以字符串的形式返回
+ */
+ toString(): string;
+
+ // internal
+ add(lnglat: LngLat, noAutofix?: boolean): LngLat;
+ subtract(lnglat: LngLat, noAutofix?: boolean): LngLat;
+ divideBy(num: number, noAutofix?: boolean): LngLat;
+ multiplyBy(num: number, noAutofix?: boolean): LngLat;
+ }
+}
diff --git a/types/amap-js-api/map.d.ts b/types/amap-js-api/map.d.ts
new file mode 100644
index 0000000000..e7937966b1
--- /dev/null
+++ b/types/amap-js-api/map.d.ts
@@ -0,0 +1,568 @@
+declare namespace AMap {
+ namespace Map {
+ type Feature = 'bg' | 'point' | 'road' | 'building';
+ type ViewMode = '2D' | '3D';
+ interface Options {
+ /**
+ * 地图视口,用于控制影响地图静态显示的属性
+ */
+ view?: View2D;
+ /**
+ * 地图图层数组,数组可以是图层 中的一个或多个,默认为普通二维地图
+ */
+ layers?: Layer[];
+ /**
+ * 地图显示的缩放级别
+ */
+ zoom?: number;
+ /**
+ * 地图中心点坐标值
+ */
+ center?: LocationValue;
+ /**
+ * 地图标注显示顺序
+ */
+ labelzIndex?: number;
+ /**
+ * 地图显示的缩放级别范围
+ */
+ zooms?: [number, number];
+ /**
+ * 地图语言类型
+ */
+ lang?: Lang;
+ /**
+ * 地图默认鼠标样式
+ */
+ defaultCursor?: string;
+ /**
+ * 地图显示的参考坐标系
+ */
+ crs?: 'EPSG3857' | 'EPSG3395' | 'EPSG4326';
+ /**
+ * 地图平移过程中是否使用动画
+ */
+ animateEnable?: boolean;
+ /**
+ * 是否开启地图热点和标注的hover效果
+ */
+ isHotspot?: boolean;
+ /**
+ * 当前地图中默认显示的图层
+ */
+ defaultLayer?: TileLayer;
+ /**
+ * 地图是否可旋转
+ */
+ rotateEnable?: boolean;
+ /**
+ * 是否监控地图容器尺寸变化
+ */
+ resizeEnable?: boolean;
+ /**
+ * 是否在有矢量底图的时候自动展示室内地图
+ */
+ showIndoorMap?: boolean;
+ /**
+ * 在展示矢量图的时候自动展示室内地图图层
+ */
+ // indoorMap?: IndorMap
+ /**
+ * 是否支持可以扩展最大缩放级别
+ */
+ expandZoomRange?: boolean;
+ /**
+ * 地图是否可通过鼠标拖拽平移
+ */
+ dragEnable?: boolean;
+ /**
+ * 地图是否可缩放
+ */
+ zoomEnable?: boolean;
+ /**
+ * 地图是否可通过双击鼠标放大地图
+ */
+ doubleClickZoom?: boolean;
+ /**
+ * 地图是否可通过键盘控制
+ */
+ keyboardEnable?: boolean;
+ /**
+ * 地图是否使用缓动效果
+ */
+ jogEnable?: boolean;
+ /**
+ * 地图是否可通过鼠标滚轮缩放浏览
+ */
+ scrollWheel?: boolean;
+ /**
+ * 地图在移动终端上是否可通过多点触控缩放浏览地图
+ */
+ touchZoom?: boolean;
+ /**
+ * 当touchZoomCenter=1的时候,手机端双指缩放的以地图中心为中心,否则默认以双指中间点为中心
+ */
+ touchZoomCenter?: number;
+ /**
+ * 设置地图的显示样式
+ */
+ mapStyle?: string;
+ /**
+ * 设置地图上显示的元素种类
+ */
+ features?: Feature[] | 'all' | Feature;
+ /**
+ * 设置地图显示3D楼块效果
+ */
+ showBuildingBlock?: boolean;
+ /**
+ * 视图模式
+ */
+ viewMode?: ViewMode;
+ /**
+ * 俯仰角度
+ */
+ pitch?: number;
+ /**
+ * 是否允许设置俯仰角度
+ */
+ pitchEnable?: boolean;
+ /**
+ * 楼块出现和消失的时候是否显示动画过程
+ */
+ buildingAnimation?: boolean;
+ /**
+ * 调整天空颜色
+ */
+ skyColor?: string;
+ /**
+ * 设置地图的预加载模式
+ */
+ preloadMode?: boolean;
+ /**
+ * 为 Map 实例指定掩模的路径,各图层将只显示路径范围内图像
+ */
+ mask?: Array<[number, number]> | Array> | Array>>;
+ maxPitch?: number;
+ rotation?: number;
+ forceVector?: boolean;
+
+ // internal
+ baseRender?: 'vw' | 'd' | 'dv' | 'v';
+ overlayRender?: 'c' | 'd';
+ showLabel?: boolean;
+ gridMapForeign?: boolean;
+ logoUrl?: string;
+ logoUrlRetina?: string;
+ copyright?: string;
+ turboMode?: boolean;
+ workerMode?: boolean;
+ // continuousZoomEnable?: boolean;
+ // showFog: boolean;
+ // yaw: number;
+ // scale: number;
+ // detectRetina: number;
+ }
+ interface Status {
+ /**
+ * 是否开启动画
+ */
+ animateEnable: boolean;
+ /**
+ * 是否双击缩放
+ */
+ doubleClickZoom: boolean;
+ /**
+ * 是否支持拖拽
+ */
+ dragEnable: boolean;
+ isHotspot: boolean;
+ /**
+ * 是否开启缓动效果
+ */
+ jogEnable: boolean;
+ /**
+ * 是否支持键盘
+ */
+ keyboardEnable: boolean;
+ /**
+ * 是否支持调整俯仰角
+ */
+ pitchEnable: boolean;
+ resizeEnable: boolean;
+ /**
+ * 是否支持旋转
+ */
+ rotateEnable: boolean;
+ /**
+ * 是否支持滚轮缩放
+ */
+ scrollWheel: boolean;
+ /**
+ * 是否支持触摸缩放
+ */
+ touchZoom: boolean;
+ /**
+ * 是否支持缩放
+ */
+ zoomEnable: boolean;
+ }
+ type HotspotEvent = Event;
+ interface EventMap {
+ click: MapsEvent<'click', Map>;
+ dblclick: MapsEvent<'dblclick', Map>;
+ rightclick: MapsEvent<'rightclick', Map>;
+ rdblclick: MapsEvent<'rdblclick', Map>;
+ mouseup: MapsEvent<'mouseup', Map>;
+ mousedown: MapsEvent<'mousedown', Map>;
+ mousemove: MapsEvent<'mousemove', Map>;
+ mousewheel: MapsEvent<'mousewheel', Map>;
+ mouseover: MapsEvent<'mouseover', Map>;
+ mouseout: MapsEvent<'mouseout', Map>;
+ touchstart: MapsEvent<'touchstart', Map>;
+ touchmove: MapsEvent<'touchmove', Map>;
+ touchend: MapsEvent<'touchend', Map>;
+ contextmenu: MapsEvent<'contextmenu', Map>;
+
+ hotspotclick: HotspotEvent<'hotspotclick'>;
+ hotspotover: HotspotEvent<'hotspotover'>;
+ hotspotout: HotspotEvent<'hotspotout'>;
+
+ complete: Event<'complete'>;
+ mapmove: Event<'mapmove'>;
+ movestart: Event<'movestart'>;
+ moveend: Event<'moveend'>;
+ zoomchange: Event<'zoomchange'>;
+ zoomstart: Event<'zoomstart'>;
+ zoomend: Event<'zoomend'>;
+ dragstart: Event<'dragstart'>;
+ dragging: Event<'dragging'>;
+ dragend: Event<'dragend'>;
+ resize: Event<'resize'>;
+ }
+ }
+
+ class Map extends EventEmitter {
+ /**
+ * 构造一个地图对象
+ * @param container 地图容器的id或者是DOM元素
+ * @param opts 选项
+ */
+ constructor(container: string | HTMLElement, opts?: Map.Options);
+ /**
+ * 唤起高德地图客户端marker页
+ * @param obj 唤起参数
+ */
+ poiOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void;
+ /**
+ * 唤起高德地图客户端marker详情页
+ * @param obj 唤起参数
+ */
+ detailOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void;
+ /**
+ * 获取当前地图缩放级别
+ */
+ getZoom(): number;
+ /**
+ * 获取地图图层数组
+ */
+ getLayers(): Layer[];
+ /**
+ * 获取地图中心点经纬度坐标值
+ */
+ getCenter(): LngLat;
+ /**
+ * 返回地图对象的容器
+ */
+ getContainer(): HTMLElement | null;
+ /**
+ * 获取地图中心点所在区域
+ */
+ getCity(callback: (cityData: {
+ /**
+ * 市名称
+ */
+ city: string;
+ /**
+ * 市代码
+ */
+ citycode: string;
+ /**
+ * 区名称
+ */
+ district: string;
+ /**
+ * 省
+ */
+ province: string | never[]; // province is empty array when getCity fail
+ }) => void): void;
+ /**
+ * 获取当前地图视图范围,获取当前可视区域
+ */
+ getBounds(): Bounds;
+ /**
+ * 获取当前地图标注的显示顺序
+ */
+ getLabelzIndex(): number;
+ /**
+ * 获取Map的限制区域
+ */
+ getLimitBounds(): Bounds;
+ /**
+ * 获取地图语言类型
+ */
+ getLang(): Lang;
+ /**
+ * 获取地图容器像素大小
+ */
+ getSize(): Size;
+ /**
+ * 获取地图顺时针旋转角度
+ */
+ getRotation(): number;
+ /**
+ * 获取当前地图状态信息
+ */
+ getStatus(): Map.Status;
+ /**
+ * 获取地图默认鼠标指针样式
+ */
+ getDefaultCursor(): string;
+ /**
+ * 获取指定位置的地图分辨率
+ * @param point 指定经纬度
+ */
+ getResolution(point?: LocationValue): number;
+ /**
+ * 获取当前地图比例尺
+ * @param dpi dpi
+ */
+ getScale(dpi?: number): number;
+ /**
+ * 设置地图显示的缩放级别
+ * @param level 缩放级别
+ */
+ setZoom(level: number): void;
+ /**
+ * 设置地图标注显示的顺序
+ * @param index 显示顺序
+ */
+ setLabelzIndex(index: number): void;
+ /**
+ * 设置地图图层数组
+ * @param layers 图层数组
+ */
+ setLayers(layers: Layer[]): void;
+ /**
+ * 添加覆盖物/图层
+ * @param overlay 覆盖物/图层
+ */
+ add(overlay: Overlay | Overlay[]): void;
+ /**
+ * 删除覆盖物/图层
+ * @param overlay 覆盖物/图层
+ */
+ remove(overlay: Overlay | Overlay[]): void;
+ /**
+ * 返回添加的覆盖物对象
+ * @param type 覆盖物类型
+ */
+ getAllOverlays(type?: 'marker' | 'circle' | 'polyline' | 'polygon'): Overlay[];
+ /**
+ * 设置地图显示的中心点
+ * @param center 中心点经纬度
+ */
+ setCenter(center: LocationValue): void;
+ /**
+ * 地图缩放至指定级别并以指定点为地图显示中心点
+ * @param zoomLevel 缩放等级
+ * @param center 缩放中心
+ */
+ setZoomAndCenter(zoomLevel: number, center: LocationValue): void;
+ /**
+ * 按照行政区名称或adcode来设置地图显示的中心点。
+ * @param city 城市名称或城市编码
+ * @param callback 回调
+ */
+ setCity(city: string, callback: (this: this, coord: [string, string], zoom: number) => void): void;
+ /**
+ * 指定当前地图显示范围
+ * @param bound 显示范围
+ */
+ setBounds(bound: Bounds): Bounds;
+ /**
+ * 设置Map的限制区域
+ * @param bound 限制区域
+ */
+ setLimitBounds(bound: Bounds): void;
+ /**
+ * 清除限制区域
+ */
+ clearLimitBounds(): void;
+ /**
+ * 设置地图语言类型
+ * @param lang 语言类型
+ */
+ setLang(lang: Lang): void;
+ /**
+ * 设置地图顺时针旋转角度,旋转原点为地图容器中心点
+ * @param rotation 旋转角度
+ */
+ setRotation(rotation: number): void;
+ /**
+ * 设置当前地图显示状态
+ * @param status 状态
+ */
+ setStatus(status: Partial): void;
+ /**
+ * 设置鼠标指针默认样式
+ * @param cursor 指针样式
+ */
+ setDefaultCursor(cursor: string): void;
+ /**
+ * 地图放大一级显示
+ */
+ zoomIn(): void;
+ /**
+ * 地图缩小一级显示
+ */
+ zoomOut(): void;
+ /**
+ * 地图中心点平移至指定点位置
+ * @param position 目标位置经纬度
+ */
+ panTo(position: LocationValue): void;
+ /**
+ * 以像素为单位,沿x方向和y方向移动地图
+ * @param x 横向移动像素,向右为正
+ * @param y 纵向移动像素,向下为正
+ */
+ panBy(x: number, y: number): void;
+ /**
+ * 根据地图上添加的覆盖物分布情况,自动缩放地图到合适的视野级别
+ * @param overlayList 覆盖物数组
+ * @param immediately 是否需要动画过程
+ * @param avoid 上下左右的像素避让宽度
+ * @param maxZoom 最大缩放级别
+ */
+ setFitView(
+ overlayList?: Overlay | Overlay[],
+ immediately?: boolean,
+ avoid?: [number, number, number, number],
+ maxZoom?: number
+ ): Bounds | false | undefined;
+ /**
+ * 删除地图上所有的覆盖物
+ */
+ clearMap(): void;
+ /**
+ * 注销地图对象,并清空地图容器
+ */
+ destroy(): void;
+ /**
+ * 加载插件,
+ * tips: 插件的类型定义不在本类型定义中给出,需要另行安装例如
+ * 3d地图:@types/amap-js-api-map3d
+ * 地区搜索:@types/amap-js-api-place-search
+ * @param name 插件名称
+ * @param callback 插件加载完成后的回调函数
+ */
+ plugin(name: string | string[], callback: () => void): this;
+ /**
+ * 添加控件
+ * @param control 控件
+ */
+ addControl(control: {}): void; // TODO
+ /**
+ * 移除控件
+ * @param control 控件
+ */
+ removeControl(control: {}): void; // TODO
+ /**
+ * 清除地图上的信息窗体。
+ */
+ clearInfoWindow(): void;
+ /**
+ * 平面地图像素坐标转换为地图经纬度坐标
+ * @param pixel 像素坐标
+ * @param level 缩放等级
+ */
+ pixelToLngLat(pixel: Pixel, level?: number): LngLat;
+ /**
+ * 地图经纬度坐标转换为平面地图像素坐标
+ * @param lnglat 经纬度坐标
+ * @param level 缩放等级
+ */
+ lnglatToPixel(lnglat: LocationValue, level?: number): Pixel;
+ /**
+ * 地图容器像素坐标转为地图经纬度坐标
+ * @param pixel 地图像素坐标
+ */
+ containerToLngLat(pixel: Pixel): LngLat;
+ /**
+ * 地图经纬度坐标转为地图容器像素坐标
+ * @param lnglat 经纬度坐标
+ */
+ lngLatToContainer(lnglat: LocationValue): Pixel;
+ /**
+ * 地图经纬度坐标转为地图容器像素坐标
+ * @param lnglat 经纬度坐标
+ */
+ lnglatTocontainer(lnglat: LocationValue): Pixel;
+ /**
+ * 设置地图的显示样式
+ * @param style 地图样式
+ */
+ setMapStyle(style: string): void;
+ /**
+ * 获取地图显示样式
+ */
+ getMapStyle(): string;
+ /**
+ * 设置地图上显示的元素种类
+ * @param feature 元素
+ */
+ setFeatures(feature: Map.Feature | Map.Feature[] | 'all'): void;
+ /**
+ * 获取地图显示元素种类
+ */
+ getFeatures(): Map.Feature | Map.Feature[] | 'all';
+ /**
+ * 修改底图图层
+ * @param layer 图层
+ */
+ setDefaultLayer(layer: TileLayer): void;
+ /**
+ * 设置俯仰角
+ * @param pitch 俯仰角
+ */
+ setPitch(pitch: number): void;
+ /**
+ * 获取俯仰角
+ */
+ getPitch(): number;
+
+ getViewMode_(): Map.ViewMode;
+ lngLatToGeodeticCoord(lnglat: LocationValue): Pixel;
+ geodeticCoordToLngLat(pixel: Pixel): LngLat;
+ }
+}
diff --git a/types/amap-js-api/overlay/bezierCurve.d.ts b/types/amap-js-api/overlay/bezierCurve.d.ts
new file mode 100644
index 0000000000..b861440a92
--- /dev/null
+++ b/types/amap-js-api/overlay/bezierCurve.d.ts
@@ -0,0 +1,35 @@
+declare namespace AMap {
+ namespace BezierCurve {
+ interface EventMap extends Polyline.EventMap { }
+ type Options = Merge, {
+ /**
+ * 贝瑟尔曲线的路径
+ */
+ path: Array>>;
+ // internal
+ tolerance?: number;
+ interpolateNumLimit?: [number | number];
+ }>;
+
+ interface GetOptionsResult extends Polyline.GetOptionsResult {
+ /**
+ * 贝瑟尔曲线的路径
+ */
+ path: Array;
+ }
+ }
+ class BezierCurve extends Polyline {
+ /**
+ * 贝瑟尔曲线
+ * @param options 覆盖物选项
+ */
+ constructor(options: BezierCurve.Options);
+ /**
+ * 获取覆盖物选项
+ */
+ getOptions(): Partial>;
+ // internal
+ getInterpolateLngLats(): LngLat[];
+ getSerializedPath(): number[][];
+ }
+}
diff --git a/types/amap-js-api/overlay/circle.d.ts b/types/amap-js-api/overlay/circle.d.ts
new file mode 100644
index 0000000000..bb3caf4e60
--- /dev/null
+++ b/types/amap-js-api/overlay/circle.d.ts
@@ -0,0 +1,84 @@
+declare namespace AMap {
+ namespace Circle {
+ interface EventMap extends ShapeOverlay.EventMap {
+ setCenter: Event<'setCenter'>;
+ setRadius: Event<'setRadius'>;
+ }
+
+ interface Options