@nextgis/ngw-connector 3.0.0-alpha.8 → 3.0.1

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,50 +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
- setSymbolRender?: (symbolIndex: number, status: boolean) => void;
177
- }
178
-
179
161
  interface RequestItemsParamsMap {
180
162
  'pyramid.static': {
181
163
  skey: number;
@@ -609,6 +591,7 @@ interface Permission {
609
591
  permission: string;
610
592
  propagate: boolean;
611
593
  }
594
+ /** @deprecated use ResourceCls from '@nextgisweb/resource/type/api' instead */
612
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';
613
596
  interface ResourceHierarchy {
614
597
  id: number;
@@ -616,6 +599,7 @@ interface ResourceHierarchy {
616
599
  id: any;
617
600
  };
618
601
  }
602
+ /** @deprecated use ResourceRead from '@nextgisweb/resource/type/api' instead */
619
603
  interface Resource {
620
604
  cls: ResourceCls;
621
605
  id: number;
@@ -648,6 +632,7 @@ interface NgwTimeFormat {
648
632
  second: number;
649
633
  }
650
634
  type NgwDateTimeFormat = NgwDateFormat & NgwTimeFormat;
635
+ /** @deprecated use WebMapRead from '@nextgisweb/resource/type/api' instead */
651
636
  interface WebmapResource {
652
637
  extent_left: number;
653
638
  extent_right: number;
@@ -665,6 +650,7 @@ interface BasemapResource {
665
650
  */
666
651
  qms: string;
667
652
  }
653
+ /** @deprecated use BasemapWebMapItemRead from '@nextgisweb/resource/type/api' instead */
668
654
  interface BasemapWebmapItem {
669
655
  resource_id: number;
670
656
  display_name: string;
@@ -672,6 +658,7 @@ interface BasemapWebmapItem {
672
658
  enabled?: boolean;
673
659
  opacity?: number;
674
660
  }
661
+ /** @deprecated use BasemapWebMapRead from '@nextgisweb/resource/type/api' instead */
675
662
  interface BasemapWebmap {
676
663
  basemaps: BasemapWebmapItem[];
677
664
  }
@@ -690,10 +677,12 @@ interface FeatureLayerField {
690
677
  label_field: boolean;
691
678
  typemod?: unknown;
692
679
  }
680
+ /** @deprecated use FeatureLayerRead from '@nextgisweb/resource/type/api' instead */
693
681
  interface FeatureResource {
694
682
  fields: FeatureLayerField[];
695
683
  }
696
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 */
697
686
  interface VectorLayer {
698
687
  srs: {
699
688
  id: number;
@@ -776,6 +765,7 @@ interface ResourceItemMain {
776
765
  resource: Resource;
777
766
  resmeta: Resmeta;
778
767
  }
768
+ /** @deprecated use CompositeRead from '@nextgisweb/resource/type/api' instead */
779
769
  interface ResourceItem extends ResourceItemMain {
780
770
  [cls: string]: any;
781
771
  webmap?: WebmapResource;
@@ -831,7 +821,7 @@ interface FeatureLayerCount {
831
821
  total_count: number;
832
822
  }
833
823
  type ResourceIdKeynameDef = string | number;
834
- type ResourceDefinition = ResourceIdKeynameDef | DeepPartial<Resource>;
824
+ type ResourceDefinition = ResourceIdKeynameDef | DeepPartial<ResourceRead>;
835
825
  interface FileUploadResp {
836
826
  upload_meta: FileMeta[];
837
827
  }
@@ -866,10 +856,10 @@ interface RequestItemsResponseMap {
866
856
  interface GetRequestItemsResponseMap extends RequestItemKeys {
867
857
  'pyramid.route': PyramidRoute;
868
858
  'pyramid.settings': PyramidSettings;
869
- 'resource.item': ResourceItem;
870
- 'resource.search': ResourceItem[];
859
+ 'resource.item': CompositeRead;
860
+ 'resource.search': CompositeRead[];
871
861
  'resource.child': any;
872
- 'resource.collection': ResourceItem[];
862
+ 'resource.collection': CompositeRead[];
873
863
  'file_upload.upload': FileUploadResp;
874
864
  'layer.extent': NgwExtent;
875
865
  'feature_layer.feature.item': FeatureItem;
@@ -880,7 +870,7 @@ interface GetRequestItemsResponseMap extends RequestItemKeys {
880
870
  'feature_layer.feature.count': FeatureLayerCount;
881
871
  'pyramid.company_logo': string;
882
872
  'spatial_ref_sys.collection': SrsItem[];
883
- 'render.legend_symbols': LegendItem[];
873
+ 'render.legend_symbols': LegendSymbol[];
884
874
  }
885
875
  interface IdOnly {
886
876
  id: number;
@@ -962,7 +952,7 @@ type RequestMethods = 'POST' | 'GET' | 'PATCH' | 'DELETE' | 'PUT';
962
952
  type NgwExceptions = 'nextgisweb.resource.exception.ResourceNotFound' | 'nextgisweb.core.exception.InsufficientPermissions';
963
953
  interface BaseRequestOptions {
964
954
  cache?: boolean;
965
- signal?: AbortSignal;
955
+ signal?: AbortSignal | null;
966
956
  }
967
957
  /**
968
958
  * Options for configuring requests to NGW.
@@ -1004,7 +994,7 @@ interface RequestOptions<M extends RequestMethods = RequestMethods, K extends ke
1004
994
  /**
1005
995
  * Signal object that allows you to communicate with a DOM request (such as fetch) and abort it if desired via an AbortController.
1006
996
  */
1007
- signal?: AbortSignal;
997
+ signal?: AbortSignal | null;
1008
998
  /**
1009
999
  * Parameters to be included in the request URL.
1010
1000
  */
@@ -1064,6 +1054,47 @@ declare class NgwError extends Error {
1064
1054
  constructor(er?: Partial<NgwError>);
1065
1055
  }
1066
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
+
1067
1098
  /**
1068
1099
  * Thrown when ...
1069
1100
  */
@@ -1073,17 +1104,42 @@ declare class ResourceNotFoundError extends NgwError {
1073
1104
  constructor(obj?: ResourceNotFoundError);
1074
1105
  }
1075
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
+
1076
1134
  declare class NgwConnector {
1077
1135
  options: NgwConnectorOptions;
1078
- static errors: {
1079
- NgwError: typeof NgwError;
1080
- ResourceNotFoundError: typeof ResourceNotFoundError;
1081
- };
1136
+ static errors: typeof errors;
1082
1137
  id: number;
1083
1138
  emitter: EventEmitter<[never]>;
1084
1139
  user?: UserInfo;
1085
1140
  cache: Cache;
1086
1141
  withCredentials?: boolean;
1142
+ private readonly routeCache;
1087
1143
  private client;
1088
1144
  private routeStr;
1089
1145
  private activeRequests;
@@ -1113,7 +1169,7 @@ declare class NgwConnector {
1113
1169
  * .catch((er) => console.log('Connection problem', er));
1114
1170
  * ```
1115
1171
  */
1116
- connect(): Promise<PyramidRoute>;
1172
+ connect({ signal, }?: Pick<RequestOptions, 'signal'>): Promise<PyramidRoute>;
1117
1173
  /**
1118
1174
  * Quick way to change NextGIS Web user.
1119
1175
  * @param credentials - New user credentials
@@ -1132,7 +1188,7 @@ declare class NgwConnector {
1132
1188
  /** Stop all api requests */
1133
1189
  abort(): void;
1134
1190
  getActiveApiRequests(): {
1135
- [x: number]: AbortController;
1191
+ [requestId: number]: AbortController;
1136
1192
  };
1137
1193
  route<N extends RouteName>(name: N, ...rest: RouteParameters[N]): RouteResults<N>;
1138
1194
  /**
@@ -1149,7 +1205,7 @@ declare class NgwConnector {
1149
1205
  }
1150
1206
 
1151
1207
  declare class ResourcesControl {
1152
- cache: Cache<Promise<ResourceItem | undefined>, {
1208
+ cache: Cache<Promise<CompositeRead | undefined>, {
1153
1209
  id?: number | string;
1154
1210
  }>;
1155
1211
  connector: NgwConnectorExtended;
@@ -1164,8 +1220,8 @@ declare class ResourcesControl {
1164
1220
  * @remarks
1165
1221
  * Fetching resource would be cached to speed up next call
1166
1222
  */
1167
- getOne(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1168
- 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>;
1169
1225
  /**
1170
1226
  * A fast way to retrieve resource ID for any resource definition.
1171
1227
  * @param resource - Any available resource definition
@@ -1176,7 +1232,7 @@ declare class ResourcesControl {
1176
1232
  * then this method will come in handy to facilitate the extraction of the identifier
1177
1233
  * if the resource is specified through a keyname or other parameters.
1178
1234
  */
1179
- getId(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number | undefined>;
1235
+ getId(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<number | undefined>;
1180
1236
  /**
1181
1237
  * A fast way to retrieve resource ID for any resource definition.
1182
1238
  * @param resource - Any available resource definition
@@ -1185,11 +1241,11 @@ declare class ResourcesControl {
1185
1241
  * Similar with {@link NgwConnector.getResourceId | getResourceId} but rise error if resource is not exist.
1186
1242
  * To not make one more checks if the resource is definitely exists
1187
1243
  */
1188
- getIdOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number>;
1189
- getMany(resource: DeepPartial<Resource>, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem[]>;
1190
- getParent(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1191
- getChildrenOf(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<ResourceItem[]>;
1192
- 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>;
1193
1249
  /**
1194
1250
  * Fast way to delete resource from NGW and clean cache.
1195
1251
  * @param resource - Resource definition
@@ -1285,51 +1341,63 @@ declare class NgwConnectorExtended extends NgwConnector {
1285
1341
  /**
1286
1342
  * {@link ResourcesControl.getOne}
1287
1343
  */
1288
- getResource(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1344
+ getResource(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead | undefined>;
1289
1345
  /**
1290
1346
  * {@link ResourcesControl.getOneOrFail}
1291
1347
  */
1292
- getResourceOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem>;
1348
+ getResourceOrFail(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead>;
1293
1349
  /**
1294
1350
  * @deprecated - use {@link getResource}
1295
1351
  */
1296
- getResourceBy(resource: DeepPartial<Resource>): Promise<ResourceItem | undefined>;
1352
+ getResourceBy(resource: DeepPartial<ResourceRead>): Promise<CompositeRead | undefined>;
1297
1353
  /**
1298
1354
  * @deprecated - use {@link getResource}
1299
1355
  */
1300
- getResourceByKeyname(keyname: string): Promise<ResourceItem | undefined>;
1356
+ getResourceByKeyname(keyname: string): Promise<CompositeRead | undefined>;
1301
1357
  /**
1302
1358
  * @deprecated - use {@link getResource}
1303
1359
  */
1304
- getResourceById(id: number): Promise<ResourceItem | undefined>;
1360
+ getResourceById(id: number): Promise<CompositeRead | undefined>;
1305
1361
  /**
1306
1362
  * {@link ResourcesControl.getId}
1307
1363
  */
1308
- getResourceId(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number | undefined>;
1364
+ getResourceId(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<number | undefined>;
1309
1365
  /**
1310
1366
  * {@link ResourcesControl.getIdOrFail}
1311
1367
  */
1312
- getResourceIdOrFail(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<number>;
1368
+ getResourceIdOrFail(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<number>;
1313
1369
  /**
1314
1370
  * {@link ResourcesControl.getMany}
1315
1371
  */
1316
- getResourcesBy(resource: DeepPartial<Resource>, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem[]>;
1372
+ getResourcesBy(resource: DeepPartial<ResourceRead>, requestOptions?: GetRequestOptions): Promise<CompositeRead[]>;
1317
1373
  /**
1318
1374
  * {@link ResourcesControl.getParent}
1319
1375
  */
1320
- getResourceParent(resource: ResourceDefinition, requestOptions?: RequestOptions<'GET'>): Promise<ResourceItem | undefined>;
1376
+ getResourceParent(resource: ResourceDefinition, requestOptions?: GetRequestOptions): Promise<CompositeRead | undefined>;
1321
1377
  /**
1322
1378
  * {@link ResourcesControl.getChildrenOf}
1323
1379
  */
1324
- getResourceChildren(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<ResourceItem[]>;
1380
+ getResourceChildren(resource: ResourceDefinition, requestOptions?: GetChildrenOfOptions): Promise<CompositeRead[]>;
1325
1381
  /**
1326
1382
  * {@link ResourcesControl.update}
1327
1383
  */
1328
- updateResource(resource: ResourceIdKeynameDef, data: DeepPartial<ResourceItem>): Promise<ResourceItem | undefined>;
1384
+ updateResource(resource: ResourceIdKeynameDef, data: DeepPartial<CompositeRead>): Promise<CompositeRead | undefined>;
1329
1385
  /**
1330
1386
  * {@link ResourcesControl.delete}
1331
1387
  */
1332
1388
  deleteResource(resource: ResourceIdKeynameDef): Promise<void>;
1333
1389
  }
1334
1390
 
1335
- 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 };