@conterra/ct-mapapps-typings 4.18.0-next.20240419040340 → 4.18.0-next.20240423041951
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/agssearch/api.d.ts +8 -0
- package/apprt-core/Promise.d.ts +3 -1
- package/apprt-core/parallel.d.ts +23 -0
- package/ct/util/css.d.ts +3 -1
- package/map-basemaps-api/BasemapItem.d.ts +9 -9
- package/map-basemaps-api/BasemapsModel.d.ts +8 -9
- package/map-basemaps-api/api.d.ts +110 -0
- package/map-init/api.d.ts +69 -0
- package/map-init/package.json +5 -0
- package/package.json +1 -1
- package/selection-resultcenter/CachingStore.d.ts +3 -1
package/agssearch/api.d.ts
CHANGED
|
@@ -114,6 +114,14 @@ interface AGSStoreFromURLOptions extends AGSStoreCommonOptions {
|
|
|
114
114
|
* Default is false.
|
|
115
115
|
*/
|
|
116
116
|
supportsIdQueries?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Flag to indicate that the layer supports filtering using POST requests.
|
|
119
|
+
* Default is `false` for non ArcGIS OGCFeaturesServices,
|
|
120
|
+
* which means that requests with long query strings will fail.
|
|
121
|
+
* If `supportsIdQueries` is `true` and `supportsPOSTQueries` is `false`
|
|
122
|
+
* then these id queries are split to ensure GET requests are used for feature lookup by ids.
|
|
123
|
+
*/
|
|
124
|
+
supportsPOSTQueries?: boolean;
|
|
117
125
|
}
|
|
118
126
|
/**
|
|
119
127
|
* The type of stores created by the {@link AGSStoreFactory}.
|
package/apprt-core/Promise.d.ts
CHANGED
|
@@ -59,7 +59,9 @@ declare class ExtendedPromise<T> implements Promise<T> {
|
|
|
59
59
|
*
|
|
60
60
|
* @param iterable Iterable of Promise instances
|
|
61
61
|
*/
|
|
62
|
-
static all<T>(iterable:
|
|
62
|
+
static all<T extends readonly unknown[] | []>(iterable: T): ExtendedPromise<{
|
|
63
|
+
-readonly [P in keyof T]: Awaited<T[P]>;
|
|
64
|
+
}>;
|
|
63
65
|
/**
|
|
64
66
|
* Creates promise which fulfills if one of the other promises fulfills.
|
|
65
67
|
* Or rejects if one of the promises rejects.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An asynchronous function.
|
|
3
|
+
*/
|
|
4
|
+
type Task<T> = () => Promise<T>;
|
|
5
|
+
/**
|
|
6
|
+
* Options for {@link runParallel}.
|
|
7
|
+
*/
|
|
8
|
+
interface RunParallelOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The number of tasks that can be executed in parallel.
|
|
11
|
+
* Defaults to 4.
|
|
12
|
+
*/
|
|
13
|
+
parallelTasks?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Runs the given array of tasks in parallel.
|
|
17
|
+
* @param tasks The tasks the execute.
|
|
18
|
+
* @param options Additional options.
|
|
19
|
+
* @returns An array of promises that resolve to results, in the same order as `tasks`.
|
|
20
|
+
*/
|
|
21
|
+
declare function runParallel<T>(tasks: Task<T>[], options?: RunParallelOptions): Promise<T>[];
|
|
22
|
+
|
|
23
|
+
export { type RunParallelOptions, type Task, runParallel };
|
package/ct/util/css.d.ts
CHANGED
|
@@ -61,7 +61,9 @@ declare class ExtendedPromise<T> implements Promise<T> {
|
|
|
61
61
|
*
|
|
62
62
|
* @param iterable Iterable of Promise instances
|
|
63
63
|
*/
|
|
64
|
-
static all<T>(iterable:
|
|
64
|
+
static all<T extends readonly unknown[] | []>(iterable: T): ExtendedPromise<{
|
|
65
|
+
-readonly [P in keyof T]: Awaited<T[P]>;
|
|
66
|
+
}>;
|
|
65
67
|
/**
|
|
66
68
|
* Creates promise which fulfills if one of the other promises fulfills.
|
|
67
69
|
* Or rejects if one of the promises rejects.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="arcgis-js-api" />
|
|
2
|
+
import { MutableConstructor } from 'apprt-core/Mutable';
|
|
3
|
+
import { BasemapItem as BasemapItem$1 } from './api.js';
|
|
4
|
+
import Basemap from 'esri/Basemap';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @alias module:BasemapItem
|
|
6
|
-
*/
|
|
7
|
-
declare const BasemapItem: apprt_core_Mutable.MutableConstructor<{
|
|
8
|
-
id: string | undefined;
|
|
6
|
+
declare const BasemapItem: MutableConstructor<{
|
|
7
|
+
id: string;
|
|
9
8
|
title: string | undefined;
|
|
10
9
|
description: string | undefined;
|
|
11
|
-
basemap:
|
|
10
|
+
basemap: Basemap | undefined;
|
|
12
11
|
thumbnailUrl: string | undefined;
|
|
13
12
|
}>;
|
|
13
|
+
type BasemapItem = BasemapItem$1;
|
|
14
14
|
|
|
15
|
-
export { BasemapItem as default };
|
|
15
|
+
export { BasemapItem, BasemapItem as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BasemapsModelMembers, BasemapItem, BasemapItemProps, BasemapsModel as BasemapsModel$1 } from './api.js';
|
|
2
|
+
import 'apprt-core/Mutable';
|
|
3
|
+
import 'esri/Basemap';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const BasemapsModel: apprt_core_Mutable.MutableConstructor<{
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
}>;
|
|
5
|
+
declare const BasemapsModel: new (options?: Partial<Omit<BasemapsModelMembers, "basemaps"> & {
|
|
6
|
+
basemaps: (BasemapItem | BasemapItemProps)[];
|
|
7
|
+
}>) => BasemapsModel$1;
|
|
8
|
+
type BasemapsModel = BasemapsModel$1;
|
|
10
9
|
|
|
11
|
-
export { BasemapsModel as default };
|
|
10
|
+
export { BasemapsModel, BasemapsModel as default };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/// <reference types="arcgis-js-api" />
|
|
2
|
+
import { Mutable } from 'apprt-core/Mutable';
|
|
3
|
+
import Basemap from 'esri/Basemap';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Documentation for the members of {@link BasemapsModel}.
|
|
7
|
+
*/
|
|
8
|
+
interface BasemapsModelMembers {
|
|
9
|
+
/**
|
|
10
|
+
* Id of selected basemap item.
|
|
11
|
+
*/
|
|
12
|
+
selectedId: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Getter for the selected basemap item.
|
|
15
|
+
*/
|
|
16
|
+
readonly selected: BasemapItem | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Array of basemap items.
|
|
19
|
+
*/
|
|
20
|
+
get basemaps(): BasemapItem[];
|
|
21
|
+
/**
|
|
22
|
+
* Setter for the basemap items array.
|
|
23
|
+
*/
|
|
24
|
+
set basemaps(value: (BasemapItem | BasemapItemProps)[]);
|
|
25
|
+
/**
|
|
26
|
+
* Object lookup for style classes.
|
|
27
|
+
*/
|
|
28
|
+
styleLookup: Record<string, any> | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Adds the basemap item to the basemaps array.
|
|
31
|
+
*/
|
|
32
|
+
add(item: BasemapItem | BasemapItemProps): BasemapsModel;
|
|
33
|
+
/**
|
|
34
|
+
* Removes basemap item from the basemaps array.
|
|
35
|
+
*/
|
|
36
|
+
remove(item: Pick<BasemapItem, "id">): BasemapsModel;
|
|
37
|
+
/**
|
|
38
|
+
* Removes the basemap item with the given `id` from the basemaps array.
|
|
39
|
+
*/
|
|
40
|
+
removeById(id: string): BasemapsModel;
|
|
41
|
+
/**
|
|
42
|
+
* Removes all basemap items and selectedId state.
|
|
43
|
+
*/
|
|
44
|
+
clear(): BasemapsModel;
|
|
45
|
+
/**
|
|
46
|
+
* Returns `true` if basemaps are empty.
|
|
47
|
+
*/
|
|
48
|
+
isEmpty(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Finds the first item with the given id.
|
|
51
|
+
*/
|
|
52
|
+
findItemById(id: string): BasemapItem | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Finds the first item referencing the given Basemap.
|
|
55
|
+
*/
|
|
56
|
+
findItemByBasemap(basemap: Basemap): BasemapItem | undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The `BasemapsModel` contains a list of BasemapItems.
|
|
60
|
+
*/
|
|
61
|
+
type BasemapsModel = Mutable<BasemapsModelMembers>;
|
|
62
|
+
/**
|
|
63
|
+
* Documentation for the members of {@link BasemapItem}.
|
|
64
|
+
*/
|
|
65
|
+
interface BasemapItemMembers {
|
|
66
|
+
/**
|
|
67
|
+
* A basemap item needs an id.
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
/**
|
|
71
|
+
* The title of the item.
|
|
72
|
+
*/
|
|
73
|
+
title: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* The description of the item.
|
|
76
|
+
*/
|
|
77
|
+
description: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* The esri.Basemap instance.
|
|
80
|
+
*/
|
|
81
|
+
basemap: Basemap | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* An optional thumbnail url.
|
|
84
|
+
*/
|
|
85
|
+
thumbnailUrl: string | undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Represents a basemap in the {@link BasemapsModel}.
|
|
89
|
+
*/
|
|
90
|
+
type BasemapItem = Mutable<BasemapItemMembers>;
|
|
91
|
+
type BasemapItemProps = Partial<BasemapItemMembers>;
|
|
92
|
+
/**
|
|
93
|
+
* Registers {@link BasemapsModel | BasemapsModels} with the system.
|
|
94
|
+
*
|
|
95
|
+
* Use `"map-basemaps-api.BasemapsModelRegistration"` to inject an instance of this service.
|
|
96
|
+
*/
|
|
97
|
+
interface BasemapModelRegistration {
|
|
98
|
+
/**
|
|
99
|
+
* Registers a given BasemapsModel with the system.
|
|
100
|
+
*/
|
|
101
|
+
register(options: {
|
|
102
|
+
basemaps: BasemapsModel;
|
|
103
|
+
}): void;
|
|
104
|
+
/**
|
|
105
|
+
* Unregister the BasemapsModel instance.
|
|
106
|
+
*/
|
|
107
|
+
unregister(keepInstances?: boolean): void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type { BasemapItem, BasemapItemMembers, BasemapItemProps, BasemapModelRegistration, BasemapsModel, BasemapsModelMembers };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/// <reference types="arcgis-js-api" />
|
|
2
|
+
import Map from 'esri/Map';
|
|
3
|
+
import { BasemapsModel } from 'map-basemaps-api/api';
|
|
4
|
+
import { MapWidgetModel, MapWidget } from 'map-widget/api';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Interprets the map configuration.
|
|
8
|
+
*
|
|
9
|
+
* Use `"map-init.Interpreter"` to inject a reference to this interface.
|
|
10
|
+
*/
|
|
11
|
+
interface ConfigInterpreter {
|
|
12
|
+
/**
|
|
13
|
+
* Interprets a json config.
|
|
14
|
+
*
|
|
15
|
+
* @param config the json config input.
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* ```js
|
|
19
|
+
* let interpreter = ...;
|
|
20
|
+
* let result = interpreter.interpret({map: {basemap: "streets"}});
|
|
21
|
+
* // create widget and model classes
|
|
22
|
+
* let {mapWidget, mapWidgetModel, map, basemapsModel} = await result.toMapWidget();
|
|
23
|
+
* // alternative is to only create the model classes
|
|
24
|
+
* let {mapWidgetModel, map, basemapsModel} = await result.toMapWidgetModel();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
interpret(config: Record<string, any>): InterpreterResult;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The result of {@link InterpreterResult.toMapWidgetModel}.
|
|
31
|
+
*/
|
|
32
|
+
interface MapWidgetModelResult {
|
|
33
|
+
/**
|
|
34
|
+
* The map instance.
|
|
35
|
+
*/
|
|
36
|
+
map: Map;
|
|
37
|
+
/**
|
|
38
|
+
* The basemaps model.
|
|
39
|
+
*/
|
|
40
|
+
basemapsModel: BasemapsModel;
|
|
41
|
+
/**
|
|
42
|
+
* The map widget model.
|
|
43
|
+
*/
|
|
44
|
+
mapWidgetModel: MapWidgetModel;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The result of {@link InterpreterResult.toMapWidget}.
|
|
48
|
+
*/
|
|
49
|
+
interface MapWidgetResult extends MapWidgetModelResult {
|
|
50
|
+
/**
|
|
51
|
+
* The map widget.
|
|
52
|
+
*/
|
|
53
|
+
mapWidget: MapWidget;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The result of interpreting a json configuration using {@link ConfigInterpreter.interpret()}.
|
|
57
|
+
*/
|
|
58
|
+
interface InterpreterResult {
|
|
59
|
+
/**
|
|
60
|
+
* Returns the map, the basemaps model and finally the mapWidgetModel.
|
|
61
|
+
*/
|
|
62
|
+
toMapWidgetModel(): Promise<MapWidgetModelResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Like {@link toMapWidgetModel}, but also creates a `MapWidget`.
|
|
65
|
+
*/
|
|
66
|
+
toMapWidget(): Promise<MapWidgetResult>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type { ConfigInterpreter, InterpreterResult, MapWidgetModelResult, MapWidgetResult };
|
package/package.json
CHANGED
|
@@ -61,7 +61,9 @@ declare class ExtendedPromise<T> implements Promise<T> {
|
|
|
61
61
|
*
|
|
62
62
|
* @param iterable Iterable of Promise instances
|
|
63
63
|
*/
|
|
64
|
-
static all<T>(iterable:
|
|
64
|
+
static all<T extends readonly unknown[] | []>(iterable: T): ExtendedPromise<{
|
|
65
|
+
-readonly [P in keyof T]: Awaited<T[P]>;
|
|
66
|
+
}>;
|
|
65
67
|
/**
|
|
66
68
|
* Creates promise which fulfills if one of the other promises fulfills.
|
|
67
69
|
* Or rejects if one of the promises rejects.
|