china-railway-station 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.cts CHANGED
@@ -26,38 +26,42 @@ interface Station {
26
26
  }
27
27
  //#endregion
28
28
  //#region src/index.d.ts
29
- /**
30
- * 获取车站全部列表
31
- */
32
- declare function getList(): Station[];
33
- /**
34
- * 获取车站全部列表(城市分组格式)
35
- */
36
- declare function getListCityGroup(): Partial<Record<string, Station[]>>;
37
- /**
38
- * 模糊搜索车站
39
- * @param keyword 关键词
40
- */
41
- declare function getStation(keyword: string): Station[];
42
- /**
43
- * 通过车站名获取车站信息
44
- * @param name 车站名
45
- */
46
- declare function getStationByName(name: string): Station | undefined;
47
- /**
48
- * 通过电报码获取车站信息
49
- * @param telecode 电报码
50
- */
51
- declare function getStationByTelecode(telecode: string): Station | undefined;
52
- /**
53
- * 通过拼音码获取车站信息
54
- * @param pinyinCode 拼音码
55
- */
56
- declare function getStationByPinyinCode(pinyinCode: string): Station[];
57
- /**
58
- * 通过城市名或城市编码获取车站信息
59
- * @param city 城市名/城市编码
60
- */
61
- declare function getStationByCity(city: string): Station[];
29
+ declare class ChinaRailwayStation {
30
+ #private;
31
+ constructor();
32
+ /**
33
+ * 获取车站全部列表
34
+ */
35
+ get list(): Station[];
36
+ /**
37
+ * 获取车站全部列表(城市分组格式)
38
+ */
39
+ get group(): Partial<Record<string, Station[]>>;
40
+ /**
41
+ * 模糊搜索车站
42
+ * @param keyword 关键词
43
+ */
44
+ find(keyword: string): Station[];
45
+ /**
46
+ * 通过车站名获取车站信息
47
+ * @param name 车站名
48
+ */
49
+ findByName(name: string): Station | undefined;
50
+ /**
51
+ * 通过电报码获取车站信息
52
+ * @param telecode 电报码
53
+ */
54
+ findByTelecode(telecode: string): Station | undefined;
55
+ /**
56
+ * 通过拼音码获取车站信息
57
+ * @param pinyinCode 拼音码
58
+ */
59
+ findByPinyinCode(pinyinCode: string): Station[];
60
+ /**
61
+ * 通过城市名或城市编码获取车站信息
62
+ * @param city 城市名/城市编码
63
+ */
64
+ findByCity(city: string): Station[];
65
+ }
62
66
  //#endregion
63
- export { Station, getList, getListCityGroup, getStation, getStationByCity, getStationByName, getStationByPinyinCode, getStationByTelecode };
67
+ export { Station, ChinaRailwayStation as default };
package/build/index.d.ts CHANGED
@@ -26,38 +26,42 @@ interface Station {
26
26
  }
27
27
  //#endregion
28
28
  //#region src/index.d.ts
29
- /**
30
- * 获取车站全部列表
31
- */
32
- declare function getList(): Station[];
33
- /**
34
- * 获取车站全部列表(城市分组格式)
35
- */
36
- declare function getListCityGroup(): Partial<Record<string, Station[]>>;
37
- /**
38
- * 模糊搜索车站
39
- * @param keyword 关键词
40
- */
41
- declare function getStation(keyword: string): Station[];
42
- /**
43
- * 通过车站名获取车站信息
44
- * @param name 车站名
45
- */
46
- declare function getStationByName(name: string): Station | undefined;
47
- /**
48
- * 通过电报码获取车站信息
49
- * @param telecode 电报码
50
- */
51
- declare function getStationByTelecode(telecode: string): Station | undefined;
52
- /**
53
- * 通过拼音码获取车站信息
54
- * @param pinyinCode 拼音码
55
- */
56
- declare function getStationByPinyinCode(pinyinCode: string): Station[];
57
- /**
58
- * 通过城市名或城市编码获取车站信息
59
- * @param city 城市名/城市编码
60
- */
61
- declare function getStationByCity(city: string): Station[];
29
+ declare class ChinaRailwayStation {
30
+ #private;
31
+ constructor();
32
+ /**
33
+ * 获取车站全部列表
34
+ */
35
+ get list(): Station[];
36
+ /**
37
+ * 获取车站全部列表(城市分组格式)
38
+ */
39
+ get group(): Partial<Record<string, Station[]>>;
40
+ /**
41
+ * 模糊搜索车站
42
+ * @param keyword 关键词
43
+ */
44
+ find(keyword: string): Station[];
45
+ /**
46
+ * 通过车站名获取车站信息
47
+ * @param name 车站名
48
+ */
49
+ findByName(name: string): Station | undefined;
50
+ /**
51
+ * 通过电报码获取车站信息
52
+ * @param telecode 电报码
53
+ */
54
+ findByTelecode(telecode: string): Station | undefined;
55
+ /**
56
+ * 通过拼音码获取车站信息
57
+ * @param pinyinCode 拼音码
58
+ */
59
+ findByPinyinCode(pinyinCode: string): Station[];
60
+ /**
61
+ * 通过城市名或城市编码获取车站信息
62
+ * @param city 城市名/城市编码
63
+ */
64
+ findByCity(city: string): Station[];
65
+ }
62
66
  //#endregion
63
- export { Station, getList, getListCityGroup, getStation, getStationByCity, getStationByName, getStationByPinyinCode, getStationByTelecode };
67
+ export { Station, ChinaRailwayStation as default };