1.4.4 • Published 6 months ago

@types/amap-js-api-arrival-range v1.4.4

Weekly downloads
15
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/amap-js-api-arrival-range

Summary

This package contains type definitions for amap-js-api-arrival-range (https://lbs.amap.com/api/javascript-api/reference/route-search#m_AMap.ArrivalRange).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/amap-js-api-arrival-range.

index.d.ts

// Type definitions for non-npm package amap-js-api-arrival-range 1.4
// Project: https://lbs.amap.com/api/javascript-api/reference/route-search#m_AMap.ArrivalRange
// Definitions by: breeze9527 <https://github.com/breeze9527>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

/// <reference types="amap-js-api" />

declare namespace AMap {
    namespace ArrivalRange {
        interface EventMap {
            error: Event<'error', { info: string; }>;
        }
        interface SearchOptions {
            /**
             * 公交出行策略,可选为:地铁:SUBWAY, 公交:BUS,多策略使用逗号分隔
             */
            policy?: string | undefined; // 'BUS' | 'SUBWAY' | 'BUS,SUBWAY' | 'SUBWAY,BUS';
            /**
             * 结果返回样式:polygon:返回多边形边界值,coverage:判断设定的终点坐标是否在到达圈范围内
             */
            resultType?: 'polygon' | 'coverage' | undefined; // useless
            /**
             * 选择一个想到达的目的地坐标,最多支持5个目的地坐标
             */
            destination?: LocationValue | LocationValue[] | undefined;
        }
        interface SearchResult {
            /**
             * 查询状态说明
             */
            info: string;
            /**
             * 到达圈边界坐标点
             */
            bounds: string[][][][];
            /**
             * 提供的终点坐标是否在到达圈内
             */
            inRange?: boolean[] | undefined;

            // internal
            infocode: string;
        }
        type SearchStatus = 'complete' | 'error' | 'no_data';
    }

    /**
     * 公交到达圈展示
     */
    class ArrivalRange extends EventEmitter {
        /**
         * 计算某个时间段内用户通过公交出行可到达的距离范围
         * @param origin 起始点
         * @param time 时间
         * @param callback 回调
         * @param opts 选项
         */
        search(
            origin: LocationValue,
            time: number,
            callback: (status: ArrivalRange.SearchStatus, result: string | ArrivalRange.SearchResult) => void,
            opts?: ArrivalRange.SearchOptions
        ): void;
    }
}

Additional Details

  • Last updated: Wed, 07 Jul 2021 21:44:07 GMT
  • Dependencies: @types/amap-js-api
  • Global values: AMap

Credits

These definitions were written by breeze9527.

1.4.4

6 months ago

1.4.3

7 months ago

1.4.2

8 months ago

1.4.1

3 years ago

1.4.0

5 years ago