@disy/cadenza.js 2.2.4 β 2.3.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/CHANGELOG.md +16 -5
- package/README.md +1 -322
- package/apidoc/assets/highlight.css +0 -7
- package/apidoc/assets/main.js +2 -2
- package/apidoc/assets/navigation.js +1 -1
- package/apidoc/assets/search.js +1 -1
- package/apidoc/assets/style.css +46 -15
- package/apidoc/classes/AbortError.html +3 -3
- package/apidoc/classes/CadenzaClient.html +65 -86
- package/apidoc/classes/CadenzaError.html +8 -6
- package/apidoc/functions/cadenza.html +4 -4
- package/apidoc/index.html +152 -9
- package/apidoc/interfaces/CadenzaEvent.html +6 -6
- package/apidoc/interfaces/ExternalLinkKey.html +6 -3
- package/apidoc/interfaces/Geometry.html +2 -2
- package/apidoc/interfaces/PageSource.html +2 -2
- package/apidoc/modules.html +14 -2
- package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -0
- package/apidoc/types/CadenzaDrillThroughEvent.html +7 -0
- package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -0
- package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -0
- package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -0
- package/apidoc/types/CadenzaErrorEvent.html +2 -2
- package/apidoc/types/CadenzaEventByType.html +1 -0
- package/apidoc/types/CadenzaEventType.html +2 -0
- package/apidoc/types/CadenzaObjectInfoEvent.html +2 -0
- package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -0
- package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -0
- package/apidoc/types/DataType.html +3 -2
- package/apidoc/types/EmbeddingTargetId.html +9 -2
- package/apidoc/types/Extent.html +1 -1
- package/apidoc/types/FilterVariables.html +5 -2
- package/apidoc/types/GeometryType.html +1 -1
- package/apidoc/types/GlobalId.html +2 -2
- package/apidoc/types/OpaqueString.html +6 -0
- package/apidoc/types/OperationMode.html +1 -1
- package/apidoc/types/TablePart.html +1 -1
- package/apidoc/types/UiFeature.html +3 -3
- package/apidoc/types/WorkbookLayerPath.html +3 -0
- package/cadenza.d.ts +274 -50
- package/cadenza.js +339 -69
- package/package.json +6 -6
- package/sandbox.html +197 -31
package/cadenza.d.ts
CHANGED
|
@@ -60,12 +60,9 @@ export class CadenzaClient {
|
|
|
60
60
|
* @param {String} [options.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
|
|
61
61
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
62
62
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
63
|
-
* @return {Promise<void>} A Promise for when the iframe is loaded
|
|
63
|
+
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
64
64
|
* @throws For invalid arguments
|
|
65
|
-
* @fires
|
|
66
|
-
* The event includes a row of values for each row in the workbook selection, each row consisting of the values of
|
|
67
|
-
* the attributes that were selected for the POST message content. If the drill-through was executed from a map
|
|
68
|
-
* view, each row includes the geometry of the select object as the last value.
|
|
65
|
+
* @fires {@link CadenzaDrillThroughEvent}
|
|
69
66
|
*/
|
|
70
67
|
show(source: PageSource | EmbeddingTargetId, { dataType, disabledUiFeatures, expandNavigator, filter, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, operationMode, signal, }?: {
|
|
71
68
|
dataType?: DataType | undefined;
|
|
@@ -74,11 +71,11 @@ export class CadenzaClient {
|
|
|
74
71
|
filter?: FilterVariables | undefined;
|
|
75
72
|
hideMainHeaderAndFooter?: boolean | undefined;
|
|
76
73
|
hideWorkbookToolBar?: boolean | undefined;
|
|
77
|
-
highlightGlobalId?:
|
|
74
|
+
highlightGlobalId?: GlobalId | undefined;
|
|
78
75
|
labelSet?: string | undefined;
|
|
79
76
|
operationMode?: OperationMode | undefined;
|
|
80
77
|
signal?: AbortSignal | undefined;
|
|
81
|
-
} | undefined): Promise<void>;
|
|
78
|
+
} | undefined, ...args: any[]): Promise<void>;
|
|
82
79
|
/**
|
|
83
80
|
* Show a workbook map view in an iframe.
|
|
84
81
|
*
|
|
@@ -96,11 +93,9 @@ export class CadenzaClient {
|
|
|
96
93
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
97
94
|
* @param {boolean} [options.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
|
|
98
95
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
99
|
-
* @return {Promise<void>} A Promise for when the iframe is loaded
|
|
96
|
+
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
100
97
|
* @throws For invalid arguments
|
|
101
|
-
* @fires
|
|
102
|
-
* The event includes a row of values for each row in the workbook selection, each row consisting of the values of
|
|
103
|
-
* the attributes that were selected for the POST message content plus the geometry of the select object as the last value.
|
|
98
|
+
* @fires {@link CadenzaDrillThroughEvent}
|
|
104
99
|
*/
|
|
105
100
|
showMap(mapView: EmbeddingTargetId, { disabledUiFeatures, expandNavigator, filter, geometry, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, locationFinder, mapExtent, operationMode, useMapSrs, signal, }?: {
|
|
106
101
|
disabledUiFeatures?: UiFeature[] | undefined;
|
|
@@ -109,19 +104,78 @@ export class CadenzaClient {
|
|
|
109
104
|
geometry?: Geometry | undefined;
|
|
110
105
|
hideMainHeaderAndFooter?: boolean | undefined;
|
|
111
106
|
hideWorkbookToolBar?: boolean | undefined;
|
|
112
|
-
highlightGlobalId?:
|
|
107
|
+
highlightGlobalId?: GlobalId | undefined;
|
|
113
108
|
locationFinder?: string | undefined;
|
|
114
109
|
mapExtent?: Extent | undefined;
|
|
115
110
|
operationMode?: OperationMode | undefined;
|
|
116
111
|
useMapSrs?: boolean | undefined;
|
|
117
112
|
signal?: AbortSignal | undefined;
|
|
118
|
-
} | undefined): Promise<void>;
|
|
113
|
+
} | undefined, ...args: any[]): Promise<void>;
|
|
119
114
|
/**
|
|
120
115
|
* Expand/collapse the navigator.
|
|
121
116
|
*
|
|
122
117
|
* @param {boolean} expanded - The expansion state of the navigator
|
|
123
118
|
*/
|
|
124
|
-
expandNavigator(expanded?: boolean): void;
|
|
119
|
+
expandNavigator(expanded?: boolean, ...args: any[]): void;
|
|
120
|
+
/**
|
|
121
|
+
* Get data from the currently shown workbook view.
|
|
122
|
+
*
|
|
123
|
+
* Currently, only map views are supported.
|
|
124
|
+
*
|
|
125
|
+
* @hidden
|
|
126
|
+
* @template {DataType} T
|
|
127
|
+
* @param {T} dataType - The requested data type. Currently, only `"png"` is supported.
|
|
128
|
+
* @return {Promise<T extends 'png' ? Blob : never>}
|
|
129
|
+
*/
|
|
130
|
+
getData<T extends DataType>(dataType: T, ...args: any[]): Promise<T extends "png" ? Blob : never>;
|
|
131
|
+
/**
|
|
132
|
+
* Set filter variables in the currently shown workbook.
|
|
133
|
+
*
|
|
134
|
+
* @hidden
|
|
135
|
+
* @param {FilterVariables} filter - The variable values
|
|
136
|
+
* @return {Promise<void>} A `Promise` for when the filter variables were set.
|
|
137
|
+
*/
|
|
138
|
+
setFilter(filter: FilterVariables, ...args: any[]): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Set the visibility of a layer in the currently shown workbook map view.
|
|
141
|
+
*
|
|
142
|
+
* When making a layer visible, its ancestors will be made visible, too.
|
|
143
|
+
* When hiding a layer, the ancestors are not affected.
|
|
144
|
+
*
|
|
145
|
+
* @hidden
|
|
146
|
+
* @param {WorkbookLayerPath | string} layer - The layer to show or hide
|
|
147
|
+
* (identified using a layer path or a print name)
|
|
148
|
+
* @param {boolean} visible - The visibility state of the layer
|
|
149
|
+
* @return {Promise<void>} A `Promise` for when the layer visibility was set.
|
|
150
|
+
*/
|
|
151
|
+
setLayerVisibility(layer: WorkbookLayerPath | string, visible: boolean, ...args: any[]): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Set the selection in the currently shown workbook map view.
|
|
154
|
+
*
|
|
155
|
+
* @hidden
|
|
156
|
+
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
157
|
+
* @param {unknown[]} values - The IDs of the objects to select
|
|
158
|
+
* @return {Promise<void>} A `Promise` for when the selection was set.
|
|
159
|
+
*/
|
|
160
|
+
setSelection(layer: WorkbookLayerPath | string, values: unknown[], ...args: any[]): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Add to the selection in the currently shown workbook map view.
|
|
163
|
+
*
|
|
164
|
+
* @hidden
|
|
165
|
+
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
166
|
+
* @param {unknown[]} values - The IDs of the objects to select
|
|
167
|
+
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
168
|
+
*/
|
|
169
|
+
addSelection(layer: WorkbookLayerPath | string, values: unknown[], ...args: any[]): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Remove from the selection in the currently shown workbook map view.
|
|
172
|
+
*
|
|
173
|
+
* @hidden
|
|
174
|
+
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
175
|
+
* @param {unknown[]} values - The IDs of the objects to unselect
|
|
176
|
+
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
177
|
+
*/
|
|
178
|
+
removeSelection(layer: WorkbookLayerPath | string, values: unknown[], ...args: any[]): Promise<void>;
|
|
125
179
|
/**
|
|
126
180
|
* Create a geometry.
|
|
127
181
|
*
|
|
@@ -136,11 +190,12 @@ export class CadenzaClient {
|
|
|
136
190
|
* @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
|
|
137
191
|
* @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
|
|
138
192
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
139
|
-
* @return {Promise<void>} A Promise for when the iframe is loaded
|
|
193
|
+
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
140
194
|
* @throws For invalid arguments
|
|
141
|
-
* @fires
|
|
142
|
-
*
|
|
143
|
-
*
|
|
195
|
+
* @fires
|
|
196
|
+
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
197
|
+
* - {@link CadenzaEditGeometryOkEvent}
|
|
198
|
+
* - {@link CadenzaEditGeometryCancelEvent}
|
|
144
199
|
*/
|
|
145
200
|
createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { locationFinder, mapExtent, minScale, useMapSrs, signal }?: {
|
|
146
201
|
locationFinder?: string | undefined;
|
|
@@ -148,7 +203,7 @@ export class CadenzaClient {
|
|
|
148
203
|
minScale?: number | undefined;
|
|
149
204
|
useMapSrs?: boolean | undefined;
|
|
150
205
|
signal?: AbortSignal | undefined;
|
|
151
|
-
} | undefined): Promise<void>;
|
|
206
|
+
} | undefined, ...args: any[]): Promise<void>;
|
|
152
207
|
/**
|
|
153
208
|
* Edit a geometry.
|
|
154
209
|
*
|
|
@@ -160,11 +215,12 @@ export class CadenzaClient {
|
|
|
160
215
|
* @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
|
|
161
216
|
* @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
|
|
162
217
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
163
|
-
* @return {Promise<void>} A Promise for when the iframe is loaded
|
|
218
|
+
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
164
219
|
* @throws For invalid arguments
|
|
165
|
-
* @fires
|
|
166
|
-
*
|
|
167
|
-
*
|
|
220
|
+
* @fires
|
|
221
|
+
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
222
|
+
* - {@link CadenzaEditGeometryOkEvent}
|
|
223
|
+
* - {@link CadenzaEditGeometryCancelEvent}
|
|
168
224
|
*/
|
|
169
225
|
editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { locationFinder, mapExtent, minScale, useMapSrs, signal }?: {
|
|
170
226
|
locationFinder?: string | undefined;
|
|
@@ -172,38 +228,68 @@ export class CadenzaClient {
|
|
|
172
228
|
minScale?: number | undefined;
|
|
173
229
|
useMapSrs?: boolean | undefined;
|
|
174
230
|
signal?: AbortSignal | undefined;
|
|
175
|
-
} | undefined): Promise<void>;
|
|
231
|
+
} | undefined, ...args: any[]): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Select objects in a workbook map.
|
|
234
|
+
*
|
|
235
|
+
* @param {EmbeddingTargetId} backgroundMapView - The workbook map view
|
|
236
|
+
* @param {object} [options] - Options
|
|
237
|
+
* @param {(WorkbookLayerPath | string)[]} [options.layers] - Layers to restrict the selection to
|
|
238
|
+
* (identified using layer paths or print names)
|
|
239
|
+
* @param {string} [options.locationFinder] - A search query for the location finder
|
|
240
|
+
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
241
|
+
* @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
|
|
242
|
+
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
243
|
+
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
244
|
+
* @throws For invalid arguments
|
|
245
|
+
* @fires
|
|
246
|
+
* - {@link CadenzaChangeSelectionEvent}
|
|
247
|
+
* - {@link CadenzaObjectInfoEvent}
|
|
248
|
+
* - {@link CadenzaSelectObjectsOkEvent}
|
|
249
|
+
* - {@link CadenzaSelectObjectsCancelEvent}
|
|
250
|
+
*/
|
|
251
|
+
selectObjects(backgroundMapView: EmbeddingTargetId, { layers, locationFinder, mapExtent, useMapSrs, signal }?: {
|
|
252
|
+
layers?: (string | WorkbookLayerPath)[] | undefined;
|
|
253
|
+
locationFinder?: string | undefined;
|
|
254
|
+
mapExtent?: Extent | undefined;
|
|
255
|
+
useMapSrs?: boolean | undefined;
|
|
256
|
+
signal?: AbortSignal | undefined;
|
|
257
|
+
} | undefined, ...args: any[]): Promise<void>;
|
|
176
258
|
/**
|
|
177
259
|
* Subscribe to a `postMessage()` event.
|
|
178
260
|
*
|
|
179
|
-
* @template
|
|
180
|
-
* @param {
|
|
181
|
-
* @param {(event: CadenzaEvent<
|
|
261
|
+
* @template {CadenzaEventType} TYPE
|
|
262
|
+
* @param {TYPE} type - The event type
|
|
263
|
+
* @param {(event: CadenzaEvent<TYPE, CadenzaEventByType<TYPE>['detail']>) => void} subscriber - The subscriber function
|
|
182
264
|
* @return {() => void} An unsubscribe function
|
|
183
265
|
*/
|
|
184
|
-
on<
|
|
266
|
+
on<TYPE extends CadenzaEventType>(type: TYPE, subscriber: (event: CadenzaEvent<TYPE, CadenzaEventByType<TYPE>["detail"]>) => void): () => void;
|
|
185
267
|
/**
|
|
186
268
|
* Fetch data from a workbook view.
|
|
187
269
|
*
|
|
188
|
-
* @param {EmbeddingTargetId} source - The workbook view to fetch data from
|
|
189
|
-
*
|
|
270
|
+
* @param {EmbeddingTargetId} source - The workbook view to fetch data from.
|
|
271
|
+
* Currently only table and indicator views are supported.
|
|
272
|
+
* @param {DataType} dataType - The data type you want to get back from the server.
|
|
273
|
+
* Currently, `"csv"`, `"excel"` and `"json"` are supported.
|
|
190
274
|
* @param {object} options - Options
|
|
191
275
|
* @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
|
|
192
276
|
* @param {AbortSignal} [options.signal] - A signal to abort the data fetching
|
|
193
|
-
* @return {Promise<Response>} A Promise for the fetch response
|
|
277
|
+
* @return {Promise<Response>} A `Promise` for the fetch response
|
|
194
278
|
* @throws For invalid arguments
|
|
195
279
|
*/
|
|
196
280
|
fetchData(source: EmbeddingTargetId, dataType: DataType, { parts, signal }?: {
|
|
197
281
|
parts?: TablePart[] | undefined;
|
|
198
282
|
signal?: AbortSignal | undefined;
|
|
199
|
-
}): Promise<Response>;
|
|
283
|
+
}, ...args: any[]): Promise<Response>;
|
|
200
284
|
/**
|
|
201
285
|
* Download data from a workbook view.
|
|
202
286
|
*
|
|
203
287
|
* _Note:_ The file name, if not provided, is generated from the name of the workbook view and the current date.
|
|
204
288
|
*
|
|
205
|
-
* @param {EmbeddingTargetId} source - The workbook view to download data from
|
|
206
|
-
*
|
|
289
|
+
* @param {EmbeddingTargetId} source - The workbook view to download data from.
|
|
290
|
+
* Currently only table and indicator views are supported.
|
|
291
|
+
* @param {DataType} dataType - The data type you want to get back from the server.
|
|
292
|
+
* Currently, `"csv"`, `"excel"` and `"json"` are supported.
|
|
207
293
|
* @param {object} options - Options
|
|
208
294
|
* @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
|
|
209
295
|
* @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
|
|
@@ -212,16 +298,57 @@ export class CadenzaClient {
|
|
|
212
298
|
downloadData(source: EmbeddingTargetId, dataType: DataType, { fileName, parts }: {
|
|
213
299
|
fileName?: string | undefined;
|
|
214
300
|
parts?: TablePart[] | undefined;
|
|
215
|
-
}): void;
|
|
301
|
+
}, ...args: any[]): void;
|
|
216
302
|
#private;
|
|
217
303
|
}
|
|
218
304
|
/**
|
|
219
|
-
* @
|
|
305
|
+
* @typedef {'change:selection'
|
|
306
|
+
* | 'drillThrough'
|
|
307
|
+
* | 'editGeometry:ok'
|
|
308
|
+
* | 'editGeometry:update'
|
|
309
|
+
* | 'editGeometry:cancel'
|
|
310
|
+
* | 'objectInfo'
|
|
311
|
+
* | 'selectObjects:ok'
|
|
312
|
+
* | 'selectObjects:cancel'
|
|
313
|
+
* } CadenzaEventType - An event type to subscribe to using {@link CadenzaClient#on}
|
|
314
|
+
*/
|
|
315
|
+
/**
|
|
316
|
+
* @template {CadenzaEventType} T
|
|
317
|
+
* @typedef {T extends 'change:selection' ? CadenzaChangeSelectionEvent
|
|
318
|
+
* : T extends 'drillThrough' ? CadenzaDrillThroughEvent
|
|
319
|
+
* : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent
|
|
320
|
+
* : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent
|
|
321
|
+
* : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent
|
|
322
|
+
* : T extends 'objectInfo' ? CadenzaObjectInfoEvent
|
|
323
|
+
* : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
|
|
324
|
+
* : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent
|
|
325
|
+
* : never
|
|
326
|
+
* } CadenzaEventByType
|
|
327
|
+
*/
|
|
328
|
+
/**
|
|
329
|
+
* @template {CadenzaEventType | string} TYPE
|
|
330
|
+
* @template [DETAIL=unknown]
|
|
220
331
|
* @typedef CadenzaEvent - A Cadenza `postMessage()` event
|
|
221
|
-
* @property {
|
|
222
|
-
* @property {
|
|
332
|
+
* @property {TYPE} type - The event type
|
|
333
|
+
* @property {DETAIL} detail - Optional event details (depending on the event type)
|
|
334
|
+
*/
|
|
335
|
+
/** @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection. */
|
|
336
|
+
/**
|
|
337
|
+
* @typedef {CadenzaEvent<'drillThrough', {values: unknown[][]}>} CadenzaDrillThroughEvent - When the user executed a POST message drill-through.
|
|
338
|
+
* <p>
|
|
339
|
+
* The event includes a data row for every item in the workbook selection, each row consisting of the values of
|
|
340
|
+
* the attributes that were selected for the POST message content. If the drill-through was executed from a map
|
|
341
|
+
* view, each row includes the geometry of the selected object as the last value.
|
|
342
|
+
* <p>
|
|
343
|
+
* See also: <a href="../index.html#md:json-representation-of-cadenza-object-data">JSON Representation of Cadenza Object Data</a>
|
|
223
344
|
*/
|
|
224
|
-
/** @typedef {CadenzaEvent<
|
|
345
|
+
/** @typedef {CadenzaEvent<'editGeometry:update', {geometry: Geometry}>} CadenzaEditGeometryUpdateEvent - When the user changed the geometry. */
|
|
346
|
+
/** @typedef {CadenzaEvent<'editGeometry:ok', {geometry: Geometry}>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. */
|
|
347
|
+
/** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
|
|
348
|
+
/** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
|
|
349
|
+
/** @typedef {CadenzaEvent<'objectInfo', {layer: WorkbookLayerPath, objectInfos: {selectionIndex: number, formattedValues: Record<string, string>}[]}>} CadenzaObjectInfoEvent - When the user opened the object info flyout. */
|
|
350
|
+
/** @typedef {CadenzaEvent<'selectObjects:ok', {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaSelectObjectsOkEvent - When the user submitted the selection. */
|
|
351
|
+
/** @typedef {CadenzaEvent<'selectObjects:cancel'>} CadenzaSelectObjectsCancelEvent - When the user cancelled the selection. */
|
|
225
352
|
export class AbortError extends DOMException {
|
|
226
353
|
constructor();
|
|
227
354
|
}
|
|
@@ -240,15 +367,39 @@ export class CadenzaError extends Error {
|
|
|
240
367
|
#private;
|
|
241
368
|
}
|
|
242
369
|
/**
|
|
243
|
-
* -
|
|
370
|
+
* - A specific `string` type that is not assignable from another string
|
|
371
|
+
*
|
|
372
|
+
* The idea is to have a specific type e.g. for the {@link EmbeddingTargetId } instead of a plain `string`.
|
|
373
|
+
* You don't need to _actually_ add that `__type` property. In TS code, just use a
|
|
374
|
+
* [type assertion](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions)
|
|
375
|
+
* (e.g. `cadenzaClient.show('{embeddingTargetId}' as EmbeddingTargetId)`).
|
|
244
376
|
*/
|
|
245
|
-
export type
|
|
377
|
+
export type OpaqueString<T extends string> = string & {
|
|
378
|
+
__type: T;
|
|
379
|
+
};
|
|
380
|
+
/**
|
|
381
|
+
* - The ID of a Cadenza embedding target
|
|
382
|
+
*
|
|
383
|
+
* Embedding targets are called π©πͺ "Einbettbarer Inhalt" / πΊπΈ "Embeddable content" throughout the Cadenza UI and help.
|
|
384
|
+
* They're managed within the respective workbook:
|
|
385
|
+
*
|
|
386
|
+
* - π©πͺ "Mehr" > "Arbeitsmappe verwalten" > "Einbettung"
|
|
387
|
+
* - πΊπΈ "More" > "Manage workbook" > "Embedding"
|
|
388
|
+
*
|
|
389
|
+
* The name of an embedding target (as entered in the UI) is its ID.
|
|
390
|
+
*/
|
|
391
|
+
export type EmbeddingTargetId = OpaqueString<'EmbeddingTargetId'>;
|
|
246
392
|
/**
|
|
247
393
|
* - The ID of a navigator item
|
|
248
394
|
*/
|
|
249
|
-
export type GlobalId =
|
|
395
|
+
export type GlobalId = OpaqueString<'GlobalId'>;
|
|
250
396
|
/**
|
|
251
397
|
* - A tuple qualifying a Cadenza external link
|
|
398
|
+
*
|
|
399
|
+
* You get the `repositoryName` and `externalLinkId` from the URL of the external link's page in the Cadenza management center:
|
|
400
|
+
* ```
|
|
401
|
+
* {baseUrl}/admin/repositories/{repositoryName}/external-links/{externalLinkId}?...
|
|
402
|
+
* ```
|
|
252
403
|
*/
|
|
253
404
|
export type ExternalLinkKey = {
|
|
254
405
|
/**
|
|
@@ -260,6 +411,11 @@ export type ExternalLinkKey = {
|
|
|
260
411
|
*/
|
|
261
412
|
externalLinkId: string;
|
|
262
413
|
};
|
|
414
|
+
/**
|
|
415
|
+
* - Identifies a layer within a workbook map view
|
|
416
|
+
* using the print names of the layer and - if the layer is grouped - its ancestors
|
|
417
|
+
*/
|
|
418
|
+
export type WorkbookLayerPath = string[];
|
|
263
419
|
/**
|
|
264
420
|
* - A well-known Cadenza page
|
|
265
421
|
*/
|
|
@@ -277,8 +433,8 @@ export type OperationMode = 'normal' | 'simplified';
|
|
|
277
433
|
* - The name of a Cadenza UI feature
|
|
278
434
|
*
|
|
279
435
|
* _Note:_ Supported features are:
|
|
280
|
-
* *
|
|
281
|
-
* *
|
|
436
|
+
* * `"workbook-design"` - The workbook designer
|
|
437
|
+
* * `"workbook-view-management"` - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
|
|
282
438
|
*/
|
|
283
439
|
export type UiFeature = 'workbook-design' | 'workbook-view-management';
|
|
284
440
|
/**
|
|
@@ -302,33 +458,101 @@ export type GeometryType = 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineStr
|
|
|
302
458
|
export type Extent = [number, number, number, number];
|
|
303
459
|
/**
|
|
304
460
|
* - A data type
|
|
461
|
+
*
|
|
462
|
+
* See [JSON Representation of Cadenza Object Data](../index.html#md:json-representation-of-cadenza-object-data) for JSON data.
|
|
305
463
|
*/
|
|
306
|
-
export type DataType = 'csv' | 'excel' | 'json' | 'pdf';
|
|
464
|
+
export type DataType = 'csv' | 'excel' | 'json' | 'pdf' | 'png';
|
|
307
465
|
/**
|
|
308
466
|
* - A part of a table to export
|
|
309
467
|
*/
|
|
310
468
|
export type TablePart = 'columns' | 'values' | 'totals';
|
|
311
469
|
/**
|
|
312
470
|
* - Filter variable names and values
|
|
471
|
+
*
|
|
472
|
+
* Variables of type String, Integer, Long, Double and Date can be set.
|
|
473
|
+
*
|
|
474
|
+
* _Note:_ Since numbers in JavaScript are Double values ([more info on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding)),
|
|
475
|
+
* for Long variables, the API is currently limited to the Double value range.
|
|
313
476
|
*/
|
|
314
|
-
export type FilterVariables = Record<string, string | number | Date>;
|
|
477
|
+
export type FilterVariables = Record<string, string | string[] | number | Date | null>;
|
|
478
|
+
/**
|
|
479
|
+
* - An event type to subscribe to using {@link CadenzaClienton }
|
|
480
|
+
*/
|
|
481
|
+
export type CadenzaEventType = 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'objectInfo' | 'selectObjects:ok' | 'selectObjects:cancel';
|
|
482
|
+
export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'objectInfo' ? CadenzaObjectInfoEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
|
|
315
483
|
/**
|
|
316
484
|
* - A Cadenza `postMessage()` event
|
|
317
485
|
*/
|
|
318
|
-
export type CadenzaEvent<
|
|
486
|
+
export type CadenzaEvent<TYPE extends string, DETAIL = unknown> = {
|
|
319
487
|
/**
|
|
320
488
|
* - The event type
|
|
321
489
|
*/
|
|
322
|
-
type:
|
|
490
|
+
type: TYPE;
|
|
323
491
|
/**
|
|
324
492
|
* - Optional event details (depending on the event type)
|
|
325
493
|
*/
|
|
326
|
-
detail:
|
|
494
|
+
detail: DETAIL;
|
|
327
495
|
};
|
|
496
|
+
/**
|
|
497
|
+
* - When the user changed the selection.
|
|
498
|
+
*/
|
|
499
|
+
export type CadenzaChangeSelectionEvent = CadenzaEvent<'change:selection', undefined | {
|
|
500
|
+
layer: string[];
|
|
501
|
+
values: unknown[][];
|
|
502
|
+
}>;
|
|
503
|
+
/**
|
|
504
|
+
* - When the user executed a POST message drill-through.
|
|
505
|
+
* <p>
|
|
506
|
+
* The event includes a data row for every item in the workbook selection, each row consisting of the values of
|
|
507
|
+
* the attributes that were selected for the POST message content. If the drill-through was executed from a map
|
|
508
|
+
* view, each row includes the geometry of the selected object as the last value.
|
|
509
|
+
* <p>
|
|
510
|
+
* See also: <a href="../index.html#md:json-representation-of-cadenza-object-data">JSON Representation of Cadenza Object Data</a>
|
|
511
|
+
*/
|
|
512
|
+
export type CadenzaDrillThroughEvent = CadenzaEvent<'drillThrough', {
|
|
513
|
+
values: unknown[][];
|
|
514
|
+
}>;
|
|
515
|
+
/**
|
|
516
|
+
* - When the user changed the geometry.
|
|
517
|
+
*/
|
|
518
|
+
export type CadenzaEditGeometryUpdateEvent = CadenzaEvent<'editGeometry:update', {
|
|
519
|
+
geometry: Geometry;
|
|
520
|
+
}>;
|
|
521
|
+
/**
|
|
522
|
+
* - When the user submitted the geometry.
|
|
523
|
+
*/
|
|
524
|
+
export type CadenzaEditGeometryOkEvent = CadenzaEvent<'editGeometry:ok', {
|
|
525
|
+
geometry: Geometry;
|
|
526
|
+
}>;
|
|
527
|
+
/**
|
|
528
|
+
* - When the user cancelled the geometry editing.
|
|
529
|
+
*/
|
|
530
|
+
export type CadenzaEditGeometryCancelEvent = CadenzaEvent<'editGeometry:cancel'>;
|
|
328
531
|
/**
|
|
329
532
|
* - An error event that is mapped to a {@link CadenzaError }
|
|
330
533
|
*/
|
|
331
|
-
export type CadenzaErrorEvent = CadenzaEvent<{
|
|
534
|
+
export type CadenzaErrorEvent = CadenzaEvent<'error', {
|
|
332
535
|
type: string;
|
|
333
536
|
message?: string;
|
|
334
537
|
}>;
|
|
538
|
+
/**
|
|
539
|
+
* - When the user opened the object info flyout.
|
|
540
|
+
*/
|
|
541
|
+
export type CadenzaObjectInfoEvent = CadenzaEvent<'objectInfo', {
|
|
542
|
+
layer: string[];
|
|
543
|
+
objectInfos: {
|
|
544
|
+
selectionIndex: number;
|
|
545
|
+
formattedValues: Record<string, string>;
|
|
546
|
+
}[];
|
|
547
|
+
}>;
|
|
548
|
+
/**
|
|
549
|
+
* - When the user submitted the selection.
|
|
550
|
+
*/
|
|
551
|
+
export type CadenzaSelectObjectsOkEvent = CadenzaEvent<'selectObjects:ok', {
|
|
552
|
+
layer: string[];
|
|
553
|
+
values: unknown[][];
|
|
554
|
+
}>;
|
|
555
|
+
/**
|
|
556
|
+
* - When the user cancelled the selection.
|
|
557
|
+
*/
|
|
558
|
+
export type CadenzaSelectObjectsCancelEvent = CadenzaEvent<'selectObjects:cancel'>;
|