@evergis/react 4.0.140 → 4.0.142

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.140",
2
+ "version": "4.0.142",
3
3
  "name": "@evergis/react",
4
4
  "author": "Everpoint",
5
5
  "license": "MIT",
@@ -89,5 +89,5 @@
89
89
  "uuid": "^13.0.0",
90
90
  "wkt": "^0.1.1"
91
91
  },
92
- "gitHead": "77bd4023802135ed14ce1f53df87582abf411820"
92
+ "gitHead": "2bf9c8c0da637eead51956a2f8c35c7901759162"
93
93
  }
@@ -1,52 +0,0 @@
1
- import { ClientStyle } from '../../types';
2
- export interface LayerIconConfig {
3
- /** Идентификатор слоя */
4
- layerId: string;
5
- /** Конфигурация стиля слоя */
6
- clientStyle?: ClientStyle;
7
- }
8
- export interface UseIconsFromLayersOptions {
9
- /** Массив конфигураций слоёв */
10
- layers: LayerIconConfig[];
11
- /** Базовый URL для иконок по умолчанию (если не указан в clientStyle.icons) */
12
- baseUrl?: string;
13
- /** Расширение файлов иконок по умолчанию */
14
- defaultExtension?: string;
15
- }
16
- export interface UseIconsFromLayersResult {
17
- /** Загружены ли все иконки */
18
- loaded: boolean;
19
- /** Ошибки загрузки (имя иконки -> сообщение об ошибке) */
20
- errors: Record<string, string>;
21
- /** Массив имён иконок, которые были запрошены */
22
- requestedIcons: string[];
23
- }
24
- /**
25
- * Хук для автоматической загрузки иконок из clientStyle слоёв.
26
- *
27
- * Парсит все icon-image выражения из clientStyle.items и загружает
28
- * соответствующие иконки из clientStyle.icons или по конвенции baseUrl.
29
- *
30
- * @example
31
- * ```tsx
32
- * const layers = [
33
- * {
34
- * layerId: 'parking',
35
- * clientStyle: {
36
- * icons: [
37
- * { name: 'parking-icon', url: '/icons/parking.svg', sdf: true }
38
- * ],
39
- * items: [{
40
- * type: 'symbol',
41
- * layout: { 'icon-image': 'parking-icon' }
42
- * }]
43
- * }
44
- * }
45
- * ];
46
- *
47
- * const { loaded, errors } = useIconsFromLayers({ layers });
48
- *
49
- * if (!loaded) return <Loading />;
50
- * ```
51
- */
52
- export declare const useIconsFromLayers: ({ layers, baseUrl, defaultExtension, }: UseIconsFromLayersOptions) => UseIconsFromLayersResult;