-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
不再使用官方的类型声明库 ts 环境下使用 amapPolygonPath2GeoJSONCoords 时,输入输出类型变更
- Loading branch information
Showing
17 changed files
with
127 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,20 +62,17 @@ https://cdn.jsdelivr.net/npm/[email protected]/dist/amap-react-compone | |
|
||
### Typescript | ||
|
||
安装官方的 jsapi 的 ts 声明 | ||
安装 jsapi 的 ts 声明 | ||
|
||
```shell | ||
npm install @amap/amap-jsapi-types | ||
npm install amap-jsapi-v2-types -D | ||
``` | ||
|
||
由于官方 ts 声明存在声明错误、缺漏,以及缺少 AMapUI 相关接口声明等问题, | ||
本项目在官方声明上对接口声明做了改动。 | ||
由于官方 ts 声明存在声明错误、缺漏,以及缺少 AMapUI 相关接口声明,甚至官方文档存在错误等问题 | ||
|
||
因此,需要将此[声明文件](./src/@types/AMap.d.ts) 复制进您的项目。 | ||
当使用了本项目暂时不支持的组件,您需要自定义组件时,可以在您的项目自行维护。 | ||
自定义组件时,可以参考[此文件](https://github.com/xyy94813/amap-react-components/blob/main/src/%40types/AMap.d.ts) 对其类型扩展 | ||
|
||
> 如过,有人知道如何将这部分声明文件在构建时一同打包进最终的输出中,麻烦告知我。 | ||
> 如果能看到您的 PR 那就更好了。 | ||
并及时给 `amap-jsapi-v2-types` 提 PR。 | ||
|
||
### Polyfill | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
export type AMapMarkerProps = AMap.MarkerOptions & { | ||
position: AMap.Vector2; | ||
anchor?: 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; | ||
position: AMap.LngLatLike; | ||
anchor?: | ||
| 'top-left' | ||
| 'top-center' | ||
| 'top-right' | ||
| 'middle-left' | ||
| 'center' | ||
| 'middle-right' | ||
| 'bottom-left' | ||
| 'bottom-center' | ||
| 'bottom-right'; | ||
// | ||
visible?: boolean; | ||
// isTop?: boolean; | ||
// | ||
onHide?: (event?: any) => void; | ||
onShow?: (event?: any) => void; | ||
onClick?: (event?: any) => void | ||
onDBLClick?: (event?: any) => void | ||
onRightClick?: (event?: any) => void | ||
onMousemove?: (event?: any) => void | ||
onMousedown?: (event?: any) => void | ||
onMouseup?: (event?: any) => void | ||
onMouseover?: (event?: any) => void | ||
onMouseout?: (event?: any) => void | ||
onTouchstart?: (event?: any) => void | ||
onTouchmove?: (event?: any) => void | ||
onTouchend?: (event?: any) => void | ||
onDragstart?: (event?: any) => void | ||
onDragging?: (event?: any) => void | ||
onDragend?: (event?: any) => void | ||
onMoving?: (event?: any) => void | ||
onMoveEnd?: (event?: any) => void | ||
onMoveAlong?: (event?: any) => void | ||
onClick?: (event?: any) => void; | ||
onDBLClick?: (event?: any) => void; | ||
onRightClick?: (event?: any) => void; | ||
onMousemove?: (event?: any) => void; | ||
onMousedown?: (event?: any) => void; | ||
onMouseup?: (event?: any) => void; | ||
onMouseover?: (event?: any) => void; | ||
onMouseout?: (event?: any) => void; | ||
onTouchstart?: (event?: any) => void; | ||
onTouchmove?: (event?: any) => void; | ||
onTouchend?: (event?: any) => void; | ||
onDragstart?: (event?: any) => void; | ||
onDragging?: (event?: any) => void; | ||
onDragend?: (event?: any) => void; | ||
onMoving?: (event?: any) => void; | ||
onMoveEnd?: (event?: any) => void; | ||
onMoveAlong?: (event?: any) => void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.