@nextgis/ngw-connector 3.0.0-alpha.7 → 3.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/lib/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  import { Routes } from '@nextgisweb/pyramid/type/route';
2
- import { EventEmitter } from 'events';
2
+ import { CompositeRead, ResourceRead } from '@nextgisweb/resource/type/api';
3
3
  import Cache from '@nextgis/cache';
4
+ import { EventEmitter } from 'events';
4
5
  import { FeatureProperties, DeepPartial } from '@nextgis/utils';
6
+ import { LegendSymbol } from '@nextgisweb/render/type/api';
5
7
  import { GeoJsonObject, Geometry } from 'geojson';
8
+ import { LegendSymbolsEnum } from '@nextgisweb/webmap/type/api';
6
9
 
7
10
  declare class LunkwillParam {
8
11
  static VALUES: (string | null)[];
@@ -18,10 +21,14 @@ type RouteParameters = {
18
21
  [K in keyof Routes]: Routes[K]['pathArr'] | [Routes[K]['pathObj']];
19
22
  };
20
23
  type RouteName = keyof Routes;
24
+ type GetRouteParam<R extends RouteName> = (RouteParameters[R] & [
25
+ object
26
+ ])[0];
21
27
  type RequestMethod = keyof RouteMethods<RouteName>;
22
28
  type Method = RequestMethod | Uppercase<RequestMethod>;
29
+ type CompositeFor<K extends keyof CompositeRead> = CompositeRead & Required<Pick<CompositeRead, K>>;
23
30
  type ResponseType = 'blob' | 'json';
24
- interface RequestOptions$1<RT extends ResponseType = 'json', ReturnUrl extends boolean = false, Q = any, B = string | null | boolean | Record<string, any> | any[]> extends Omit<RequestInit, 'cache'> {
31
+ interface RouteRequestOptions<RT extends ResponseType = 'json', ReturnUrl extends boolean = false, Q = any, B = string | null | boolean | Record<string, any> | any[]> extends Omit<RequestInit, 'cache'> {
25
32
  headers?: Record<string, string>;
26
33
  cache?: boolean;
27
34
  query?: Q;
@@ -50,29 +57,34 @@ interface RequestOptions$1<RT extends ResponseType = 'json', ReturnUrl extends b
50
57
  lunkwill?: LunkwillParam;
51
58
  lunkwillReturnUrl?: ReturnUrl;
52
59
  }
53
- interface GetRequestOptions<Q = any, RT extends ResponseType = 'json', ReturnUrl extends boolean = false> extends Omit<RequestOptions$1<RT, ReturnUrl, Q>, 'json' | 'body'> {
60
+ interface GetRequestOptions<Q = any, RT extends ResponseType = 'json', ReturnUrl extends boolean = false> extends Omit<RouteRequestOptions<RT, ReturnUrl, Q>, 'json' | 'body'> {
54
61
  method?: 'GET';
55
62
  }
56
- interface RequestOptionsJSON<Q = any, B = string | null | boolean | Record<string, any> | any[], RT extends ResponseType = 'json', M extends Method = Method> extends Omit<RequestOptions$1<RT, false, Q, B>, 'json' | 'body'> {
63
+ interface RequestOptionsJSON<Q = any, B = string | null | boolean | Record<string, any> | any[], RT extends ResponseType = 'json', M extends Method = Method> extends Omit<RouteRequestOptions<RT, false, Q, B>, 'json' | 'body'> {
57
64
  json: B;
58
65
  method?: M;
59
66
  }
60
- interface RequestOptionsBody<Q = any, RT extends ResponseType = 'json', M extends Method = Method> extends Omit<RequestOptions$1<RT, false, Q>, 'json' | 'body'> {
67
+ interface RequestOptionsBody<Q = any, RT extends ResponseType = 'json', M extends Method = Method> extends Omit<RouteRequestOptions<RT, false, Q>, 'json' | 'body'> {
61
68
  body: string;
62
69
  method?: M;
63
70
  }
64
71
  type PutRequestOptions<Q = any, B = any, RT extends ResponseType = 'json'> = RequestOptionsJSON<Q, B, RT, 'PUT'> | RequestOptionsBody<Q, RT, 'PUT'>;
65
72
  type PostRequestOptions<Q = any, B = any, RT extends ResponseType = 'json'> = RequestOptionsJSON<Q, B, RT, 'POST'> | RequestOptionsBody<Q, RT, 'POST'>;
66
73
  type PatchRequestOptions<Q = any, B = any, RT extends ResponseType = 'json'> = RequestOptionsJSON<Q, B, RT, 'PATCH'> | RequestOptionsBody<Q, RT, 'PATCH'>;
67
- type DeleteRequestOptions<Q = any, RT extends ResponseType = 'json'> = RequestOptions$1<RT, false, Q>;
68
- interface RouteRequestOptions<Q = any, B = any, RT extends ResponseType = 'json', ReturnUrl extends boolean = false> {
74
+ type DeleteRequestOptions<Q = any, RT extends ResponseType = 'json'> = RouteRequestOptions<RT, false, Q>;
75
+ interface MethodRequestOptions<Q = any, B = any, RT extends ResponseType = 'json', ReturnUrl extends boolean = false> {
69
76
  get: GetRequestOptions<Q, RT, ReturnUrl>;
70
77
  post: PostRequestOptions<Q, B, RT>;
71
78
  put: PutRequestOptions<Q, B, RT>;
72
79
  patch: PatchRequestOptions<Q, RT>;
73
80
  delete: DeleteRequestOptions<Q, RT>;
74
81
  }
75
- type RequestOptionsByMethod<M extends RequestMethod, Q = any, B = any, RT extends ResponseType = 'json', ReturnUrl extends boolean = false> = M extends keyof RouteRequestOptions ? RouteRequestOptions<Q, B, RT, ReturnUrl>[M] : never;
82
+ type RequestOptionsByMethod<M extends RequestMethod, Q = any, B = any, RT extends ResponseType = 'json', ReturnUrl extends boolean = false> = M extends keyof MethodRequestOptions ? MethodRequestOptions<Q, B, RT, ReturnUrl>[M] : never;
83
+ type ApiRouteParams = Record<string, string>;
84
+ interface LunkwillData {
85
+ status?: string;
86
+ delay_ms?: number;
87
+ }
76
88
  type RouteResp<N extends RouteName, M extends RequestMethod> = N extends keyof Routes ? M extends keyof Routes[N] ? 'response' extends keyof Routes[N][M] ? Routes[N][M]['response'] : never : never : never;
77
89
  type RouteQuery<N extends RouteName, M extends RequestMethod> = N extends keyof Routes ? M extends keyof Routes[N] ? 'query' extends keyof Routes[N][M] ? Routes[N][M]['query'] : any : never : never;
78
90
  type RouteBody<N extends RouteName, M extends RequestMethod> = N extends keyof Routes ? M extends keyof Routes[N] ? 'body' extends keyof Routes[N][M] ? Routes[N][M]['body'] : any : never : never;
@@ -92,6 +104,20 @@ type MethodAvailable<N extends RouteName, M extends RequestMethod> = M extends '
92
104
  type RouteResults<N extends RouteName> = {
93
105
  [M in keyof RouteMethods<any>]: MethodAvailable<N, M>;
94
106
  };
107
+ type KeysWithMethods<Methods extends RequestMethod[]> = {
108
+ [K in keyof Routes]: Methods extends (keyof Routes[K])[] ? K : never;
109
+ }[keyof Routes];
110
+ type PathKeys = any;
111
+ type KeysWithPaths<P extends PathKeys> = {
112
+ [K in keyof Routes]: P extends Array<keyof Routes[K]['pathObj']> ? K : never;
113
+ }[keyof Routes];
114
+ type KeysWithMethodAndPath<M extends RequestMethod[], P extends PathKeys> = {
115
+ [K in keyof Routes]: K extends KeysWithMethods<M> ? K extends KeysWithPaths<P> ? K : never : never;
116
+ }[keyof Routes];
117
+
118
+ declare class AbortError extends Error {
119
+ constructor(message?: string);
120
+ }
95
121
 
96
122
  interface NgwLayerIdentifyError {
97
123
  error: 'Not implemented';
@@ -132,49 +158,6 @@ interface FeatureItem<F = FeatureProperties, G extends Geometry | string = Geome
132
158
  }
133
159
  type FeatureItemToNgw<F = FeatureProperties, G extends Geometry | string = Geometry> = FeatureItem<F, G>;
134
160
 
135
- /**
136
- * Represents an item in a legend, with additional rendering and indexing information.
137
- */
138
- interface LegendItem {
139
- /**
140
- * The index of the legend item.
141
- */
142
- index: number;
143
- /**
144
- * A flag indicating whether this legend item should be rendered.
145
- */
146
- render: boolean | null;
147
- /**
148
- * The display name of the legend item.
149
- */
150
- display_name: string;
151
- /**
152
- * The symbol associated with this legend item.
153
- */
154
- icon: LegendItemSymbol;
155
- }
156
- /**
157
- * Represents a symbol in a legend item.
158
- */
159
- interface LegendItemSymbol {
160
- /**
161
- * The format of the symbol, e.g., 'svg', 'png'.
162
- */
163
- format: string;
164
- /**
165
- * The actual data of the symbol in a specified format.
166
- * This could be a base64 encoded string, SVG path, etc.
167
- */
168
- data: string;
169
- }
170
- /**
171
- * Represents a legend for a specific layer.
172
- */
173
- interface LayerLegend {
174
- layerId: string;
175
- legend: LegendItem[];
176
- }
177
-
178
161
  interface RequestItemsParamsMap {
179
162
  'pyramid.static': {
180
163
  skey: number;
@@ -608,6 +591,7 @@ interface Permission {
608
591
  permission: string;
609
592
  propagate: boolean;
610
593
  }
594
+ /** @deprecated use ResourceCls from '@nextgisweb/resource/type/api' instead */
611
595
  type ResourceCls = 'resource_group' | 'postgis_layer' | 'wmsserver_service' | 'basemap_layer' | 'postgis_connection' | 'webmap' | 'wfsserver_service' | 'vector_layer' | 'raster_layer' | 'mapserver_style' | 'qgis_vector_style' | 'qgis_raster_style' | 'raster_style' | 'file_bucket' | 'lookup_table' | 'wmsclient_layer' | 'wmsclient_connection' | 'formbuilder_form' | 'file_bucket' | 'svg_marker_library' | 'ogcfserver_service' | 'tmsclient_connection' | 'tileset' | 'collector_project' | 'demo_project' | 'trackers_group' | 'tracker' | 'terrain_provider' | 'model_3d' | 'tmsclient_layer';
612
596
  interface ResourceHierarchy {
613
597
  id: number;
@@ -615,6 +599,7 @@ interface ResourceHierarchy {
615
599
  id: any;
616
600
  };
617
601
  }
602
+ /** @deprecated use ResourceRead from '@nextgisweb/resource/type/api' instead */
618
603
  interface Resource {
619
604
  cls: ResourceCls;
620
605
  id: number;
@@ -647,6 +632,7 @@ interface NgwTimeFormat {
647
632
  second: number;
648
633
  }
649
634
  type NgwDateTimeFormat = NgwDateFormat & NgwTimeFormat;
635
+ /** @deprecated use WebMapRead from '@nextgisweb/resource/type/api' instead */
650
636
  interface WebmapResource {
651
637
  extent_left: number;
652
638
  extent_right: number;
@@ -664,6 +650,7 @@ interface BasemapResource {
664
650
  */
665
651
  qms: string;
666
652
  }
653
+ /** @deprecated use BasemapWebMapItemRead from '@nextgisweb/resource/type/api' instead */
667
654
  interface BasemapWebmapItem {
668
655
  resource_id: number;
669
656
  display_name: string;
@@ -671,6 +658,7 @@ interface BasemapWebmapItem {
671
658
  enabled?: boolean;
672
659
  opacity?: number;
673
660
  }
661
+ /** @deprecated use BasemapWebMapRead from '@nextgisweb/resource/type/api' instead */
674
662
  interface BasemapWebmap {
675
663
  basemaps: BasemapWebmapItem[];
676
664
  }
@@ -689,10 +677,12 @@ interface FeatureLayerField {
689
677
  label_field: boolean;
690
678
  typemod?: unknown;
691
679
  }
680
+ /** @deprecated use FeatureLayerRead from '@nextgisweb/resource/type/api' instead */
692
681
  interface FeatureResource {
693
682
  fields: FeatureLayerField[];
694
683
  }
695
684
  type GeometryType = 'POINT' | 'LINESTRING' | 'POLYGON' | 'MULTIPOINT' | 'MULTILINESTRING' | 'MULTIPOLYGON' | 'POINTZ' | 'LINESTRINGZ' | 'POLYGONZ' | 'MULTIPOINTZ' | 'MULTILINESTRINGZ' | 'MULTIPOLYGONZ';
685
+ /** @deprecated use VectorLayerRead from '@nextgisweb/resource/type/api' instead */
696
686
  interface VectorLayer {
697
687
  srs: {
698
688
  id: number;
@@ -775,6 +765,7 @@ interface ResourceItemMain {
775
765
  resource: Resource;
776
766
  resmeta: Resmeta;
777
767
  }
768
+ /** @deprecated use CompositeRead from '@nextgisweb/resource/type/api' instead */
778
769
  interface ResourceItem extends ResourceItemMain {
779
770
  [cls: string]: any;
780
771
  webmap?: WebmapResource;
@@ -830,7 +821,7 @@ interface FeatureLayerCount {
830
821
  total_count: number;
831
822
  }
832
823
  type ResourceIdKeynameDef = string | number;
833
- type ResourceDefinition = ResourceIdKeynameDef | DeepPartial<Resource>;
824
+ type ResourceDefinition = ResourceIdKeynameDef | DeepPartial<ResourceRead>;
834
825
  interface FileUploadResp {
835
826
  upload_meta: FileMeta[];
836
827
  }
@@ -865,10 +856,10 @@ interface RequestItemsResponseMap {
865
856
  interface GetRequestItemsResponseMap extends RequestItemKeys {
866
857
  'pyramid.route': PyramidRoute;
867
858
  'pyramid.settings': PyramidSettings;
868
- 'resource.item': ResourceItem;
869
- 'resource.search': ResourceItem[];
859
+ 'resource.item': CompositeRead;
860
+ 'resource.search': CompositeRead[];
870
861
  'resource.child': any;
871
- 'resource.collection': ResourceItem[];
862
+ 'resource.collection': CompositeRead[];
872
863
  'file_upload.upload': FileUploadResp;
873
864
  'layer.extent': NgwExtent;
874
865
  'feature_layer.feature.item': FeatureItem;
@@ -879,7 +870,7 @@ interface GetRequestItemsResponseMap extends RequestItemKeys {
879
870
  'feature_layer.feature.count': FeatureLayerCount;
880
871
  'pyramid.company_logo': string;
881
872
  'spatial_ref_sys.collection': SrsItem[];
882
- 'render.legend_symbols': LegendItem[];
873
+ 'render.legend_symbols': LegendSymbol[];
883
874
  }
884
875
  interface IdOnly {
885
876
  id: number;
@@ -961,7 +952,7 @@ type RequestMethods = 'POST' | 'GET' | 'PATCH' | 'DELETE' | 'PUT';
961
952
  type NgwExceptions = 'nextgisweb.resource.exception.ResourceNotFound' | 'nextgisweb.core.exception.InsufficientPermissions';
962
953
  interface BaseRequestOptions {
963
954
  cache?: boolean;
964
- signal?: AbortSignal;
955
+ signal?: AbortSignal | null;
965
956
  }
966
957
  /**
967
958
  * Options for configuring requests to NGW.
@@ -1003,7 +994,7 @@ interface RequestOptions<M extends RequestMethods = RequestMethods, K extends ke
1003
994
  /**
1004
995
  * Signal object that allows you to communicate with a DOM request (such as fetch) and abort it if desired via an AbortController.
1005
996
  */
1006
- signal?: AbortSignal;
997
+ signal?: AbortSignal | null;
1007
998
  /**
1008
999
  * Parameters to be included in the request URL.
1009
1000
  */
@@ -1063,6 +1054,47 @@ declare class NgwError extends Error {
1063
1054
  constructor(er?: Partial<NgwError>);
1064
1055
  }
1065
1056
 
1057
+ /**
1058
+ * Thrown when ...
1059
+ */
1060
+ declare class NetworksResponseError extends NgwError {
1061
+ message: string;
1062
+ title: string;
1063
+ detail: string;
1064
+ constructor(obj?: Partial<NetworksResponseError>);
1065
+ }
1066
+
1067
+ declare function extractError(error: unknown): NetworksResponseError | {
1068
+ title: any;
1069
+ message: any;
1070
+ detail: any;
1071
+ data: any;
1072
+ } | {
1073
+ title: string;
1074
+ message: string;
1075
+ detail?: undefined;
1076
+ data?: undefined;
1077
+ } | undefined;
1078
+
1079
+ /**
1080
+ * Thrown when ...
1081
+ */
1082
+ declare class InsufficientPermissionsError extends NgwError {
1083
+ name: string;
1084
+ exception: NgwExceptions;
1085
+ constructor(obj: InsufficientPermissionsError);
1086
+ }
1087
+
1088
+ declare function isError(error: unknown): error is Error;
1089
+
1090
+ /**
1091
+ * Thrown when...
1092
+ */
1093
+ declare class NetworkError extends Error {
1094
+ name: string;
1095
+ constructor(url: string);
1096
+ }
1097
+
1066
1098
  /**
1067
1099
  * Thrown when ...
1068
1100
  */
@@ -1072,17 +1104,42 @@ declare class ResourceNotFoundError extends NgwError {
1072
1104
  constructor(obj?: ResourceNotFoundError);
1073
1105
  }
1074
1106
 
1107
+ type errors_AbortError = AbortError;
1108
+ declare const errors_AbortError: typeof AbortError;
1109
+ type errors_InsufficientPermissionsError = InsufficientPermissionsError;
1110
+ declare const errors_InsufficientPermissionsError: typeof InsufficientPermissionsError;
1111
+ type errors_NetworkError = NetworkError;
1112
+ declare const errors_NetworkError: typeof NetworkError;
1113
+ type errors_NetworksResponseError = NetworksResponseError;
1114
+ declare const errors_NetworksResponseError: typeof NetworksResponseError;
1115
+ type errors_NgwError = NgwError;
1116
+ declare const errors_NgwError: typeof NgwError;
1117
+ type errors_ResourceNotFoundError = ResourceNotFoundError;
1118
+ declare const errors_ResourceNotFoundError: typeof ResourceNotFoundError;
1119
+ declare const errors_extractError: typeof extractError;
1120
+ declare const errors_isError: typeof isError;
1121
+ declare namespace errors {
1122
+ export {
1123
+ errors_AbortError as AbortError,
1124
+ errors_InsufficientPermissionsError as InsufficientPermissionsError,
1125
+ errors_NetworkError as NetworkError,
1126
+ errors_NetworksResponseError as NetworksResponseError,
1127
+ errors_NgwError as NgwError,
1128
+ errors_ResourceNotFoundError as ResourceNotFoundError,
1129
+ errors_extractError as extractError,
1130
+ errors_isError as isError,
1131
+ };
1132
+ }
1133
+
1075
1134
  declare class NgwConnector {
1076
1135
  options: NgwConnectorOptions;
1077
- static errors: {
1078
- NgwError: typeof NgwError;
1079
- ResourceNotFoundError: typeof ResourceNotFoundError;
1080
- };
1136
+ static errors: typeof errors;
1081
1137
  id: number;
1082
1138
  emitter: EventEmitter<[never]>;
1083
1139
  user?: UserInfo;
1084
1140
  cache: Cache;
1085
1141
  withCredentials?: boolean;
1142
+ private readonly routeCache;
1086
1143
  private client;
1087
1144
  private routeStr;
1088
1145
  private activeRequests;
@@ -1112,7 +1169,7 @@ declare class NgwConnector {
1112
1169
  * .catch((er) => console.log('Connection problem', er));
1113
1170
  * ```
1114
1171
  */
1115
- connect(): Promise<PyramidRoute>;
1172
+ connect({ signal, }?: Pick<RequestOptions, 'signal'>): Promise<PyramidRoute>;
1116
1173
  /**
1117
1174
  * Quick way to change NextGIS Web user.
1118
1175
  * @param credentials - New user credentials
@@ -1131,7 +1188,7 @@ declare class NgwConnector {
1131
1188
  /** Stop all api requests */
1132
1189
  abort(): void;
1133
1190
  getActiveApiRequests(): {
1134
- [x: number]: AbortController;
1191
+ [requestId: number]: AbortController;
1135
1192
  };
1136
1193
  route<N extends RouteName>(name: N, ...rest: RouteParameters[N]): RouteResults<N>;
1137
1194
  /**
@@ -1148,7 +1205,7 @@ declare class NgwConnector {
1148
1205
  }
1149
1206
 
1150
1207
  declare class ResourcesControl {
1151
- cache: Cache<Promise<ResourceItem | undefined>, {
1208
+ cache: Cache<Promise<CompositeRead | undefined>, {
1152
1209
  id?: number | string;
1153
1210
  }>;
1154
1211
  connector: NgwConnectorExtended;
@@ -1163,8 +1220,8 @@ declare class ResourcesControl {
1163
1220
  * @remarks
1164
1221
  * Fetching resource would be cached to speed up next call
1165
1222
  */
1166
- getOne(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1167
- getOneOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem>;
1223
+ getOne(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead | undefined>;
1224
+ getOneOrFail(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead>;
1168
1225
  /**
1169
1226
  * A fast way to retrieve resource ID for any resource definition.
1170
1227
  * @param resource - Any available resource definition
@@ -1175,7 +1232,7 @@ declare class ResourcesControl {
1175
1232
  * then this method will come in handy to facilitate the extraction of the identifier
1176
1233
  * if the resource is specified through a keyname or other parameters.
1177
1234
  */
1178
- getId(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number | undefined>;
1235
+ getId(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<number | undefined>;
1179
1236
  /**
1180
1237
  * A fast way to retrieve resource ID for any resource definition.
1181
1238
  * @param resource - Any available resource definition
@@ -1184,11 +1241,11 @@ declare class ResourcesControl {
1184
1241
  * Similar with {@link NgwConnector.getResourceId | getResourceId} but rise error if resource is not exist.
1185
1242
  * To not make one more checks if the resource is definitely exists
1186
1243
  */
1187
- getIdOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number>;
1188
- getMany(resource: DeepPartial<Resource>, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem[]>;
1189
- getParent(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1190
- getChildrenOf(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<ResourceItem[]>;
1191
- update(resource: ResourceDefinition, data: DeepPartial<ResourceItem>): Promise<ResourceItem | undefined>;
1244
+ getIdOrFail(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<number>;
1245
+ getMany(resource: DeepPartial<ResourceRead>, requestOptions?: GetRequestOptions): Promise<CompositeRead[]>;
1246
+ getParent(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead | undefined>;
1247
+ getChildrenOf(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<CompositeRead[]>;
1248
+ update(resource: ResourceDefinition, data: DeepPartial<CompositeRead>): Promise<CompositeRead | undefined>;
1192
1249
  /**
1193
1250
  * Fast way to delete resource from NGW and clean cache.
1194
1251
  * @param resource - Resource definition
@@ -1284,51 +1341,63 @@ declare class NgwConnectorExtended extends NgwConnector {
1284
1341
  /**
1285
1342
  * {@link ResourcesControl.getOne}
1286
1343
  */
1287
- getResource(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1344
+ getResource(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead | undefined>;
1288
1345
  /**
1289
1346
  * {@link ResourcesControl.getOneOrFail}
1290
1347
  */
1291
- getResourceOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem>;
1348
+ getResourceOrFail(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead>;
1292
1349
  /**
1293
1350
  * @deprecated - use {@link getResource}
1294
1351
  */
1295
- getResourceBy(resource: DeepPartial<Resource>): Promise<ResourceItem | undefined>;
1352
+ getResourceBy(resource: DeepPartial<ResourceRead>): Promise<CompositeRead | undefined>;
1296
1353
  /**
1297
1354
  * @deprecated - use {@link getResource}
1298
1355
  */
1299
- getResourceByKeyname(keyname: string): Promise<ResourceItem | undefined>;
1356
+ getResourceByKeyname(keyname: string): Promise<CompositeRead | undefined>;
1300
1357
  /**
1301
1358
  * @deprecated - use {@link getResource}
1302
1359
  */
1303
- getResourceById(id: number): Promise<ResourceItem | undefined>;
1360
+ getResourceById(id: number): Promise<CompositeRead | undefined>;
1304
1361
  /**
1305
1362
  * {@link ResourcesControl.getId}
1306
1363
  */
1307
- getResourceId(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number | undefined>;
1364
+ getResourceId(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<number | undefined>;
1308
1365
  /**
1309
1366
  * {@link ResourcesControl.getIdOrFail}
1310
1367
  */
1311
- getResourceIdOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number>;
1368
+ getResourceIdOrFail(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<number>;
1312
1369
  /**
1313
1370
  * {@link ResourcesControl.getMany}
1314
1371
  */
1315
- getResourcesBy(resource: DeepPartial<Resource>, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem[]>;
1372
+ getResourcesBy(resource: DeepPartial<ResourceRead>, requestOptions?: GetRequestOptions): Promise<CompositeRead[]>;
1316
1373
  /**
1317
1374
  * {@link ResourcesControl.getParent}
1318
1375
  */
1319
- getResourceParent(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1376
+ getResourceParent(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead | undefined>;
1320
1377
  /**
1321
1378
  * {@link ResourcesControl.getChildrenOf}
1322
1379
  */
1323
- getResourceChildren(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<ResourceItem[]>;
1380
+ getResourceChildren(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<CompositeRead[]>;
1324
1381
  /**
1325
1382
  * {@link ResourcesControl.update}
1326
1383
  */
1327
- updateResource(resource: ResourceIdKeynameDef, data: DeepPartial<ResourceItem>): Promise<ResourceItem | undefined>;
1384
+ updateResource(resource: ResourceIdKeynameDef, data: DeepPartial<CompositeRead>): Promise<CompositeRead | undefined>;
1328
1385
  /**
1329
1386
  * {@link ResourcesControl.delete}
1330
1387
  */
1331
1388
  deleteResource(resource: ResourceIdKeynameDef): Promise<void>;
1332
1389
  }
1333
1390
 
1334
- export { type BaseRequestOptions, type BasemapResource, type BasemapWebmap, type BasemapWebmapItem, type BookmarkProperties, type CreatedResource, type Credentials, type DeleteRequestItemsResponseMap, type FeatureItem, type FeatureItemAttachment, type FeatureItemExtensions, type FeatureItemToNgw, type FeatureLayerCount, type FeatureLayerField, type FeatureLayersIdentify, type FeatureLayersIdentifyItems, type FeatureResource, type FileBucket, type FileMeta, type FileUploadResp, type GeometryType, type GetChildrenOfOptions, type GetRequestItemsResponseMap, type IdOnly, type LayerFeature, type LayerLegend, type LegendItem, type LegendItemSymbol, type LoadingQueue, type LookupTableResource, type NgwConnectorOptions, type NgwDateFormat, type NgwDateTimeFormat, type NgwExceptions, type NgwExtent, type NgwFile, type NgwLayerIdentifyError, type NgwTimeFormat, type Params, type PatchRequestItemsResponseMap, type Permission, type PostRequestItemsResponseMap, type PutRequestItemsResponseMap, type PyramidRoute, type PyramidSettings, type PyramidSettingsPyramid, type PyramidSettingsPyramidCompanyLogo, type RequestHeaders, type RequestItemAdditionalParams, type RequestItemKeys, type RequestItemsParams, type RequestItemsParamsMap, type RequestItemsResponseMap, type RequestMethods, type RequestOptions, type RequestTransformFunction, type Resmeta, type Resource, type ResourceCls, type ResourceDefinition, type ResourceHierarchy, type ResourceIdKeynameDef, type ResourceItem, type ResourceItemDatatype, type ResourceItemMain, type ResourceStoreItem, type ResourceStoreItemDefault, type ResourceStoreItemProperties, type Router, type SrsItem, type TreeGroup, type TreeItem, type TreeLayer, type UserInfo, type VectorFieldDatatype, type VectorLayer, type VectorLayerResourceItem, type WebmapResource, type WmsClientConnection, type WmsClientLayer, type WmsServerService, type WmsServerServiceLayer, NgwConnectorExtended as default };
1391
+ /**
1392
+ * Represents a legend for a specific layer.
1393
+ */
1394
+ interface LayerLegend {
1395
+ layerId: string;
1396
+ legend?: LegendSymbol[];
1397
+ resourceId: number;
1398
+ setSymbolRender?: (symbolIndex: number, status: boolean) => void;
1399
+ legendSymbols?: LegendSymbolsEnum;
1400
+ }
1401
+
1402
+ export { NgwConnectorExtended as default };
1403
+ export type { ApiRouteParams, BaseRequestOptions, BasemapResource, BasemapWebmap, BasemapWebmapItem, BookmarkProperties, CompositeFor, CreatedResource, Credentials, DeleteRequestItemsResponseMap, DeleteRequestOptions, FeatureItem, FeatureItemAttachment, FeatureItemExtensions, FeatureItemToNgw, FeatureLayerCount, FeatureLayerField, FeatureLayersIdentify, FeatureLayersIdentifyItems, FeatureResource, FileBucket, FileMeta, FileUploadResp, GeometryType, GetChildrenOfOptions, GetRequestItemsResponseMap, GetRequestOptions, GetRouteParam, IdOnly, KeysWithMethodAndPath, KeysWithMethods, KeysWithPaths, LayerFeature, LayerLegend, LoadingQueue, LookupTableResource, LunkwillData, Method, MethodAvailable, MethodRequestOptions, NgwConnectorOptions, NgwDateFormat, NgwDateTimeFormat, NgwExceptions, NgwExtent, NgwFile, NgwLayerIdentifyError, NgwTimeFormat, Params, PatchRequestItemsResponseMap, PatchRequestOptions, Permission, PostRequestItemsResponseMap, PostRequestOptions, PutRequestItemsResponseMap, PutRequestOptions, PyramidRoute, PyramidSettings, PyramidSettingsPyramid, PyramidSettingsPyramidCompanyLogo, RequestHeaders, RequestItemAdditionalParams, RequestItemKeys, RequestItemsParams, RequestItemsParamsMap, RequestItemsResponseMap, RequestMethod, RequestMethods, RequestOptions, RequestOptionsBody, RequestOptionsByMethod, RequestOptionsJSON, RequestTransformFunction, Resmeta, Resource, ResourceCls, ResourceDefinition, ResourceHierarchy, ResourceIdKeynameDef, ResourceItem, ResourceItemDatatype, ResourceItemMain, ResourceStoreItem, ResourceStoreItemDefault, ResourceStoreItemProperties, ResponseType, RouteBody, RouteMethods, RouteName, RouteParameters, RouteQuery, RouteRequestOptions, RouteResp, RouteResults, Router, SrsItem, ToReturn, TreeGroup, TreeItem, TreeLayer, UserInfo, VectorFieldDatatype, VectorLayer, VectorLayerResourceItem, WebmapResource, WmsClientConnection, WmsClientLayer, WmsServerService, WmsServerServiceLayer };