mahal_map 2.2.3 → 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 +93 -20
- package/dist/index.d.mts +135 -31
- package/dist/index.d.ts +135 -31
- package/dist/index.js +1 -1
- package/dist/index.mjs +8 -8
- package/dist/mahal_map.sdk.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface IAdditionalParamType {
|
|
|
23
23
|
/**
|
|
24
24
|
* Поверхность @grammaps/maps3d-web, описанная локально. Пакет в зависимости не ставится —
|
|
25
25
|
* он приходит снаружи, как и maplibre-gl, поэтому импортировать его типы нельзя. Здесь
|
|
26
|
-
* повторена публичная часть .d.ts версии 0.
|
|
26
|
+
* повторена публичная часть .d.ts версии 0.11.0; всё необязательное помечено `?`, чтобы
|
|
27
27
|
* более старая сборка на странице не ломала типы у потребителя.
|
|
28
28
|
*/
|
|
29
29
|
type Maps3DThemeName = "light" | "dark" | "navigator-light" | "navigator-dark" | "mobile-light" | "mobile-dark";
|
|
@@ -97,8 +97,26 @@ interface IMaps3DLayerState {
|
|
|
97
97
|
* У слоя, который не умеет ответить фактом, повторяет `active`; у сборок до 0.8.0 — undefined.
|
|
98
98
|
*/
|
|
99
99
|
rendered?: boolean;
|
|
100
|
-
/** Параметры слоя: у зданий — detail, у этажей — level, у рельефа — mode. */
|
|
101
|
-
params:
|
|
100
|
+
/** Параметры слоя: у зданий — detail, у этажей — level и levels, у рельефа — mode. */
|
|
101
|
+
params: IMaps3DLayerStateParams;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Параметры в снимке слоя. Каждое поле есть только у своего слоя; неизвестные ключи
|
|
105
|
+
* сборки Maps3D проходят через индексную сигнатуру.
|
|
106
|
+
*/
|
|
107
|
+
interface IMaps3DLayerStateParams {
|
|
108
|
+
/** `buildings`: уровень детализации. */
|
|
109
|
+
detail?: Maps3DBuildingDetail;
|
|
110
|
+
/** `indoor`: открытый этаж. */
|
|
111
|
+
level?: number;
|
|
112
|
+
/**
|
|
113
|
+
* `indoor`: этажи, найденные в текущем виде карты; `[]` — данных по зданию нет.
|
|
114
|
+
* Меняется при движении карты и приходит через onLayers(). С 0.11.0, раньше — undefined.
|
|
115
|
+
*/
|
|
116
|
+
levels?: number[];
|
|
117
|
+
/** `terrain`: режим рельефа. */
|
|
118
|
+
mode?: Maps3DTerrainMode;
|
|
119
|
+
[key: string]: unknown;
|
|
102
120
|
}
|
|
103
121
|
interface IMaps3DSelectionStyle {
|
|
104
122
|
color?: string | number;
|
|
@@ -232,12 +250,16 @@ interface IMaps3DBuildingClickInfo {
|
|
|
232
250
|
id: string | number;
|
|
233
251
|
/**
|
|
234
252
|
* Атрибуты объекта; `props.osm_id` — идентификатор, который не меняется.
|
|
235
|
-
* Необязательно:
|
|
253
|
+
* Необязательно: запасные пути держат сборки Maps3D от 0.5.0, где поля может не быть.
|
|
236
254
|
*/
|
|
237
255
|
props?: Record<string, unknown>;
|
|
238
256
|
/** Высота здания в метрах. Необязательно по той же причине, что и `props`. */
|
|
239
257
|
height?: number;
|
|
240
|
-
/**
|
|
258
|
+
/**
|
|
259
|
+
* Порядковый номер внутри сцены. Живёт до ближайшей пересборки геометрии.
|
|
260
|
+
* `>= 0` — объёмный дом сцены, `-1` — дом из слоя стиля (объёма под ним нет).
|
|
261
|
+
* Тот же признак, что selectedBuildingKind(): `'scene'` / `'flat'`.
|
|
262
|
+
*/
|
|
241
263
|
index?: number;
|
|
242
264
|
[key: string]: unknown;
|
|
243
265
|
}
|
|
@@ -247,6 +269,10 @@ interface IMaps3DObjectsLightOptions {
|
|
|
247
269
|
sky?: number;
|
|
248
270
|
exposure?: number;
|
|
249
271
|
}
|
|
272
|
+
/** Чем нарисовано выделение: объёмный дом сцены или слой стиля. С 0.11.0. */
|
|
273
|
+
type Maps3DSelectionKind = "scene" | "flat";
|
|
274
|
+
/** Колбэк подписки Maps3D: `null` вместо функции — отписаться. */
|
|
275
|
+
type Maps3DListener<T> = ((info: T | null) => void) | null;
|
|
250
276
|
interface IMaps3DDiagnostics {
|
|
251
277
|
terrainActive: boolean;
|
|
252
278
|
drapeRefreshes: number;
|
|
@@ -266,18 +292,20 @@ interface IMaps3DLayer {
|
|
|
266
292
|
refreshLayers?(): void;
|
|
267
293
|
buildings?: IMaps3DBuildingsController | null;
|
|
268
294
|
setBuildingsEnabled?(enabled: boolean): void;
|
|
269
|
-
onBuildingClick?(callback:
|
|
295
|
+
onBuildingClick?(callback: Maps3DListener<IMaps3DBuildingClickInfo>): (() => void) | void;
|
|
270
296
|
selectBuilding?(id: number | string | null, style?: IMaps3DSelectionStyle): boolean;
|
|
271
297
|
clearSelection?(): void;
|
|
272
298
|
selectedBuilding?(): number | string | null;
|
|
299
|
+
/** С 0.11.0. */
|
|
300
|
+
selectedBuildingKind?(): Maps3DSelectionKind | null;
|
|
273
301
|
setSelectionStyle?(style: IMaps3DSelectionStyle): void;
|
|
274
|
-
onBuildingHover?(callback: ((
|
|
302
|
+
onBuildingHover?(callback: Maps3DListener<IMaps3DBuildingClickInfo>): (() => void) | void;
|
|
275
303
|
setHoverEnabled?(enabled: boolean): void;
|
|
276
304
|
readonly hoverEnabled?: boolean;
|
|
277
305
|
setHoverStyle?(style: IMaps3DHoverStyle): void;
|
|
278
306
|
hoverBuilding?(id: number | string | null): boolean;
|
|
279
307
|
hoveredBuilding?(): number | string | null;
|
|
280
|
-
onRoadClick?(callback:
|
|
308
|
+
onRoadClick?(callback: Maps3DListener<IMaps3DRoadHit>): (() => void) | void;
|
|
281
309
|
roadAt?(point: {
|
|
282
310
|
x: number;
|
|
283
311
|
y: number;
|
|
@@ -287,13 +315,13 @@ interface IMaps3DLayer {
|
|
|
287
315
|
x: number;
|
|
288
316
|
y: number;
|
|
289
317
|
}, tolerancePx?: number): IMaps3DParkingInfo | null;
|
|
290
|
-
onParkingHover?(callback: ((
|
|
318
|
+
onParkingHover?(callback: Maps3DListener<IMaps3DParkingInfo>): (() => void) | void;
|
|
291
319
|
setParkingHoverStyle?(style: IMaps3DParkingHoverStyle): void;
|
|
292
320
|
setParkingHoverEnabled?(enabled: boolean): void;
|
|
293
321
|
readonly parkingHoverEnabled?: boolean;
|
|
294
322
|
hoverParking?(id: number | string | null): boolean;
|
|
295
323
|
hoveredParking?(): number | string | null;
|
|
296
|
-
onParkingClick?(callback: ((
|
|
324
|
+
onParkingClick?(callback: Maps3DListener<IMaps3DParkingInfo>): (() => void) | void;
|
|
297
325
|
traffic?: boolean;
|
|
298
326
|
trafficRaster?: boolean;
|
|
299
327
|
setTraffic?(enabled: boolean): void;
|
|
@@ -304,6 +332,7 @@ interface IMaps3DLayer {
|
|
|
304
332
|
refreshTraffic?(): void;
|
|
305
333
|
setIndoor?(enabled: boolean): void;
|
|
306
334
|
setIndoorLevel?(level: number): void;
|
|
335
|
+
/** Запасной путь для сборок до 0.11.0 — там этажей нет в `layer("indoor").params.levels`. */
|
|
307
336
|
readonly indoorLevels?: number[];
|
|
308
337
|
refreshIndoor?(): void;
|
|
309
338
|
showPlace?(lon: number, lat: number, level?: number | null, zoom?: number): void;
|
|
@@ -557,14 +586,13 @@ declare class MahalMap {
|
|
|
557
586
|
private maps3dCtor?;
|
|
558
587
|
private maps3dLayer?;
|
|
559
588
|
private maps3dReady?;
|
|
589
|
+
private platformStyle;
|
|
560
590
|
private buildingsEnabled;
|
|
561
591
|
private workerCheckTimer?;
|
|
562
592
|
private styleChangeHandler?;
|
|
563
|
-
private
|
|
564
|
-
private pendingRoadClick?;
|
|
593
|
+
private subscriptions;
|
|
565
594
|
private pendingSelectionStyle?;
|
|
566
595
|
private pendingLayerSubscribers;
|
|
567
|
-
private pendingBuildingHover?;
|
|
568
596
|
private pendingHoverStyle?;
|
|
569
597
|
private pendingHoverEnabled?;
|
|
570
598
|
private constructor();
|
|
@@ -629,27 +657,29 @@ declare class MahalMap {
|
|
|
629
657
|
static setIndoorLevel(instance: MahalMap, level: number): void;
|
|
630
658
|
static refreshIndoor(instance: MahalMap): void;
|
|
631
659
|
static showPlace(instance: MahalMap, lon: number, lat: number, level?: number | null, zoom?: number): void;
|
|
632
|
-
static onBuildingClick(instance: MahalMap, callback:
|
|
660
|
+
static onBuildingClick(instance: MahalMap, callback: Maps3DListener<IMaps3DBuildingClickInfo>): () => void;
|
|
633
661
|
static selectBuilding(instance: MahalMap, id: number | string | null, style?: IMaps3DSelectionStyle): boolean;
|
|
634
662
|
static clearSelection(instance: MahalMap): void;
|
|
635
663
|
static selectedBuilding(instance: MahalMap): string | number | null;
|
|
664
|
+
static selectedBuildingKind(instance: MahalMap): Maps3DSelectionKind | null;
|
|
665
|
+
static getBuildingsMinZoom(instance: MahalMap): number;
|
|
636
666
|
static setSelectionStyle(instance: MahalMap, style: IMaps3DSelectionStyle): void;
|
|
637
|
-
static onRoadClick(instance: MahalMap, callback:
|
|
667
|
+
static onRoadClick(instance: MahalMap, callback: Maps3DListener<IMaps3DRoadHit>): () => void;
|
|
638
668
|
static roadAt(instance: MahalMap, point: {
|
|
639
669
|
x: number;
|
|
640
670
|
y: number;
|
|
641
671
|
}, tolerancePx?: number): IMaps3DRoadHit | null;
|
|
642
|
-
static onParkingHover(instance: MahalMap, callback:
|
|
672
|
+
static onParkingHover(instance: MahalMap, callback: Maps3DListener<IMaps3DParkingInfo>): () => void;
|
|
643
673
|
static setParkingHoverStyle(instance: MahalMap, style: IMaps3DParkingHoverStyle): void;
|
|
644
674
|
static setParkingHoverEnabled(instance: MahalMap, enabled: boolean): void;
|
|
645
675
|
static hoverParking(instance: MahalMap, id: number | string | null): boolean;
|
|
646
676
|
static hoveredParking(instance: MahalMap): string | number | null;
|
|
647
|
-
static onParkingClick(instance: MahalMap, callback:
|
|
677
|
+
static onParkingClick(instance: MahalMap, callback: Maps3DListener<IMaps3DParkingInfo>): () => void;
|
|
648
678
|
static parkingAt(instance: MahalMap, point: {
|
|
649
679
|
x: number;
|
|
650
680
|
y: number;
|
|
651
681
|
}, tolerancePx?: number): IMaps3DParkingInfo | null;
|
|
652
|
-
static onBuildingHover(instance: MahalMap, callback:
|
|
682
|
+
static onBuildingHover(instance: MahalMap, callback: Maps3DListener<IMaps3DBuildingClickInfo>): () => void;
|
|
653
683
|
static setHoverEnabled(instance: MahalMap, enabled: boolean): void;
|
|
654
684
|
static setHoverStyle(instance: MahalMap, style: IMaps3DHoverStyle): void;
|
|
655
685
|
static hoverBuilding(instance: MahalMap, id: number | string | null): boolean;
|
|
@@ -720,7 +750,11 @@ declare class MahalMap {
|
|
|
720
750
|
onLayers(callback: (state: IMaps3DLayerState) => void): () => void;
|
|
721
751
|
/** Пере-применить волю клиента ко всем слоям — после полной смены стиля. */
|
|
722
752
|
refreshLayers(): void;
|
|
723
|
-
/**
|
|
753
|
+
/**
|
|
754
|
+
* Этажи, найденные в текущем виде карты. Пусто — данных по зданию нет.
|
|
755
|
+
* С 0.11.0 они же приходят в onLayers() у слоя `indoor` (`params.levels`) — опрашивать
|
|
756
|
+
* этот метод на движении карты больше не нужно.
|
|
757
|
+
*/
|
|
724
758
|
getIndoorLevels(): number[];
|
|
725
759
|
/** Переключить этаж. Нумерация OSM: 0 — первый наземный. */
|
|
726
760
|
setIndoorLevel(level: number): void;
|
|
@@ -733,21 +767,32 @@ declare class MahalMap {
|
|
|
733
767
|
*/
|
|
734
768
|
showPlace(lon: number, lat: number, level?: number | null, zoom?: number): void;
|
|
735
769
|
/**
|
|
736
|
-
* Клик по зданию: { id, height, props } либо null.
|
|
770
|
+
* Клик по зданию: { id, height, props, index } либо null. `index >= 0` — объёмный дом
|
|
771
|
+
* сцены, `-1` — дом из слоя стиля. Повторный вызов заменяет обработчик, `null` — отписка.
|
|
772
|
+
*
|
|
737
773
|
* Подписываться можно сразу после create(), даже когда слой ещё не поднят
|
|
738
774
|
* (`enable3D: false`) — подписка переиграется, как только слой появится.
|
|
775
|
+
*
|
|
776
|
+
* @returns Отписка. Снимает только эту подписку: если обработчик уже заменён
|
|
777
|
+
* следующим вызовом, ничего не делает.
|
|
739
778
|
*/
|
|
740
|
-
onBuildingClick(callback:
|
|
779
|
+
onBuildingClick(callback: Maps3DListener<IMaps3DBuildingClickInfo>): () => void;
|
|
741
780
|
/** Выделить здание по osm_id. `false` — здания сейчас нет в загруженных данных. */
|
|
742
781
|
selectBuilding(id: number | string | null, style?: IMaps3DSelectionStyle): boolean;
|
|
743
782
|
clearSelection(): void;
|
|
744
783
|
selectedBuilding(): number | string | null;
|
|
784
|
+
/**
|
|
785
|
+
* Чем нарисовано выделение: `'scene'` — объёмный дом сцены, `'flat'` — слой стиля,
|
|
786
|
+
* `null` — выделения нет. На сборке Maps3D до 0.11.0 всегда `null`.
|
|
787
|
+
*/
|
|
788
|
+
selectedBuildingKind(): Maps3DSelectionKind | null;
|
|
745
789
|
setSelectionStyle(style: IMaps3DSelectionStyle): void;
|
|
746
790
|
/**
|
|
747
791
|
* Клик по дороге. Приходит независимо от клика по зданию — приоритет решает приложение.
|
|
748
|
-
* Как и onBuildingClick, переживает отсутствие слоя на момент
|
|
792
|
+
* Как и onBuildingClick, переживает отсутствие слоя на момент подписки, принимает `null`
|
|
793
|
+
* и возвращает отписку.
|
|
749
794
|
*/
|
|
750
|
-
onRoadClick(callback:
|
|
795
|
+
onRoadClick(callback: Maps3DListener<IMaps3DRoadHit>): () => void;
|
|
751
796
|
/** Дорога под точкой холста. Допуск по умолчанию — 12 px. */
|
|
752
797
|
roadAt(point: {
|
|
753
798
|
x: number;
|
|
@@ -758,8 +803,9 @@ declare class MahalMap {
|
|
|
758
803
|
/**
|
|
759
804
|
* Участок под курсором либо null. Зовётся ТОЛЬКО при смене участка, не на каждое
|
|
760
805
|
* движение мыши. `null` вместо колбэка — отписаться и погасить подсветку.
|
|
806
|
+
* Переживает отсутствие слоя на момент подписки; возвращает отписку.
|
|
761
807
|
*/
|
|
762
|
-
onParkingHover(callback:
|
|
808
|
+
onParkingHover(callback: Maps3DListener<IMaps3DParkingInfo>): () => void;
|
|
763
809
|
/** Облик подсветки: color, opacity, outlineColor, outlineWidth, cursor. */
|
|
764
810
|
setParkingHoverStyle(style: IMaps3DParkingHoverStyle): void;
|
|
765
811
|
/** Вкл/выкл наведение, не теряя подписку. */
|
|
@@ -770,8 +816,11 @@ declare class MahalMap {
|
|
|
770
816
|
hoverParking(id: number | string | null): boolean;
|
|
771
817
|
/** `osm_id` подсвеченного участка или null. */
|
|
772
818
|
hoveredParking(): number | string | null;
|
|
773
|
-
/**
|
|
774
|
-
|
|
819
|
+
/**
|
|
820
|
+
* Клик по участку: справка либо null. `null` вместо колбэка — отписаться.
|
|
821
|
+
* Переживает отсутствие слоя на момент подписки; возвращает отписку.
|
|
822
|
+
*/
|
|
823
|
+
onParkingClick(callback: Maps3DListener<IMaps3DParkingInfo>): () => void;
|
|
775
824
|
/**
|
|
776
825
|
* Парковка под точкой холста (`e.point` события карты). Попадание — по границе полигона;
|
|
777
826
|
* допуск по умолчанию 0 — строго внутрь участка.
|
|
@@ -786,8 +835,10 @@ declare class MahalMap {
|
|
|
786
835
|
*
|
|
787
836
|
* Слежение за мышью включается самой подпиской: без неё SDK курсор не трогает и
|
|
788
837
|
* разбор сцены не делает.
|
|
838
|
+
*
|
|
839
|
+
* @returns Отписка; снимает только эту подписку.
|
|
789
840
|
*/
|
|
790
|
-
onBuildingHover(callback:
|
|
841
|
+
onBuildingHover(callback: Maps3DListener<IMaps3DBuildingClickInfo>): () => void;
|
|
791
842
|
/**
|
|
792
843
|
* Включить/выключить наведение, не трогая подписку. Нужно там, где подсветка мешает:
|
|
793
844
|
* режим рисования, открытая карточка объекта, тач-устройство без курсора.
|
|
@@ -808,6 +859,24 @@ declare class MahalMap {
|
|
|
808
859
|
hoverBuilding(id: number | string | null): boolean;
|
|
809
860
|
/** Идентификатор дома под наведением или `null`. */
|
|
810
861
|
hoveredBuilding(): number | string | null;
|
|
862
|
+
/**
|
|
863
|
+
* Зум, с которого поднимается объём: `maps3d.minZoom` из опций create() — ровно то, что
|
|
864
|
+
* уходит в Maps3D, — либо умолчание самой Maps3D (16). Ответ не зависит от текущего
|
|
865
|
+
* зума, в отличие от `rendered` в состоянии слоя.
|
|
866
|
+
*/
|
|
867
|
+
getBuildingsMinZoom(): number;
|
|
868
|
+
/**
|
|
869
|
+
* Занимает слот подписки. Запись живёт до подъёма слоя и переигрывается на нём;
|
|
870
|
+
* отписка снимает слот, только если он всё ещё её.
|
|
871
|
+
*
|
|
872
|
+
* Прежнюю подписку при замене со слоя не снимаем: у Maps3D каждый из этих методов —
|
|
873
|
+
* один слот, и новый вызов сам снимает старый обработчик (и в 0.11.0, и раньше).
|
|
874
|
+
* Явная отписка перед заменой у наведения выключала бы и тут же включала слежение.
|
|
875
|
+
*/
|
|
876
|
+
private subscribe;
|
|
877
|
+
private bindSubscription;
|
|
878
|
+
/** Снимает подписку со слоя: её же отпиской, а у сборок до 0.11.0 — через null. */
|
|
879
|
+
private unbindSubscription;
|
|
811
880
|
/**
|
|
812
881
|
* Создаёт слой Maps3D. `buildings` не форсируем в `true`: с 0.7.x видимостью объёма
|
|
813
882
|
* заведует реестр слоёв, а опции облика зданий приходят из options.maps3d как есть.
|
|
@@ -867,8 +936,17 @@ declare const getApiKey: () => string;
|
|
|
867
936
|
|
|
868
937
|
declare function Router(param: number[][], typeData: string, token: string): Promise<IRoute[]>;
|
|
869
938
|
|
|
939
|
+
type SearchFn = (param: string, token: string, additionalParam?: IAdditionalParamType) => Promise<ISearchResponse[]>;
|
|
940
|
+
/**
|
|
941
|
+
* Поиск адресов. Каждый вызов — свой запрос: статический метод зовут разные поля ввода,
|
|
942
|
+
* и общий на всех debounce отменял бы запрос одного поля вызовом из другого.
|
|
943
|
+
* Дебаунс на поле ввода — createSearch().
|
|
944
|
+
*/
|
|
870
945
|
declare function Search(param: string, token: string, additionalParam?: IAdditionalParamType): Promise<ISearchResponse[]>;
|
|
946
|
+
/** Поиск POI. Без дебаунса, как и Search; дебаунс на поле ввода — createSearchPoi(). */
|
|
871
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;
|
|
872
950
|
/**
|
|
873
951
|
* Обратный геокодинг. В отличие от Search/SearchPoi возвращает тело ответа целиком:
|
|
874
952
|
* `{ success, data: ISearchResponse[], message }` — объекты рядом с точкой, по `distance`.
|
|
@@ -882,10 +960,12 @@ declare const index$2_Search: typeof Search;
|
|
|
882
960
|
declare const index$2_SearchByLocation: typeof SearchByLocation;
|
|
883
961
|
declare const index$2_SearchPoi: typeof SearchPoi;
|
|
884
962
|
declare const index$2_clearKey: typeof clearKey;
|
|
963
|
+
declare const index$2_createSearch: typeof createSearch;
|
|
964
|
+
declare const index$2_createSearchPoi: typeof createSearchPoi;
|
|
885
965
|
declare const index$2_getApiKey: typeof getApiKey;
|
|
886
966
|
declare const index$2_saveKey: typeof saveKey;
|
|
887
967
|
declare namespace index$2 {
|
|
888
|
-
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 };
|
|
889
969
|
}
|
|
890
970
|
|
|
891
971
|
declare class MahalMapDefaultMarker {
|
|
@@ -1113,7 +1193,28 @@ declare function checkCoordinates(coordinates: string): {
|
|
|
1113
1193
|
lng: string | undefined;
|
|
1114
1194
|
} | null;
|
|
1115
1195
|
|
|
1116
|
-
|
|
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>>>;
|
|
1117
1218
|
|
|
1118
1219
|
declare function geojsonPolyline(encoded: string): number[][];
|
|
1119
1220
|
|
|
@@ -1121,13 +1222,16 @@ declare function geometryPolyline(coordinates: number[][]): string;
|
|
|
1121
1222
|
|
|
1122
1223
|
declare function trimValue(value: string, cut: number): string;
|
|
1123
1224
|
|
|
1225
|
+
type index_DebounceCancelledError = DebounceCancelledError;
|
|
1226
|
+
declare const index_DebounceCancelledError: typeof DebounceCancelledError;
|
|
1227
|
+
type index_IDebounceOptions = IDebounceOptions;
|
|
1124
1228
|
declare const index_checkCoordinates: typeof checkCoordinates;
|
|
1125
1229
|
declare const index_debounce: typeof debounce;
|
|
1126
1230
|
declare const index_geojsonPolyline: typeof geojsonPolyline;
|
|
1127
1231
|
declare const index_geometryPolyline: typeof geometryPolyline;
|
|
1128
1232
|
declare const index_trimValue: typeof trimValue;
|
|
1129
1233
|
declare namespace index {
|
|
1130
|
-
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 };
|
|
1131
1235
|
}
|
|
1132
1236
|
|
|
1133
|
-
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 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 Maps3DParkingSubtype, 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 };
|