Git Product home page Git Product logo

amap-jsapi-v2-types's Introduction

amap-jsapi-v2-types

高德 JSAPI v2 类型声明文件。

不考虑兼容 js api v1 版本。

GitHub Repo stars last commit (branch)

latest version License npm downloads

如何使用

安装:

yarn add amap-jsapi-v2-types -D
## 或使用 npm/pnpm

个人项目扩展声明示例:

// 将声明文件通过 include/import/typeRoots 等方式引入
// in amap.d.ts
import "amap-jsapi-v2-types";

declare global {
  // ts namespace/interface 会合并声明
  namespace AMap {
    // 目前大多数类型声明,出于避免严格考虑,采用 type 而不是 interface
    // 建议扩展新类型并使用
    export type ExtraMarkerOptions = AMap.MarkerOptions & {
      newProperties: string;
    };
    export class ExtraMarker extends AMap.Marker {
      constructor(opt?: ExtraMarkerOptions);
      newMethod(): void;
    }
  }

  // 对 amap type 做扩展
  namespace AMapUI {
    export type SimpleMarkerOptions = Omit<AMap.MarkerOptions, "content"> & {
      iconTheme?: string;
      iconStyle?: string | object;
      iconLabel?: string | object;
      showPositionPoint?: boolean | object;
      containerClassNames?: string;
    };
  }
}

项目产生的原因

  • 当下高德 jsapi 类型声明库五花八门,且官方库基本处于 0 成本维护状态 + 低质量。
  • DefinitelyTyped 下类型声明缺少专人维护,缺少统一的管理计划。
  • @uiw/react-amap-types 质量较高,但是随着其提供的 react 组件增加声明

其他库:

  • @amap/amap-jsapi-types
  • @vuemap/amap-jsapi-types
  • DefinitelyTyped/types/amap-js-api
  • DefinitelyTyped/types/amap-js-sdk
  • @uiw/react-amap-types

此项目目标?

项目目标

如何贡献

贡献指南

希望承担此项目 Maintainer 的同学可邮箱联系我。

变更日志

查看变更日志

License

MIT

amap-jsapi-v2-types's People

Contributors

xyy94813 avatar

Stargazers

 avatar TeCHiScy avatar  avatar Cedong.Lee avatar wen_lun avatar ysansan avatar Eumeryx avatar  avatar

Watchers

 avatar

amap-jsapi-v2-types's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.