@conterra/ct-mapapps-typings 4.13.2-next.20220629040903 → 4.13.2-next.20220704040728

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.
@@ -6,7 +6,7 @@ export default class AGOLAuthenticationPlugin {
6
6
  _roleMapping: any;
7
7
  _organizationId: any;
8
8
  _fetchSelf: any;
9
- _oauth: any;
9
+ _oauth: boolean | undefined;
10
10
  /**
11
11
  * @returns {Authentication} authentication instance
12
12
  */
@@ -10,7 +10,7 @@ export interface LayerStoreMetadata extends Metadata {
10
10
  /** Whether the store supports pagination or not. */
11
11
  readonly supportsPagination: boolean;
12
12
  /** Maximum number of features that can be requested from the server. */
13
- readonly maxRecordCount: number;
13
+ readonly maxRecordCount: number | undefined;
14
14
  }
15
15
  declare type FeatureLayerProps = "type" | "destroy" | "load" | "loaded" | "url" | "layerId" | "capabilities" | "sourceJSON" | "objectIdField" | "title" | "displayField" | "geometryType" | "fullExtent" | "popupTemplate" | "fields" | "createQuery" | "queryObjectIds" | "queryFeatures" | "queryFeatureCount" | "definitionExpression";
16
16
  export declare type SimpleFeatureLayer = Pick<FeatureLayer, FeatureLayerProps>;
@@ -112,6 +112,11 @@ export interface Logger {
112
112
  * @param args arguments filled into the placeholder or directly logged.
113
113
  */
114
114
  warn(msg: string, ...args: any[]): void;
115
+ /**
116
+ * Convenience method to log an error (without an additional message) as a warning.
117
+ * @param error the error to log
118
+ */
119
+ warn(error: Error): void;
115
120
  /**
116
121
  * Log a message at level ERROR.
117
122
  *
@@ -121,6 +126,11 @@ export interface Logger {
121
126
  * @param args arguments filled into the placeholder or directly logged.
122
127
  */
123
128
  error(msg: string, ...args: any[]): void;
129
+ /**
130
+ * Convenience method to log an error (without an additional message) as an error.
131
+ * @param error the error to log
132
+ */
133
+ error(error: Error): void;
124
134
  /**
125
135
  * Creates a new Logger, which will prefix each log message with the given prefix.
126
136
  *
@@ -0,0 +1,8 @@
1
+ import { RegisterOptions, ValueOrProvider } from "./config";
2
+ import "dojo/_base/sniff";
3
+ interface RegisterFunction<T> {
4
+ (key: keyof T, valueOrProvider: ValueOrProvider<T>, options?: RegisterOptions): void;
5
+ }
6
+ export declare function registerDojoConfigKey<T>(registerFn: RegisterFunction<T>, name: keyof T, path: string, dconfig?: any): void;
7
+ export declare function registerHasKey<T>(registerFn: RegisterFunction<T>, name: keyof T): void;
8
+ export {};
@@ -1,49 +1,338 @@
1
1
  import { DeepReadonly } from "./Types";
2
- import "dojo/_base/sniff";
3
2
  /**
4
3
  * Lists well known config property names and their types.
5
- *
6
- * TODO: will be split into config and environment detection!
7
4
  */
8
- export interface ConfigProperties {
9
- /** True if deprecation messages shall be logged. */
5
+ export interface WellknownConfigKeys {
6
+ /**
7
+ * True if deprecation messages shall be logged.
8
+ */
10
9
  "ct-log-deprecations": boolean;
11
- /** TODO ?? */
10
+ /**
11
+ * Is an algorithm to re-calcuate the viewport size for mobile enabled.
12
+ */
12
13
  "ct-fix-viewport": boolean;
14
+ /**
15
+ * Should the use of the fix algorithm be enforced.
16
+ */
13
17
  "ct-fix-viewport-force": boolean;
18
+ /**
19
+ * Is touch scroll enabled for dgrid.
20
+ */
14
21
  "ct-dgrid-touchscroll": boolean;
15
- /** True if content security policy settings prevent eval() etc. */
22
+ /**
23
+ * Is the debug mode enabled
24
+ */
25
+ "debug": boolean;
26
+ /**
27
+ * The configured locale.
28
+ * Please use `apprt-core/Locale.getCurrent()` to access the value.
29
+ */
30
+ "locale": string;
31
+ /**
32
+ * Url pointing to the current app directory.
33
+ */
34
+ "app-base-url": string;
35
+ /**
36
+ * The global logging configuration.
37
+ * Is interpreted by apprt-core/Logger
38
+ */
39
+ "logging": string;
40
+ /**
41
+ * Url to the js-registry providing the test bundles.
42
+ * Only available during test execution.
43
+ */
44
+ "testing-jsregistry-url": string;
45
+ /**
46
+ * Registry url used to fetch the apprt system.
47
+ */
48
+ "apprt-jsregistry-url": string;
49
+ /**
50
+ * The name of the default application.
51
+ */
52
+ "app-launch-default-app": string;
53
+ /**
54
+ * Defines that pre-fetching of module.js files via registry/layer.js is enabled.
55
+ */
56
+ "app-launch-prefetch-enabled": boolean;
57
+ /**
58
+ * Defines that during the pre-fetching main.js files should be included.
59
+ * @deprecated the settings is obsolete.
60
+ */
61
+ "app-launch-prefetch-main": boolean;
62
+ /**
63
+ * Defines that switching to HTTP Post is allowed during layer.js pre-fetching.
64
+ */
65
+ "app-launch-prefetch-with-post-enabled": boolean;
66
+ /**
67
+ * Defines that the layer.js request is using gzip encoded parameters to keep the parameter size short.
68
+ */
69
+ "app-launch-prefetch-params-compressed": boolean;
70
+ /**
71
+ * Defines that the app.json and bundles.json requests should use jsonp.
72
+ * @deprecated this support will be dropped for security reasons.
73
+ */
74
+ "app-launch-jsonp-enabled": boolean;
75
+ /**
76
+ * Enables statistics calculation during app start.
77
+ */
78
+ "app-launch-statistics-enabled": boolean;
79
+ /**
80
+ * Information of apprt-boot for the Launcher.
81
+ */
82
+ "apprt-boot-loader-info": any;
83
+ /**
84
+ * A global configured Enterprise-Portal url.
85
+ */
86
+ "arcgis-portal-url": string;
87
+ /**
88
+ * Url to the agol/token endpoint of map.apps.
89
+ * Which provides an technical user token to e.g. consume a geolocation service as anonymous app user.
90
+ */
91
+ "esri-identity-app-token-url": string;
92
+ /**
93
+ * Enables the use of the agol/token endpoint.
94
+ */
95
+ "esri-identity-app-token-enabled": boolean;
96
+ /**
97
+ * Enables the persistence of the esri/identity/IdentityManager state in the local storage.
98
+ */
99
+ "esri-identity-state-persist": boolean;
100
+ /**
101
+ * The name of the state in the local storage.
102
+ */
103
+ "esri-identity-state-name": string;
104
+ /**
105
+ * The prefix of the state in the local storage.
106
+ * If this is not configured then the default prefix is the app location.
107
+ * This should prevent interferences between apps.
108
+ */
109
+ "esri-identity-state-name-prefix": string;
110
+ /**
111
+ * Allows the esri/IdentityManager to send credentials via http.
112
+ * Not this is only intended for developement purpose
113
+ * and should never be enabled during production.
114
+ */
115
+ "esri-identity-allow-credentials-over-http": boolean;
116
+ /**
117
+ * Enables client side oauth for the application.
118
+ */
119
+ "oauth-enabled": boolean;
120
+ /**
121
+ * Which expiration should the requested oauth token have.
122
+ */
123
+ "oauth-access-token-expiration": number;
124
+ /**
125
+ * The client-id or app-id to authenticated with.
126
+ */
127
+ "oauth-app-id": string;
128
+ /**
129
+ * A special namespace value.
130
+ * Experimental, ignore that.
131
+ */
132
+ "oauth-namespace": string;
133
+ /**
134
+ * Should the login dialog be shown inside a popup.
135
+ */
136
+ "oauth-use-popup": boolean;
137
+ /**
138
+ * Url to a callback page which consumes the access token.
139
+ * Only of interest if oauth-use-popup is true.
140
+ */
141
+ "oauth-popup-callback-page": string;
142
+ /**
143
+ * Flag to enforce a login,
144
+ * Experimental, ignore that.
145
+ */
146
+ "oauth-force-login": string;
147
+ /**
148
+ * Refresh interval for geo-location updates.
149
+ */
150
+ "geolocation-update-interval": number;
151
+ /**
152
+ * Maximal allowed url length before automatically switching to POST.
153
+ */
154
+ "request-max-url-length": number;
155
+ /**
156
+ * Default request timeout.
157
+ */
158
+ "request-timeout": number;
159
+ /**
160
+ * Disables automatic CORS proxy fallback.
161
+ */
162
+ "request-proxy-disabled": boolean;
163
+ /**
164
+ * The default proxy url.
165
+ */
166
+ "request-proxy-url": string;
167
+ /**
168
+ * Proxy use rules.
169
+ */
170
+ "request-proxy-rules": string;
171
+ /**
172
+ * The trusted servers.
173
+ * Required for secure CORS communication.
174
+ */
175
+ "request-trusted-servers": string;
176
+ /**
177
+ * Flag for apprt-request to return dojo/Deferred instead of Promises.
178
+ */
179
+ "request-return-dojo-deferred": boolean;
180
+ }
181
+ /** Valid configuration property names. */
182
+ export declare type ConfigKey = keyof WellknownConfigKeys;
183
+ /**
184
+ * Lists well known environment property names and their types.
185
+ */
186
+ export interface WellknownEnvKeys {
187
+ /**
188
+ * True if content security policy settings prevent eval() etc.
189
+ */
16
190
  "csp-restrictions": boolean;
17
- /** True if WebAssembly is enabled. */
191
+ /**
192
+ * True if WebAssembly is enabled.
193
+ */
18
194
  "webassembly": boolean;
195
+ /**
196
+ * Detection if the client device is touch enabled.
197
+ */
19
198
  "touch": boolean;
199
+ /**
200
+ * Detection if the client is a mobile device.
201
+ */
20
202
  "mobile": boolean;
203
+ /**
204
+ * Detection if the client is the Internet Explorer.
205
+ */
21
206
  "ie": number;
207
+ /**
208
+ * Detection if the client is FireFox.
209
+ */
22
210
  "ff": number;
211
+ /**
212
+ * Detection if the client is Safari.
213
+ */
23
214
  "safari": number;
215
+ /**
216
+ * Detection if the client is an Android device.
217
+ */
24
218
  "android": number;
25
- "native-xhr2": boolean;
26
219
  }
27
- /** Valid configuration property names. */
28
- export declare type ConfigPropertyKey = keyof ConfigProperties;
220
+ /** Valid environment property names. */
221
+ export declare type EnvKey = keyof WellknownEnvKeys;
29
222
  /** Supported value types. */
30
- export declare type ConfigValue = undefined | null | boolean | number | string | ConfigValue[] | {
31
- [prop: string]: ConfigValue;
223
+ export declare type SupportedValueTypes = undefined | null | boolean | number | string | SupportedValueTypes[] | {
224
+ [prop: string]: SupportedValueTypes;
32
225
  };
33
- declare type ValueProvider<T> = T | (() => T);
226
+ declare type ValueCallback<K, R> = (key: K) => R | undefined;
227
+ declare type ValueOrCallback<K, R> = R | ValueCallback<K, R>;
228
+ /**
229
+ * Type used by the register functions.
230
+ * To distinguish a plain value or a function providing the value.
231
+ */
232
+ export declare type ValueOrProvider<T, K extends keyof T = keyof T> = ValueOrCallback<K, Extract<T[K], SupportedValueTypes>>;
233
+ /**
234
+ * Options accepted by the register* functions.
235
+ */
236
+ export interface RegisterOptions {
237
+ /**
238
+ * If true and the value is a provider function it is only invoked once,
239
+ * otherwise the function is invoked for every call for key.
240
+ * Default is true.
241
+ */
242
+ cacheProvidedValue?: boolean;
243
+ /**
244
+ * If true and and there is an already existing provider, then the existing provider is replaced.
245
+ * Otherwise an error is thrown.
246
+ */
247
+ overwrite?: boolean;
248
+ }
249
+ /**
250
+ * A value interceptor.
251
+ */
252
+ export interface Interceptor {
253
+ /**
254
+ * The interceptor is informed about any config key access.
255
+ * The lookupValue function can be used to fetch the original configuration value.
256
+ * Or the interceptor may return custom values.
257
+ *
258
+ * @param key config key
259
+ * @param lookupValue a function providing the original config value
260
+ */
261
+ (key: string, lookupValue: () => SupportedValueTypes): SupportedValueTypes | undefined;
262
+ }
263
+ /**
264
+ * This class implements the internal lazy configuration state.
265
+ * It is exported for test purpose only.
266
+ *
267
+ * @internal
268
+ */
269
+ export declare class LazyValues<SupportedKeys, Key extends keyof SupportedKeys = keyof SupportedKeys> {
270
+ #private;
271
+ interceptor: Interceptor | undefined;
272
+ get<K extends Key>(k: K): DeepReadonly<SupportedKeys[K]> | undefined;
273
+ registeredKeys(): Set<Key>;
274
+ register<K extends Key>(key: K, valueProvider: ValueOrProvider<SupportedKeys, K>, { cacheProvidedValue, overwrite }?: RegisterOptions): void;
275
+ isRegistered(key: Key): boolean;
276
+ unregister(key: Key): boolean;
277
+ }
34
278
  /**
35
279
  * Returns the configuration value associated with the given key.
36
280
  * Returns undefined if the key is not known.
37
281
  */
38
- export declare function config<K extends ConfigPropertyKey>(key: K): DeepReadonly<ConfigProperties[K]> | undefined;
39
- export default config;
282
+ export declare function configValue<K extends ConfigKey>(k: K): DeepReadonly<WellknownConfigKeys[K]> | undefined;
40
283
  /**
41
284
  * Registers a new key with the configuration.
42
- * Keys and values must also be declared at the type level by extending the `ConfigProperties` interface.
285
+ * Keys and values must also be declared at the type level by extending the `WellknownConfigKeys` interface.
43
286
  *
44
287
  * Throws an exception if the key was already registered.
45
288
  *
46
289
  * @param key the configuration key
47
290
  * @param value the value or a function returning the value (for lazy evaluation).
291
+ * @param options registration flags
292
+ */
293
+ export declare function registerConfigValue<K extends keyof WellknownConfigKeys>(key: K, valueOrProvider: ValueOrProvider<WellknownConfigKeys, K>, options?: RegisterOptions): void;
294
+ /**
295
+ * The intention of this function is to make testing simpler.
296
+ * A test can register a config value and unregister it afterwards.
297
+ * @param key a config key
298
+ * @returns true if conf value was un-registered(previously registered)
299
+ */
300
+ export declare function unregisterConfigValue<K extends keyof WellknownConfigKeys>(key: K): boolean;
301
+ /**
302
+ * The intention of this function is to make testing simpler.
303
+ *
304
+ * Do not forget to unset your interceptor after the tests.
305
+ * @param interceptor a callback informed about any config value access.
306
+ */
307
+ export declare function setConfigValueInterceptor(interceptor?: Interceptor): void;
308
+ /**
309
+ * Returns the environment value associated with the given key.
310
+ * Returns undefined if the key is not known.
311
+ */
312
+ export declare function envValue<K extends EnvKey>(k: K): DeepReadonly<WellknownEnvKeys[K]> | undefined;
313
+ /**
314
+ * Registers a new environment key with the configuration.
315
+ * Keys and values must also be declared at the type level by extending the `WellknownEnvKeys` interface.
316
+ *
317
+ * Throws an exception if the key was already registered.
318
+ *
319
+ * @param key the env key
320
+ * @param value the value or a function returning the value (for lazy evaluation).
321
+ * @param options registration flags
322
+ */
323
+ export declare function registerEnvValue<K extends keyof WellknownEnvKeys>(key: K, valueOrProvider: ValueOrProvider<WellknownEnvKeys, K>, options?: RegisterOptions): void;
324
+ /**
325
+ * The intention of this function is to make testing simpler.
326
+ * A test can register a env value and unregister it afterwards.
327
+ * @param key a env key
328
+ * @returns true if env value was un-registered(previously registered)
329
+ */
330
+ export declare function unregisterEnvValue<K extends keyof WellknownEnvKeys>(key: K): boolean;
331
+ /**
332
+ * The intention of this function is to make testing simpler.
333
+ *
334
+ * Do not forget to unset the interceptor after the tests.
335
+ * @param interceptor a callback informed about any env value access.
48
336
  */
49
- export declare function register<K extends ConfigPropertyKey>(key: K, value: ValueProvider<Extract<ConfigProperties[K], ConfigValue>>): void;
337
+ export declare function setEnvValueInterceptor(interceptor?: Interceptor): void;
338
+ export {};
@@ -34,7 +34,6 @@ export declare function objectToQuery(object: Record<string, any | any[]>): stri
34
34
  * @returns the parsed object
35
35
  */
36
36
  export declare function queryToObject(query: string | URLSearchParams): Record<string, string | string[]>;
37
- export declare function normalizeOrigin(origin: string): string;
38
37
  /**
39
38
  * Returns true if the given `url` is on a different origin than the current host.
40
39
  */
@@ -4,5 +4,5 @@ export default function _default(identityManager: any, opts: any): {
4
4
  get: () => any;
5
5
  clear: () => void;
6
6
  watchForChanges: () => void;
7
- isWatchingForChanges: () => boolean;
7
+ isWatchingForChanges(): boolean;
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import { DeepReadonly } from "apprt-core/Types";
2
2
  import type { Config, Interceptor, ProxyRule, TrustedServer } from ".";
3
- import { Origin } from "./origin";
3
+ import { OriginPattern } from "./origin";
4
4
  export declare class FetchConfig implements Config {
5
5
  defaultProxy: string | undefined;
6
6
  disableProxySupport: boolean;
@@ -21,9 +21,9 @@ export declare class FetchConfig implements Config {
21
21
  };
22
22
  }
23
23
  export interface InternalProxyRule {
24
- origin: Origin;
24
+ origin: OriginPattern;
25
25
  proxyUrl?: string;
26
26
  }
27
27
  export interface InternalTrustedServer {
28
- origin: Origin;
28
+ origin: OriginPattern;
29
29
  }
@@ -1,21 +1,26 @@
1
- declare const ORIGIN_TAG: unique symbol;
2
- /**
3
- * Wrapper type representing normalized origin values.
4
- *
5
- * This is important because there can be some confusion w.r.t. default ports (present or not?).
6
- * Normalized origins use the same format and can be compared with string comparisons.
7
- */
8
- export declare type Origin = string & {
9
- _tag: typeof ORIGIN_TAG;
10
- };
11
- /**
12
- * Normalizes an origin string (e.g. "https://host.com").
13
- * Returns the normalized value casted to the `Origin` type.
14
- */
15
- export declare function normalizeOrigin(origin: string): Origin;
16
- /**
17
- * Retrieves the normalized origin from the given URL as an instance of `Origin`.
18
- */
19
- export declare function originFromUrl(url: URL): Origin;
20
- export declare function originsEqual(lhs: Origin, rhs: Origin): boolean;
21
- export {};
1
+ export declare type Protocol = "http:" | "https:";
2
+ export declare class OriginPattern {
3
+ readonly protocol: Protocol | undefined;
4
+ readonly hostname: string;
5
+ readonly port: string | undefined;
6
+ readonly path: string;
7
+ /**
8
+ * Attempts to parse a pattern from the given string.
9
+ * Throws an error if the pattern is invalid.
10
+ */
11
+ static fromString(pattern: string): OriginPattern;
12
+ private constructor();
13
+ /**
14
+ * Returns true if `other` is equivalent to `this`, false otherwise.
15
+ */
16
+ equalTo(other: OriginPattern): boolean;
17
+ /**
18
+ * Returns true if the given `url` matches this pattern,
19
+ * false otherwise.
20
+ */
21
+ matches(url: URL): boolean;
22
+ /**
23
+ * Serialized this pattern to a normalized string representation.
24
+ */
25
+ toString(): string;
26
+ }
@@ -610,7 +610,7 @@ export declare abstract class Stream<T> implements Iterable<T> {
610
610
  *
611
611
  * ```js
612
612
  * for (const value of Stream.integers(5)) {
613
- * console.log(value);
613
+ * console.info(value);
614
614
  * }
615
615
  * ```
616
616
  */
@@ -1,2 +1,7 @@
1
- export default BannerWidget;
2
- declare const BannerWidget: any;
1
+ declare const BannerWidget_base: any;
2
+ export default class BannerWidget extends BannerWidget_base {
3
+ [x: string]: any;
4
+ createInstance(): any;
5
+ _handleError(event: any): void;
6
+ }
7
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conterra/ct-mapapps-typings",
3
- "version": "4.13.2-next.20220629040903",
3
+ "version": "4.13.2-next.20220704040728",
4
4
  "description": "TypeDefinitions for ct-mapapps",
5
5
  "author": "conterra",
6
6
  "license": "Apache-2.0"
@@ -17,16 +17,15 @@ export default class CachingStore {
17
17
  getMetadata(object: any): any;
18
18
  getIdentity(object: any): any;
19
19
  _getAllMasterStoreFields(): import("../../apprt/apprt-core/Promise").ExtendedPromise<{}>;
20
- _getItems(itemIds: any, opts: any): any;
21
- _fixCount(opts: any, itemIds: any): any;
20
+ _getItems(itemIds: any, opts: any): Promise<any[]>;
22
21
  _buildQuery(itemIds: any): {};
23
22
  _isGeometryRequired(options: any, defaultRequired: any): Any;
24
23
  _getGeometryFromCache(id: any, offset: any): any;
25
24
  _isSpatialQuery(query: any): boolean;
26
- _getItemsFromCache(query: any, options?: {}): import("../store-api/api/Store").ResultItems<Readonly<Record<string, any>>>;
25
+ _getItemsFromCache(query: any, options?: {}): import("store-api/api/Store").ResultItems<Readonly<Record<string, any>>>;
27
26
  _getGeometryForItems(items: any, options: any): import("../../apprt/apprt-core/Promise").ExtendedPromise<any>;
28
27
  _getItemsForQuery(query: any, options: any): import("../../apprt/apprt-core/Promise").ExtendedPromise<any[]>;
29
- query(query: any, options: any): import("../store-api/api/Store").ResultItems<any>;
28
+ query(query: any, options: any): import("store-api/api/Store").ResultItems<any>;
30
29
  _synchronizedQueryOnCache(query: any, opts: any): any;
31
30
  querySequence: any;
32
31
  _queryOnCache(query: any, opts: any): import("../../apprt/apprt-core/Promise").ExtendedPromise<any>;
@@ -9,6 +9,11 @@ export declare type IndexableThing = Readonly<Record<string, any>>;
9
9
  export interface ResultItems<ItemType extends IndexableThing> extends ReadonlyArray<ItemType> {
10
10
  /** Total number of available items in the result. */
11
11
  readonly total?: number;
12
+ /**
13
+ * Set to true if by the store to indicate that there are more results.
14
+ * The client may query again with an appropriate `start` value.
15
+ */
16
+ readonly hasMore?: boolean;
12
17
  /** Function to cancel the query. It is always 'undefined' in synchronous responses. */
13
18
  readonly cancel?: undefined;
14
19
  /** Function to react on the provided result. It is always 'undefined' in synchronous responses. */