mahal_map 2.3.0 → 2.4.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/README.md +44 -7
- package/dist/index.d.mts +44 -4
- package/dist/index.d.ts +44 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +8 -8
- package/dist/mahal_map.sdk.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,8 @@ const map = MahalMap.create({ container: "map" }, maplibregl, Maps3D);
|
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
53
|
// vite.config.ts — чтобы адрес воркера совпал с файлом во время разработки
|
|
54
|
+
import { defineConfig } from "vite";
|
|
55
|
+
|
|
54
56
|
export default defineConfig({ optimizeDeps: { exclude: ["maplibre-gl"] } });
|
|
55
57
|
```
|
|
56
58
|
|
|
@@ -696,6 +698,8 @@ MahalMap.toggle3DBuildings(map, false);
|
|
|
696
698
|
|
|
697
699
|
Для переключения пользуйтесь именно `toggle3DBuildings()`: он поднимет слой, если его ещё не было (`enable3D: false` при создании), а на сборках Maps3D без реестра слоёв откатится на `setBuildingsEnabled()`.
|
|
698
700
|
|
|
701
|
+
Поднять слой можно, только если `Maps3D` был при `create()` — тогда карта стоит на стиле платформы. Карта, созданная без него, работает на запасном стиле без источников платформы и без ключа в запросах: `toggle3DBuildings(true)` на ней ничего не делает и пишет предупреждение. Подключить `Maps3D` позже — значит пересоздать карту.
|
|
702
|
+
|
|
699
703
|
```ts
|
|
700
704
|
map.toggle3DBuildings(false); // совместимо со всеми сборками
|
|
701
705
|
```
|
|
@@ -873,7 +877,7 @@ onBeforeUnmount(() => {
|
|
|
873
877
|
| `antialias: true` не забыть | ставится сам при включённом 3D |
|
|
874
878
|
| `Maps3D.enhance(map, opts); await maps3d.ready` | `enable3D: true` + `maps3d: {...}`, `await map.whenMaps3DReady()` |
|
|
875
879
|
| `map.setStyle(Maps3D.styleUrl("dark", base))` | `map.setStyle("dark")` — внутри выбранного семейства |
|
|
876
|
-
| `maps3d.refreshLayers()` после смены стиля | вызывается сам на `
|
|
880
|
+
| `maps3d.refreshLayers()` после смены стиля | вызывается сам на `styledata`, когда новый стиль загружен |
|
|
877
881
|
| `maps3d.destroy(); map.remove()` | `map.destroy()` |
|
|
878
882
|
| ключ руками в каждый вызов | один `keyUtils.saveKey()` на всё |
|
|
879
883
|
|
|
@@ -977,7 +981,7 @@ const map = MahalMap.create(
|
|
|
977
981
|
);
|
|
978
982
|
```
|
|
979
983
|
|
|
980
|
-
В NPM-версии второй аргумент `maplibreObject` рекомендуется передавать явно.
|
|
984
|
+
В NPM-версии второй аргумент `maplibreObject` рекомендуется передавать явно. Без него SDK ищет `window.maplibregl` — он есть, только если MapLibre подключён скриптом (`<script src=".../maplibre-gl.js">`). ESM-импорт глобальную переменную не создаёт: тогда передайте библиотеку вторым аргументом (`MahalMap.create({ container: "map" }, maplibregl)`) либо назначьте `window.maplibregl = maplibregl` до вызова `create()`.
|
|
981
985
|
|
|
982
986
|
### `MahalMap.createAsync(options, maplibreObject?, maps3dCtor?)`
|
|
983
987
|
|
|
@@ -1026,7 +1030,7 @@ try {
|
|
|
1026
1030
|
</div>
|
|
1027
1031
|
<template #fallback>
|
|
1028
1032
|
<div class="flex h-[360px] items-center justify-center">
|
|
1029
|
-
|
|
1033
|
+
Загрузка карты…
|
|
1030
1034
|
</div>
|
|
1031
1035
|
</template>
|
|
1032
1036
|
</ClientOnly>
|
|
@@ -1051,10 +1055,17 @@ onMounted(async () => {
|
|
|
1051
1055
|
|
|
1052
1056
|
keyUtils.saveKey(import.meta.env.VITE_MAHAL_API_KEY_TILE);
|
|
1053
1057
|
|
|
1058
|
+
// Без элемента SDK взял бы контейнер по умолчанию — id "map", то есть чужой элемент.
|
|
1059
|
+
const container = mapElement.value;
|
|
1060
|
+
|
|
1061
|
+
if (!container || disposed) {
|
|
1062
|
+
return;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1054
1065
|
try {
|
|
1055
1066
|
const instance = await MahalMap.createAsync(
|
|
1056
1067
|
{
|
|
1057
|
-
container
|
|
1068
|
+
container,
|
|
1058
1069
|
center: DUSHANBE_CENTER,
|
|
1059
1070
|
zoom: 11,
|
|
1060
1071
|
},
|
|
@@ -1347,7 +1358,7 @@ MahalMap.setZoom(map, 14);
|
|
|
1347
1358
|
| `getMap(instance)` | Возвращает нативный MapLibre Map. |
|
|
1348
1359
|
| `getCamera(instance)` | Возвращает CameraController. |
|
|
1349
1360
|
| `setStyle(instance, theme)` | Переключает тему стандартного стиля. |
|
|
1350
|
-
| `setLanguage(instance, lang)` |
|
|
1361
|
+
| `setLanguage(instance, lang)` | Запоминает язык для поиска и роутинга; стиль и подписи не меняет. |
|
|
1351
1362
|
| `setCenter(instance, center)` | Меняет центр карты. |
|
|
1352
1363
|
| `setZoom(instance, zoom)` | Меняет zoom карты. |
|
|
1353
1364
|
| `addMarker(instance, marker)` | Добавляет маркер. |
|
|
@@ -1685,6 +1696,8 @@ interface MeasureShape {
|
|
|
1685
1696
|
import {
|
|
1686
1697
|
Search,
|
|
1687
1698
|
SearchPoi,
|
|
1699
|
+
createSearch,
|
|
1700
|
+
createSearchPoi,
|
|
1688
1701
|
SearchByLocation,
|
|
1689
1702
|
CheckJSApi,
|
|
1690
1703
|
Router,
|
|
@@ -1693,7 +1706,7 @@ import {
|
|
|
1693
1706
|
|
|
1694
1707
|
### `Search(text, token, additionalParam?)`
|
|
1695
1708
|
|
|
1696
|
-
Поиск адресов (геокодер).
|
|
1709
|
+
Поиск адресов (геокодер). Каждый вызов — отдельный запрос, без дебаунса: статический метод зовут разные поля ввода, и общий дебаунс отменял бы запрос одного поля вызовом из другого. Для ввода по символу — `createSearch()`.
|
|
1697
1710
|
|
|
1698
1711
|
```ts
|
|
1699
1712
|
const results = await Search("Рудаки 33", token, {
|
|
@@ -1715,7 +1728,7 @@ const results = await Search("Рудаки 33", token, {
|
|
|
1715
1728
|
|
|
1716
1729
|
### `SearchPoi(text, token, additionalParam?)`
|
|
1717
1730
|
|
|
1718
|
-
Поиск POI (организации, объекты). Сигнатура
|
|
1731
|
+
Поиск POI (организации, объекты). Сигнатура та же, что у `Search`, и тоже без дебаунса; для ввода по символу — `createSearchPoi()`.
|
|
1719
1732
|
|
|
1720
1733
|
```ts
|
|
1721
1734
|
const places = await SearchPoi("кафе", token, {
|
|
@@ -1727,6 +1740,30 @@ const places = await SearchPoi("кафе", token, {
|
|
|
1727
1740
|
|
|
1728
1741
|
Возвращает `ISearchResponse[]`.
|
|
1729
1742
|
|
|
1743
|
+
### `createSearch(delay?)` / `createSearchPoi(delay?)`
|
|
1744
|
+
|
|
1745
|
+
Поиск с дебаунсом для **одного** поля ввода. Возвращают функцию с сигнатурой `Search`/`SearchPoi`; пауза по умолчанию — 500 мс. Создавайте экземпляр на поле (компонент) — очередь у каждого своя, и чужие поля его запросы не отменяют.
|
|
1746
|
+
|
|
1747
|
+
Вызов, перебитый следующим вызовом **этого же** экземпляра до ухода запроса, отклоняется с `DebounceCancelledError`. Это не сбой: ответ получит последний вызов, а отменённый пропускайте молча.
|
|
1748
|
+
|
|
1749
|
+
```ts
|
|
1750
|
+
import { createSearch } from "mahal_map";
|
|
1751
|
+
|
|
1752
|
+
const searchAddress = createSearch(); // одна на поле ввода
|
|
1753
|
+
|
|
1754
|
+
input.addEventListener("input", async () => {
|
|
1755
|
+
try {
|
|
1756
|
+
suggestions = await searchAddress(input.value, token);
|
|
1757
|
+
} catch (error) {
|
|
1758
|
+
// Перебит следующим вводом в этом же поле
|
|
1759
|
+
if ((error as Error).name === "DebounceCancelledError") return;
|
|
1760
|
+
showError(error);
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1763
|
+
```
|
|
1764
|
+
|
|
1765
|
+
Сверяйте по `name`, а не через `instanceof`: на странице может оказаться две сборки SDK. Класс тоже экспортируется — `import { DebounceCancelledError } from "mahal_map"`.
|
|
1766
|
+
|
|
1730
1767
|
### `SearchByLocation(params)`
|
|
1731
1768
|
|
|
1732
1769
|
Обратный геокодинг: адреса и POI по координатам. Без дебаунса.
|
package/dist/index.d.mts
CHANGED
|
@@ -586,6 +586,7 @@ declare class MahalMap {
|
|
|
586
586
|
private maps3dCtor?;
|
|
587
587
|
private maps3dLayer?;
|
|
588
588
|
private maps3dReady?;
|
|
589
|
+
private platformStyle;
|
|
589
590
|
private buildingsEnabled;
|
|
590
591
|
private workerCheckTimer?;
|
|
591
592
|
private styleChangeHandler?;
|
|
@@ -867,6 +868,10 @@ declare class MahalMap {
|
|
|
867
868
|
/**
|
|
868
869
|
* Занимает слот подписки. Запись живёт до подъёма слоя и переигрывается на нём;
|
|
869
870
|
* отписка снимает слот, только если он всё ещё её.
|
|
871
|
+
*
|
|
872
|
+
* Прежнюю подписку при замене со слоя не снимаем: у Maps3D каждый из этих методов —
|
|
873
|
+
* один слот, и новый вызов сам снимает старый обработчик (и в 0.11.0, и раньше).
|
|
874
|
+
* Явная отписка перед заменой у наведения выключала бы и тут же включала слежение.
|
|
870
875
|
*/
|
|
871
876
|
private subscribe;
|
|
872
877
|
private bindSubscription;
|
|
@@ -931,8 +936,17 @@ declare const getApiKey: () => string;
|
|
|
931
936
|
|
|
932
937
|
declare function Router(param: number[][], typeData: string, token: string): Promise<IRoute[]>;
|
|
933
938
|
|
|
939
|
+
type SearchFn = (param: string, token: string, additionalParam?: IAdditionalParamType) => Promise<ISearchResponse[]>;
|
|
940
|
+
/**
|
|
941
|
+
* Поиск адресов. Каждый вызов — свой запрос: статический метод зовут разные поля ввода,
|
|
942
|
+
* и общий на всех debounce отменял бы запрос одного поля вызовом из другого.
|
|
943
|
+
* Дебаунс на поле ввода — createSearch().
|
|
944
|
+
*/
|
|
934
945
|
declare function Search(param: string, token: string, additionalParam?: IAdditionalParamType): Promise<ISearchResponse[]>;
|
|
946
|
+
/** Поиск POI. Без дебаунса, как и Search; дебаунс на поле ввода — createSearchPoi(). */
|
|
935
947
|
declare function SearchPoi(param: string, token: string, additionalParam?: IAdditionalParamType): Promise<ISearchResponse[]>;
|
|
948
|
+
declare function createSearch(delay?: number): SearchFn;
|
|
949
|
+
declare function createSearchPoi(delay?: number): SearchFn;
|
|
936
950
|
/**
|
|
937
951
|
* Обратный геокодинг. В отличие от Search/SearchPoi возвращает тело ответа целиком:
|
|
938
952
|
* `{ success, data: ISearchResponse[], message }` — объекты рядом с точкой, по `distance`.
|
|
@@ -946,10 +960,12 @@ declare const index$2_Search: typeof Search;
|
|
|
946
960
|
declare const index$2_SearchByLocation: typeof SearchByLocation;
|
|
947
961
|
declare const index$2_SearchPoi: typeof SearchPoi;
|
|
948
962
|
declare const index$2_clearKey: typeof clearKey;
|
|
963
|
+
declare const index$2_createSearch: typeof createSearch;
|
|
964
|
+
declare const index$2_createSearchPoi: typeof createSearchPoi;
|
|
949
965
|
declare const index$2_getApiKey: typeof getApiKey;
|
|
950
966
|
declare const index$2_saveKey: typeof saveKey;
|
|
951
967
|
declare namespace index$2 {
|
|
952
|
-
export { index$2_CheckJSApi as CheckJSApi, index$2_Router as Router, index$2_Search as Search, index$2_SearchByLocation as SearchByLocation, index$2_SearchPoi as SearchPoi, index$2_clearKey as clearKey, index$2_getApiKey as getApiKey, index$2_saveKey as saveKey };
|
|
968
|
+
export { index$2_CheckJSApi as CheckJSApi, index$2_Router as Router, index$2_Search as Search, index$2_SearchByLocation as SearchByLocation, index$2_SearchPoi as SearchPoi, index$2_clearKey as clearKey, index$2_createSearch as createSearch, index$2_createSearchPoi as createSearchPoi, index$2_getApiKey as getApiKey, index$2_saveKey as saveKey };
|
|
953
969
|
}
|
|
954
970
|
|
|
955
971
|
declare class MahalMapDefaultMarker {
|
|
@@ -1177,7 +1193,28 @@ declare function checkCoordinates(coordinates: string): {
|
|
|
1177
1193
|
lng: string | undefined;
|
|
1178
1194
|
} | null;
|
|
1179
1195
|
|
|
1180
|
-
|
|
1196
|
+
/**
|
|
1197
|
+
* Вызов отменён: до срабатывания таймера пришёл следующий. Отличать по `name`, а не
|
|
1198
|
+
* по instanceof — у страницы может оказаться две сборки SDK.
|
|
1199
|
+
*/
|
|
1200
|
+
declare class DebounceCancelledError extends Error {
|
|
1201
|
+
constructor();
|
|
1202
|
+
}
|
|
1203
|
+
interface IDebounceOptions {
|
|
1204
|
+
/**
|
|
1205
|
+
* Вызовы, перебитые следующим до срабатывания таймера, отклоняются с
|
|
1206
|
+
* DebounceCancelledError. Без опции все они получают результат последнего запроса —
|
|
1207
|
+
* это верно, пока функцию дёргает один потребитель. Общему на модуль debounce, который
|
|
1208
|
+
* зовут разные поля ввода, нужна именно опция: иначе одно поле получит ответ на чужой запрос.
|
|
1209
|
+
*/
|
|
1210
|
+
rejectSuperseded?: boolean;
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Откладывает вызов `fn` до паузы в `delay` мс. Каждый вызов получает промис, и ни один не
|
|
1214
|
+
* повисает: он завершается результатом (или ошибкой) запроса, либо — с `rejectSuperseded` —
|
|
1215
|
+
* отклоняется, если его перебил следующий.
|
|
1216
|
+
*/
|
|
1217
|
+
declare function debounce<F extends (...args: any[]) => Promise<any>>(fn: F, delay: number, options?: IDebounceOptions): (...args: Parameters<F>) => Promise<Awaited<ReturnType<F>>>;
|
|
1181
1218
|
|
|
1182
1219
|
declare function geojsonPolyline(encoded: string): number[][];
|
|
1183
1220
|
|
|
@@ -1185,13 +1222,16 @@ declare function geometryPolyline(coordinates: number[][]): string;
|
|
|
1185
1222
|
|
|
1186
1223
|
declare function trimValue(value: string, cut: number): string;
|
|
1187
1224
|
|
|
1225
|
+
type index_DebounceCancelledError = DebounceCancelledError;
|
|
1226
|
+
declare const index_DebounceCancelledError: typeof DebounceCancelledError;
|
|
1227
|
+
type index_IDebounceOptions = IDebounceOptions;
|
|
1188
1228
|
declare const index_checkCoordinates: typeof checkCoordinates;
|
|
1189
1229
|
declare const index_debounce: typeof debounce;
|
|
1190
1230
|
declare const index_geojsonPolyline: typeof geojsonPolyline;
|
|
1191
1231
|
declare const index_geometryPolyline: typeof geometryPolyline;
|
|
1192
1232
|
declare const index_trimValue: typeof trimValue;
|
|
1193
1233
|
declare namespace index {
|
|
1194
|
-
export { index_checkCoordinates as checkCoordinates, index_debounce as debounce, index_geojsonPolyline as geojsonPolyline, index_geometryPolyline as geometryPolyline, index_trimValue as trimValue };
|
|
1234
|
+
export { index_DebounceCancelledError as DebounceCancelledError, type index_IDebounceOptions as IDebounceOptions, index_checkCoordinates as checkCoordinates, index_debounce as debounce, index_geojsonPolyline as geojsonPolyline, index_geometryPolyline as geometryPolyline, index_trimValue as trimValue };
|
|
1195
1235
|
}
|
|
1196
1236
|
|
|
1197
|
-
export { CheckJSApi, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DLayerStateParams, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DParkingHoverStyle, type IMaps3DParkingInfo, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchDetailAddress, type ISearchDetailInfo, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DListener, type Maps3DParkingSubtype, type Maps3DSelectionKind, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type SearchResultType, type Theme, index$2 as keyUtils, index$1 as measureUtils, index as utils };
|
|
1237
|
+
export { CheckJSApi, DebounceCancelledError, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DLayerStateParams, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DParkingHoverStyle, type IMaps3DParkingInfo, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchDetailAddress, type ISearchDetailInfo, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DListener, type Maps3DParkingSubtype, type Maps3DSelectionKind, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type SearchResultType, type Theme, createSearch, createSearchPoi, index$2 as keyUtils, index$1 as measureUtils, index as utils };
|
package/dist/index.d.ts
CHANGED
|
@@ -586,6 +586,7 @@ declare class MahalMap {
|
|
|
586
586
|
private maps3dCtor?;
|
|
587
587
|
private maps3dLayer?;
|
|
588
588
|
private maps3dReady?;
|
|
589
|
+
private platformStyle;
|
|
589
590
|
private buildingsEnabled;
|
|
590
591
|
private workerCheckTimer?;
|
|
591
592
|
private styleChangeHandler?;
|
|
@@ -867,6 +868,10 @@ declare class MahalMap {
|
|
|
867
868
|
/**
|
|
868
869
|
* Занимает слот подписки. Запись живёт до подъёма слоя и переигрывается на нём;
|
|
869
870
|
* отписка снимает слот, только если он всё ещё её.
|
|
871
|
+
*
|
|
872
|
+
* Прежнюю подписку при замене со слоя не снимаем: у Maps3D каждый из этих методов —
|
|
873
|
+
* один слот, и новый вызов сам снимает старый обработчик (и в 0.11.0, и раньше).
|
|
874
|
+
* Явная отписка перед заменой у наведения выключала бы и тут же включала слежение.
|
|
870
875
|
*/
|
|
871
876
|
private subscribe;
|
|
872
877
|
private bindSubscription;
|
|
@@ -931,8 +936,17 @@ declare const getApiKey: () => string;
|
|
|
931
936
|
|
|
932
937
|
declare function Router(param: number[][], typeData: string, token: string): Promise<IRoute[]>;
|
|
933
938
|
|
|
939
|
+
type SearchFn = (param: string, token: string, additionalParam?: IAdditionalParamType) => Promise<ISearchResponse[]>;
|
|
940
|
+
/**
|
|
941
|
+
* Поиск адресов. Каждый вызов — свой запрос: статический метод зовут разные поля ввода,
|
|
942
|
+
* и общий на всех debounce отменял бы запрос одного поля вызовом из другого.
|
|
943
|
+
* Дебаунс на поле ввода — createSearch().
|
|
944
|
+
*/
|
|
934
945
|
declare function Search(param: string, token: string, additionalParam?: IAdditionalParamType): Promise<ISearchResponse[]>;
|
|
946
|
+
/** Поиск POI. Без дебаунса, как и Search; дебаунс на поле ввода — createSearchPoi(). */
|
|
935
947
|
declare function SearchPoi(param: string, token: string, additionalParam?: IAdditionalParamType): Promise<ISearchResponse[]>;
|
|
948
|
+
declare function createSearch(delay?: number): SearchFn;
|
|
949
|
+
declare function createSearchPoi(delay?: number): SearchFn;
|
|
936
950
|
/**
|
|
937
951
|
* Обратный геокодинг. В отличие от Search/SearchPoi возвращает тело ответа целиком:
|
|
938
952
|
* `{ success, data: ISearchResponse[], message }` — объекты рядом с точкой, по `distance`.
|
|
@@ -946,10 +960,12 @@ declare const index$2_Search: typeof Search;
|
|
|
946
960
|
declare const index$2_SearchByLocation: typeof SearchByLocation;
|
|
947
961
|
declare const index$2_SearchPoi: typeof SearchPoi;
|
|
948
962
|
declare const index$2_clearKey: typeof clearKey;
|
|
963
|
+
declare const index$2_createSearch: typeof createSearch;
|
|
964
|
+
declare const index$2_createSearchPoi: typeof createSearchPoi;
|
|
949
965
|
declare const index$2_getApiKey: typeof getApiKey;
|
|
950
966
|
declare const index$2_saveKey: typeof saveKey;
|
|
951
967
|
declare namespace index$2 {
|
|
952
|
-
export { index$2_CheckJSApi as CheckJSApi, index$2_Router as Router, index$2_Search as Search, index$2_SearchByLocation as SearchByLocation, index$2_SearchPoi as SearchPoi, index$2_clearKey as clearKey, index$2_getApiKey as getApiKey, index$2_saveKey as saveKey };
|
|
968
|
+
export { index$2_CheckJSApi as CheckJSApi, index$2_Router as Router, index$2_Search as Search, index$2_SearchByLocation as SearchByLocation, index$2_SearchPoi as SearchPoi, index$2_clearKey as clearKey, index$2_createSearch as createSearch, index$2_createSearchPoi as createSearchPoi, index$2_getApiKey as getApiKey, index$2_saveKey as saveKey };
|
|
953
969
|
}
|
|
954
970
|
|
|
955
971
|
declare class MahalMapDefaultMarker {
|
|
@@ -1177,7 +1193,28 @@ declare function checkCoordinates(coordinates: string): {
|
|
|
1177
1193
|
lng: string | undefined;
|
|
1178
1194
|
} | null;
|
|
1179
1195
|
|
|
1180
|
-
|
|
1196
|
+
/**
|
|
1197
|
+
* Вызов отменён: до срабатывания таймера пришёл следующий. Отличать по `name`, а не
|
|
1198
|
+
* по instanceof — у страницы может оказаться две сборки SDK.
|
|
1199
|
+
*/
|
|
1200
|
+
declare class DebounceCancelledError extends Error {
|
|
1201
|
+
constructor();
|
|
1202
|
+
}
|
|
1203
|
+
interface IDebounceOptions {
|
|
1204
|
+
/**
|
|
1205
|
+
* Вызовы, перебитые следующим до срабатывания таймера, отклоняются с
|
|
1206
|
+
* DebounceCancelledError. Без опции все они получают результат последнего запроса —
|
|
1207
|
+
* это верно, пока функцию дёргает один потребитель. Общему на модуль debounce, который
|
|
1208
|
+
* зовут разные поля ввода, нужна именно опция: иначе одно поле получит ответ на чужой запрос.
|
|
1209
|
+
*/
|
|
1210
|
+
rejectSuperseded?: boolean;
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Откладывает вызов `fn` до паузы в `delay` мс. Каждый вызов получает промис, и ни один не
|
|
1214
|
+
* повисает: он завершается результатом (или ошибкой) запроса, либо — с `rejectSuperseded` —
|
|
1215
|
+
* отклоняется, если его перебил следующий.
|
|
1216
|
+
*/
|
|
1217
|
+
declare function debounce<F extends (...args: any[]) => Promise<any>>(fn: F, delay: number, options?: IDebounceOptions): (...args: Parameters<F>) => Promise<Awaited<ReturnType<F>>>;
|
|
1181
1218
|
|
|
1182
1219
|
declare function geojsonPolyline(encoded: string): number[][];
|
|
1183
1220
|
|
|
@@ -1185,13 +1222,16 @@ declare function geometryPolyline(coordinates: number[][]): string;
|
|
|
1185
1222
|
|
|
1186
1223
|
declare function trimValue(value: string, cut: number): string;
|
|
1187
1224
|
|
|
1225
|
+
type index_DebounceCancelledError = DebounceCancelledError;
|
|
1226
|
+
declare const index_DebounceCancelledError: typeof DebounceCancelledError;
|
|
1227
|
+
type index_IDebounceOptions = IDebounceOptions;
|
|
1188
1228
|
declare const index_checkCoordinates: typeof checkCoordinates;
|
|
1189
1229
|
declare const index_debounce: typeof debounce;
|
|
1190
1230
|
declare const index_geojsonPolyline: typeof geojsonPolyline;
|
|
1191
1231
|
declare const index_geometryPolyline: typeof geometryPolyline;
|
|
1192
1232
|
declare const index_trimValue: typeof trimValue;
|
|
1193
1233
|
declare namespace index {
|
|
1194
|
-
export { index_checkCoordinates as checkCoordinates, index_debounce as debounce, index_geojsonPolyline as geojsonPolyline, index_geometryPolyline as geometryPolyline, index_trimValue as trimValue };
|
|
1234
|
+
export { index_DebounceCancelledError as DebounceCancelledError, type index_IDebounceOptions as IDebounceOptions, index_checkCoordinates as checkCoordinates, index_debounce as debounce, index_geojsonPolyline as geojsonPolyline, index_geometryPolyline as geometryPolyline, index_trimValue as trimValue };
|
|
1195
1235
|
}
|
|
1196
1236
|
|
|
1197
|
-
export { CheckJSApi, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DLayerStateParams, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DParkingHoverStyle, type IMaps3DParkingInfo, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchDetailAddress, type ISearchDetailInfo, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DListener, type Maps3DParkingSubtype, type Maps3DSelectionKind, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type SearchResultType, type Theme, index$2 as keyUtils, index$1 as measureUtils, index as utils };
|
|
1237
|
+
export { CheckJSApi, DebounceCancelledError, type IAdditionalParamType, type ICheckJSApiParam, type ICheckJSApiResponse, type IMahalMapOptions, type IMapMarker, type IMaps3DBuildingClickInfo, type IMaps3DBuildingsController, type IMaps3DBuildingsOptions, type IMaps3DClosuresOptions, type IMaps3DDiagnostics, type IMaps3DHoverStyle, type IMaps3DIndoorOptions, type IMaps3DLayer, type IMaps3DLayerOptions, type IMaps3DLayerParams, type IMaps3DLayerState, type IMaps3DLayerStateParams, type IMaps3DMapOptionsInput, type IMaps3DMapOptionsResult, type IMaps3DObjectsLightOptions, type IMaps3DParkingHoverStyle, type IMaps3DParkingInfo, type IMaps3DPlacesOptions, type IMaps3DRoadHit, type IMaps3DSelectionStyle, type IMaps3DTrafficOptions, type IMaps3DTransformRequestOptions, type IResponse, type IRoute, type ISearchByLocationParam, type ISearchDetailAddress, type ISearchDetailInfo, type ISearchParam, type ISearchResponse, MahalMap, MahalMapDefaultMarker, type MahalMapDefaultMarkerProps, type MapEngine, type MapLanguage, type MapStyleFamily, type Maps3DBuildingDetail, type Maps3DCtor, type Maps3DLayerId, type Maps3DListener, type Maps3DParkingSubtype, type Maps3DSelectionKind, type Maps3DTerrainMode, type Maps3DThemeName, type Maps3DTransformRequest, type MeasureIcons, type MeasureLabels, type MeasureMode, type MeasurePoint, type MeasureShape, type MeasureState, type MeasureStyleOptions, MeasureTool, type MeasureToolOptions, Router, Search, SearchByLocation, SearchPoi, type SearchResultType, type Theme, createSearch, createSearchPoi, index$2 as keyUtils, index$1 as measureUtils, index as utils };
|