@arcgis/toolkit 5.2.0-next.90 → 5.2.0-next.93
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/dist/array.d.ts +4 -1
- package/dist/dom/referenceElement.d.ts +9 -2
- package/dist/dom/slots.d.ts +8 -0
- package/dist/dom.d.ts +78 -36
- package/dist/error.d.ts +15 -4
- package/dist/function.d.ts +3 -0
- package/dist/intl/dom.d.ts +18 -7
- package/dist/intl.d.ts +38 -21
- package/dist/log.d.ts +38 -6
- package/dist/number.d.ts +2 -1
- package/dist/predicate.d.ts +16 -13
- package/dist/predicate.js +3 -3
- package/dist/promise.d.ts +16 -1
- package/dist/promise.js +2 -0
- package/dist/string.d.ts +40 -3
- package/dist/type.d.ts +11 -1
- package/dist/url.d.ts +4 -3
- package/package.json +1 -1
package/dist/array.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { nil } from
|
|
1
|
+
import type { nil } from "./type.ts";
|
|
2
2
|
/**
|
|
3
3
|
* A combination of map and find.
|
|
4
4
|
* Find a value in an array, and return its mapped variant.
|
|
5
5
|
*
|
|
6
|
+
* @public
|
|
7
|
+
* @param array
|
|
8
|
+
* @param callback
|
|
6
9
|
* @example
|
|
7
10
|
* ```ts
|
|
8
11
|
* // Given array of url strings, return the first valid URL object.
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/** @public */
|
|
2
|
+
interface ArcgisComponentBase<T> {
|
|
3
|
+
/** @public */
|
|
2
4
|
el: HTMLElement;
|
|
5
|
+
/** @public */
|
|
3
6
|
referenceElement?: T | string | null | undefined;
|
|
4
|
-
}
|
|
7
|
+
}
|
|
5
8
|
/**
|
|
6
9
|
* Resolves a reference element (arcgis-map, arcgis-scene, arcgis-link-chart)
|
|
7
10
|
* from a component's `referenceElement` property or attribute.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
* @param component
|
|
14
|
+
* @param referenceElementString
|
|
8
15
|
*/
|
|
9
16
|
export declare function resolveReferenceElement<T extends Element>(component: ArcgisComponentBase<T>, referenceElementString?: ArcgisComponentBase<T>["referenceElement"] | string): T | undefined;
|
|
10
17
|
export {};
|
package/dist/dom/slots.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns `true` if the target `slot` element from the `onSlotchange` event has any content (text or elements).
|
|
3
3
|
*
|
|
4
|
+
* @public
|
|
4
5
|
* @param event The event.
|
|
5
6
|
* @returns Whether the slot has any content.
|
|
6
7
|
*
|
|
@@ -13,6 +14,7 @@ export declare function slotChangeHasContent(event: Event): boolean;
|
|
|
13
14
|
/**
|
|
14
15
|
* Returns a string of textContent if the target `slot` element from the `onSlotchange` event has any text content.
|
|
15
16
|
*
|
|
17
|
+
* @public
|
|
16
18
|
* @param event The event.
|
|
17
19
|
* @returns The slots text.
|
|
18
20
|
*
|
|
@@ -25,6 +27,7 @@ export declare function slotChangeGetTextContent(event: Event): string;
|
|
|
25
27
|
/**
|
|
26
28
|
* Returns `true` if the target `slot` element from the `onSlotchange` event has any text content.
|
|
27
29
|
*
|
|
30
|
+
* @public
|
|
28
31
|
* @param event The event.
|
|
29
32
|
* @returns Whether the slot has any text content.
|
|
30
33
|
*
|
|
@@ -37,6 +40,7 @@ export declare function slotChangeHasTextContent(event: Event): boolean;
|
|
|
37
40
|
/**
|
|
38
41
|
* Returns `true` if the target `slot` element from the `onSlotchange` event has an assigned node.
|
|
39
42
|
*
|
|
43
|
+
* @public
|
|
40
44
|
* @param event The event.
|
|
41
45
|
* @returns Whether the slot has any assigned nodes.
|
|
42
46
|
*
|
|
@@ -49,6 +53,7 @@ export declare function slotChangeHasAssignedNode(event: Event): boolean;
|
|
|
49
53
|
/**
|
|
50
54
|
* Returns the assigned nodes on a `slot` element from the `onSlotchange` event.
|
|
51
55
|
*
|
|
56
|
+
* @public
|
|
52
57
|
* @param event The event.
|
|
53
58
|
* @returns Whether the slot has any assigned nodes.
|
|
54
59
|
*
|
|
@@ -61,6 +66,7 @@ export declare function slotChangeGetAssignedNodes(event: Event): Node[];
|
|
|
61
66
|
/**
|
|
62
67
|
* Returns `true` if the target `slot` element from the `onSlotchange` event has an assigned element.
|
|
63
68
|
*
|
|
69
|
+
* @public
|
|
64
70
|
* @param event The event.
|
|
65
71
|
* @returns Whether the slot has any assigned elements.
|
|
66
72
|
*
|
|
@@ -73,6 +79,7 @@ export declare function slotChangeHasAssignedElement(event: Event): boolean;
|
|
|
73
79
|
/**
|
|
74
80
|
* Returns the assigned elements on a `slot` element from the `onSlotchange` event.
|
|
75
81
|
*
|
|
82
|
+
* @public
|
|
76
83
|
* @param event The event.
|
|
77
84
|
* @param selector The CSS selector string to filter the returned elements by.
|
|
78
85
|
* @returns An array of elements.
|
|
@@ -86,6 +93,7 @@ export declare function slotChangeGetAssignedElements<T extends Element>(event:
|
|
|
86
93
|
/**
|
|
87
94
|
* Returns the assigned elements on a `slot` element, filtered by an optional css selector.
|
|
88
95
|
*
|
|
96
|
+
* @public
|
|
89
97
|
* @param slot The slot element.
|
|
90
98
|
* @param selector CSS selector string to filter the returned elements by.
|
|
91
99
|
* @returns An array of elements.
|
package/dist/dom.d.ts
CHANGED
|
@@ -1,30 +1,59 @@
|
|
|
1
|
-
import { nil } from
|
|
2
|
-
import { slotChangeHasContent as slotChangeHasContentAlias, slotChangeGetTextContent as slotChangeGetTextContentAlias, slotChangeHasTextContent as slotChangeHasTextContentAlias, slotChangeHasAssignedNode as slotChangeHasAssignedNodeAlias, slotChangeGetAssignedNodes as slotChangeGetAssignedNodesAlias, slotChangeHasAssignedElement as slotChangeHasAssignedElementAlias, slotChangeGetAssignedElements as slotChangeGetAssignedElementsAlias, getSlotAssignedElements as getSlotAssignedElementsAlias } from
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { nil } from "./type.ts";
|
|
2
|
+
import { slotChangeHasContent as slotChangeHasContentAlias, slotChangeGetTextContent as slotChangeGetTextContentAlias, slotChangeHasTextContent as slotChangeHasTextContentAlias, slotChangeHasAssignedNode as slotChangeHasAssignedNodeAlias, slotChangeGetAssignedNodes as slotChangeGetAssignedNodesAlias, slotChangeHasAssignedElement as slotChangeHasAssignedElementAlias, slotChangeGetAssignedElements as slotChangeGetAssignedElementsAlias, getSlotAssignedElements as getSlotAssignedElementsAlias } from "./dom/slots.ts";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
* @deprecated import { slotChangeHasContent } from "@arcgis/toolkit/dom/slots"; instead
|
|
6
|
+
* */
|
|
5
7
|
export declare const slotChangeHasContent: typeof slotChangeHasContentAlias;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
* @deprecated import { slotChangeGetTextContent } from "@arcgis/toolkit/dom/slots"; instead
|
|
11
|
+
*/
|
|
7
12
|
export declare const slotChangeGetTextContent: typeof slotChangeGetTextContentAlias;
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
* @deprecated import { slotChangeHasTextContent } from "@arcgis/toolkit/dom/slots"; instead
|
|
16
|
+
*/
|
|
9
17
|
export declare const slotChangeHasTextContent: typeof slotChangeHasTextContentAlias;
|
|
10
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* @deprecated import { slotChangeHasAssignedNode } from "@arcgis/toolkit/dom/slots"; instead
|
|
21
|
+
*/
|
|
11
22
|
export declare const slotChangeHasAssignedNode: typeof slotChangeHasAssignedNodeAlias;
|
|
12
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
* @deprecated import { slotChangeGetAssignedNodes } from "@arcgis/toolkit/dom/slots"; instead
|
|
26
|
+
*/
|
|
13
27
|
export declare const slotChangeGetAssignedNodes: typeof slotChangeGetAssignedNodesAlias;
|
|
14
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
* @deprecated import { slotChangeHasAssignedElement } from "@arcgis/toolkit/dom/slots"; instead
|
|
31
|
+
*/
|
|
15
32
|
export declare const slotChangeHasAssignedElement: typeof slotChangeHasAssignedElementAlias;
|
|
16
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
* @deprecated import { slotChangeGetAssignedElements } from "@arcgis/toolkit/dom/slots"; instead
|
|
36
|
+
*/
|
|
17
37
|
export declare const slotChangeGetAssignedElements: typeof slotChangeGetAssignedElementsAlias;
|
|
18
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
* @deprecated import { getSlotAssignedElements } from "@arcgis/toolkit/dom/slots"; instead
|
|
41
|
+
*/
|
|
19
42
|
export declare const getSlotAssignedElements: typeof getSlotAssignedElementsAlias;
|
|
20
|
-
|
|
43
|
+
import { resolveReferenceElement as resolveReferenceElementAlias } from "./dom/referenceElement.ts";
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
* @deprecated import { resolveReferenceElement } from "@arcgis/toolkit/dom/reference-element"; instead
|
|
47
|
+
*/
|
|
21
48
|
export declare const resolveReferenceElement: typeof resolveReferenceElementAlias;
|
|
22
49
|
/**
|
|
23
50
|
* Combine multiple class names into a single string.
|
|
24
51
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
52
|
+
* > This function is less necessary in Lumina packages as the `class` JSX prop
|
|
53
|
+
* > accepts `Record<string, boolean>` objects.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
* @param classes
|
|
28
57
|
*/
|
|
29
58
|
export declare const classes: (...classes: (nil | Record<string, boolean> | string[] | string | false)[]) => string;
|
|
30
59
|
/**
|
|
@@ -32,6 +61,7 @@ export declare const classes: (...classes: (nil | Record<string, boolean> | stri
|
|
|
32
61
|
* If the attributes have been changed in the ancestor tree then the callback
|
|
33
62
|
* will be invoked.
|
|
34
63
|
*
|
|
64
|
+
* @public
|
|
35
65
|
* @param element The element on which to observe the attribute mutations.
|
|
36
66
|
* @param attributeFilter The list of attributes to observe.
|
|
37
67
|
* @param callback The callback to invoke when the attributes have been changed.
|
|
@@ -51,14 +81,15 @@ export declare const observeAncestorsMutation: (element: Node, attributeFilter:
|
|
|
51
81
|
* Find the closest element that matches the selector.
|
|
52
82
|
* It will traverse the element's ancestors to find the target element.
|
|
53
83
|
* Shadow DOM boundaries are also taken into account.
|
|
84
|
+
*
|
|
85
|
+
* > This is similar to [Element.closest()](https://developer.mozilla.org/docs/Web/API/Element/closest),
|
|
86
|
+
* > but the DOM's utility only looks up until the first shadow boundary.
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
54
89
|
* @param base The element to start the search from.
|
|
55
90
|
* @param selector The selector to match.
|
|
56
91
|
* @returns The closest element that matches the selector or null if not found.
|
|
57
92
|
*
|
|
58
|
-
* @remarks
|
|
59
|
-
* This is similar to [Element.closest()](https://developer.mozilla.org/docs/Web/API/Element/closest),
|
|
60
|
-
* but the DOM's utility only looks up until the first shadow boundary.
|
|
61
|
-
*
|
|
62
93
|
* @example
|
|
63
94
|
* ```ts
|
|
64
95
|
* const hostElement = getClosestElement(element, "arcgis-map, arcgis-scene");
|
|
@@ -71,32 +102,32 @@ export declare const getClosestElement: <T = Element>(base: Element, selector: s
|
|
|
71
102
|
* ancestors to find the theme. Shadow DOM boundaries are also
|
|
72
103
|
* taken into account.
|
|
73
104
|
*
|
|
74
|
-
*
|
|
105
|
+
* > It is advised to consider alternative solutions before using this utility:
|
|
106
|
+
* > - Calcite CSS variables. Benefits: makes styles more consistent,
|
|
107
|
+
* > and variables are updated automatically to match dark/light theme.
|
|
108
|
+
* > - Detect dark mode using CSS selectors and apply styles in CSS.
|
|
109
|
+
* > Benefit: styles update automatically when the theme changes.
|
|
110
|
+
*
|
|
111
|
+
* @public
|
|
112
|
+
* @param el The element to start the search from.
|
|
75
113
|
* @returns The theme of the element ("light" or "dark"). "light" is the default.
|
|
76
114
|
*
|
|
77
|
-
* @remarks
|
|
78
|
-
* It is advised to consider alternative solutions before using this utility:
|
|
79
|
-
* - Calcite CSS variables. Benefits: makes styles more consistent,
|
|
80
|
-
* and variables are updated automatically to match dark/light theme.
|
|
81
|
-
* - Detect dark mode using CSS selectors and apply styles in CSS.
|
|
82
|
-
* Benefit: styles update automatically when the theme changes.
|
|
83
115
|
*/
|
|
84
116
|
export declare function unsafeGetCalciteModeName(el: HTMLElement): "dark" | "light";
|
|
85
117
|
/**
|
|
86
118
|
* Get direction property of the closest element.
|
|
87
119
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
120
|
+
* > Do not set the `dir` property on the element itself. Do not set the `dir`
|
|
121
|
+
* > attribute on the components you are rendering. The `dir` attribute is only
|
|
122
|
+
* > meant to be set by the consumers of your component. Your component is
|
|
123
|
+
* > expected to respect what was set by the consumer.
|
|
90
124
|
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* attribute on the components you are rendering. The `dir` attribute is only
|
|
94
|
-
* meant to be set by the consumers of your component. Your component is
|
|
95
|
-
* expected to respect what was set by the consumer.
|
|
125
|
+
* > Prefer [useDirection()](https://webgis.esri.com/references/lumina/controllers/useDirection)
|
|
126
|
+
* > to ensure your component is responsive to direction changes.
|
|
96
127
|
*
|
|
97
|
-
* @
|
|
98
|
-
*
|
|
99
|
-
*
|
|
128
|
+
* @public
|
|
129
|
+
* @param el The element to start the search from.
|
|
130
|
+
* @returns The direction of the element ("ltr" | "rtl"). "ltr" is the default.
|
|
100
131
|
*/
|
|
101
132
|
export declare const unsafeGetElementDirection: (el: HTMLElement) => "ltr" | "rtl";
|
|
102
133
|
/**
|
|
@@ -104,6 +135,10 @@ export declare const unsafeGetElementDirection: (el: HTMLElement) => "ltr" | "rt
|
|
|
104
135
|
* Shadow DOM boundaries are also taken into account.
|
|
105
136
|
* If the attribute is not found then the fallback value is returned.
|
|
106
137
|
*
|
|
138
|
+
* @public
|
|
139
|
+
* @param el
|
|
140
|
+
* @param attributeName
|
|
141
|
+
* @param fallbackValue
|
|
107
142
|
* @example
|
|
108
143
|
* ```ts
|
|
109
144
|
* const dir = getElementAttribute(element, "dir", "ltr");
|
|
@@ -112,10 +147,15 @@ export declare const unsafeGetElementDirection: (el: HTMLElement) => "ltr" | "rt
|
|
|
112
147
|
export declare const getElementAttribute: (el: Element, attributeName: string, fallbackValue: string) => string;
|
|
113
148
|
/**
|
|
114
149
|
* Focus the element if it is focusable.
|
|
150
|
+
*
|
|
151
|
+
* @public
|
|
152
|
+
* @param el
|
|
115
153
|
* @returns A promise that resolves once the focus is set.
|
|
116
154
|
*/
|
|
117
155
|
export declare const focusElement: (el: FocusableElement | undefined) => Promise<void>;
|
|
156
|
+
/** @public */
|
|
118
157
|
export interface FocusableElement extends HTMLElement {
|
|
158
|
+
/** @public */
|
|
119
159
|
setFocus?: () => Promise<void>;
|
|
120
160
|
}
|
|
121
161
|
/**
|
|
@@ -124,6 +164,8 @@ export interface FocusableElement extends HTMLElement {
|
|
|
124
164
|
* Shadow DOM boundaries are also taken into account.
|
|
125
165
|
* If the element is not found then the focus is not set.
|
|
126
166
|
* Example: `setFocusOnElement(element, "[role='menuitem']");`
|
|
167
|
+
*
|
|
168
|
+
* @public
|
|
127
169
|
* @param ref The element to start the search from.
|
|
128
170
|
* @param selector The selector to match.
|
|
129
171
|
* @returns Returns true if the focus is set on the element.
|
package/dist/error.d.ts
CHANGED
|
@@ -10,23 +10,34 @@
|
|
|
10
10
|
* - `process.env.NODE_ENV === "development"`
|
|
11
11
|
* - `process.env.NODE_ENV === "test"`
|
|
12
12
|
*
|
|
13
|
+
* > This function is primary for usage in support packages. In Lumina component
|
|
14
|
+
* > packages, simpler alternatives are provided:
|
|
15
|
+
* > https://webgis.esri.com/references/lumina/publishing#bundling-code-conditionally
|
|
16
|
+
*
|
|
13
17
|
* [Documentation](https://webgis.esri.com/references/lumina/publishing#internal-esri-environment)
|
|
14
18
|
*
|
|
15
|
-
* @
|
|
16
|
-
* This function is primary for usage in support packages. In Lumina component
|
|
17
|
-
* packages, simpler alternatives are provided:
|
|
18
|
-
* https://webgis.esri.com/references/lumina/publishing#bundling-code-conditionally
|
|
19
|
+
* @public
|
|
19
20
|
*/
|
|
20
21
|
export declare const isEsriInternalEnv: () => boolean;
|
|
21
22
|
/**
|
|
22
23
|
* Calls a sync method and catch any errors. Returns undefined if error occurred.
|
|
23
24
|
*
|
|
24
25
|
* Can also provide a thisContext and rest arguments
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
* @param callback
|
|
29
|
+
* @param thisContext
|
|
30
|
+
* @param rest
|
|
25
31
|
*/
|
|
26
32
|
export declare const safeCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => ReturnType<Callback> | void;
|
|
27
33
|
/**
|
|
28
34
|
* Calls an async method and catch any errors. Returns undefined if error occurred.
|
|
29
35
|
*
|
|
30
36
|
* Can also provide a thisContext and rest arguments
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
* @param callback
|
|
40
|
+
* @param thisContext
|
|
41
|
+
* @param rest
|
|
31
42
|
*/
|
|
32
43
|
export declare const safeAsyncCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => Promise<Awaited<ReturnType<Callback>> | void>;
|
package/dist/function.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Useful when providing a "mapping function" is required, but you have no need
|
|
5
5
|
* to change the value
|
|
6
6
|
*
|
|
7
|
+
* @public
|
|
8
|
+
* @param value
|
|
7
9
|
* @privateRemarks
|
|
8
10
|
* This is a trivial function, but it helps workaround a TypeScript bug:
|
|
9
11
|
* https://devtopia.esri.com/WebGIS/webgis-sdk/issues/2047
|
|
@@ -12,6 +14,7 @@ export declare const identity: <T>(value: T) => T;
|
|
|
12
14
|
/**
|
|
13
15
|
* Allows to debounce a function.
|
|
14
16
|
*
|
|
17
|
+
* @public
|
|
15
18
|
* @param func Function to be debounced
|
|
16
19
|
* @param waitFor Debounce time in milliseconds
|
|
17
20
|
* @returns Returns a function that can be called to debounce the original function
|
package/dist/intl/dom.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { GenericT9nStrings, SupportedLocale } from
|
|
1
|
+
import { type GenericT9nStrings, type SupportedLocale } from "../intl.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Get the locale of the given element.
|
|
4
4
|
* It will look for the lang attribute on the element and its ancestors.
|
|
5
5
|
* If not lang is found, it will default to 'en'.
|
|
6
6
|
*
|
|
7
|
+
* @public
|
|
8
|
+
* @param element
|
|
7
9
|
* @returns an object with the `lang` and `t9nLocale` properties.
|
|
8
10
|
*
|
|
9
11
|
* @see [lang vs t9nLocale](https://webgis.esri.com/references/lumina/controllers/useT9n#difference-between-lang-and-t9nlocale).
|
|
@@ -18,6 +20,11 @@ export declare const getElementLocale: (element: HTMLElement) => {
|
|
|
18
20
|
* It will observe the lang attribute on the component and its ancestors.
|
|
19
21
|
* The callback is called once at the beginning.
|
|
20
22
|
*
|
|
23
|
+
* > Rather than using this function directly, prefer the
|
|
24
|
+
* > [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
|
|
25
|
+
* > controller.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
21
28
|
* @param element The HTML element that is doing the fetching
|
|
22
29
|
* This is used to determine the locale to fetch, observe the `lang` attribute
|
|
23
30
|
* changes, and is used as the default value for the `assetName` parameter.
|
|
@@ -31,11 +38,6 @@ export declare const getElementLocale: (element: HTMLElement) => {
|
|
|
31
38
|
* Set to null if the component has no localization strings, but you still
|
|
32
39
|
* wish to use `startLocaleObserver` to get the locale information.
|
|
33
40
|
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* Rather than using this function directly, prefer the
|
|
36
|
-
* [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
|
|
37
|
-
* controller.
|
|
38
|
-
*
|
|
39
41
|
* @example
|
|
40
42
|
* ```ts
|
|
41
43
|
* const observer = startLocaleObserver(
|
|
@@ -48,16 +50,25 @@ export declare const getElementLocale: (element: HTMLElement) => {
|
|
|
48
50
|
* ```
|
|
49
51
|
*/
|
|
50
52
|
export declare const startLocaleObserver: <Strings extends GenericT9nStrings = GenericT9nStrings>(element: HTMLElement, getAssetsPath: () => string, onUpdated: (payload: LocaleObserverResult<Strings>) => void, assetName?: string | null) => (() => void);
|
|
53
|
+
/** @public */
|
|
51
54
|
export interface LocaleObserverResult<Strings extends GenericT9nStrings = GenericT9nStrings> {
|
|
52
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* The T9N strings of the component
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
53
60
|
t9nStrings: Strings;
|
|
54
61
|
/**
|
|
55
62
|
* The locale of the component set by the `lang` attribute on the component host element or one of its ancestors.
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
56
65
|
*/
|
|
57
66
|
lang: string;
|
|
58
67
|
/**
|
|
59
68
|
* The locale used by the component to load the T9N strings.
|
|
60
69
|
* It may be different than the locale of the component host element that was set by the `lang` attribute.
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
61
72
|
*/
|
|
62
73
|
t9nLocale: SupportedLocale;
|
|
63
74
|
}
|
package/dist/intl.d.ts
CHANGED
|
@@ -1,24 +1,38 @@
|
|
|
1
|
-
import { LocaleObserverResult as LocaleObserverResultAlias } from
|
|
2
|
-
/**
|
|
1
|
+
import { type LocaleObserverResult as LocaleObserverResultAlias } from "./intl/dom.ts";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* @deprecated import { getElementLocale } from "./intl/dom.ts" instead
|
|
5
|
+
*/
|
|
3
6
|
export declare const getElementLocale: (element: HTMLElement) => {
|
|
4
7
|
readonly lang: string;
|
|
5
8
|
readonly t9nLocale: SupportedLocale;
|
|
6
9
|
};
|
|
7
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
* @deprecated import { startLocaleObserver } from "./intl/dom.ts" instead
|
|
13
|
+
*/
|
|
8
14
|
export declare const startLocaleObserver: <Strings extends GenericT9nStrings = GenericT9nStrings>(element: HTMLElement, getAssetsPath: () => string, onUpdated: (payload: LocaleObserverResultAlias<Strings>) => void, assetName?: string | null) => (() => void);
|
|
9
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
* @deprecated import type { LocaleObserverResult } from "./intl/dom.ts" instead
|
|
18
|
+
*/
|
|
10
19
|
export type LocaleObserverResult = LocaleObserverResultAlias;
|
|
11
|
-
declare const supportedLocalesArray: ["ar", "bg", "bs", "ca", "cs", "da", "de", "el", "en", "es", "et", "fi", "fr", "he", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "nl", "nb", "no", "pl", "pt-BR", "pt-PT", "ro", "ru", "sk", "sl", "sr", "sv", "th", "tr", "uk", "vi", "zh-CN", "zh-HK", "zh-TW"];
|
|
12
20
|
/**
|
|
13
21
|
* The list of supported locales for ArcGIS Maps SDK for JavaScript components.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
14
24
|
*/
|
|
15
|
-
export declare const supportedLocales: Set<
|
|
25
|
+
export declare const supportedLocales: Set<SupportedLocale>;
|
|
16
26
|
/**
|
|
17
27
|
* TypeScript union type for each locale supported by WebGIS SDK
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
18
30
|
*/
|
|
19
|
-
export type SupportedLocale =
|
|
31
|
+
export type SupportedLocale = "ar" | "bg" | "bs" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "he" | "hr" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "lv" | "nb" | "nl" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "th" | "tr" | "uk" | "vi" | "zh-CN" | "zh-HK" | "zh-TW";
|
|
20
32
|
/**
|
|
21
33
|
* The default locale for WebGIS SDK.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
22
36
|
*/
|
|
23
37
|
export declare const defaultLocale = "en";
|
|
24
38
|
/**
|
|
@@ -27,18 +41,17 @@ export declare const defaultLocale = "en";
|
|
|
27
41
|
* If the locale is not supported, it will default to 'en'.
|
|
28
42
|
* If the T9N strings bundle cannot be found, it will default to 'en'.
|
|
29
43
|
*
|
|
44
|
+
* > Rather than using this function directly, prefer the
|
|
45
|
+
* > [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
|
|
46
|
+
* > controller.
|
|
47
|
+
*
|
|
48
|
+
* > The function implements cache. Frequent calls are safe.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
30
51
|
* @param locale The locale for which to fetch the T9N strings
|
|
31
52
|
* @param assetsPath The path to the assets folder where the T9N strings are located
|
|
32
53
|
* @param prefix The prefix to use for the T9N strings file name.
|
|
33
54
|
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* Rather than using this function directly, prefer the
|
|
36
|
-
* [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
|
|
37
|
-
* controller.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* The function implements cache. Frequent calls are safe.
|
|
41
|
-
*
|
|
42
55
|
* @example
|
|
43
56
|
* ```ts
|
|
44
57
|
* // Will make a request for ./assets/coding-editor/t9n/messages.en.json
|
|
@@ -54,19 +67,23 @@ export declare const defaultLocale = "en";
|
|
|
54
67
|
export declare const fetchT9nStringsBundle: <Strings extends GenericT9nStrings>(locale: string, assetsPath: string, prefix?: string) => Promise<Strings>;
|
|
55
68
|
/**
|
|
56
69
|
* The interface for translated strings.
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
57
72
|
*/
|
|
58
73
|
export interface GenericT9nStrings {
|
|
74
|
+
/** @public */
|
|
59
75
|
[key: string]: GenericT9nStrings | string;
|
|
60
76
|
}
|
|
61
77
|
/**
|
|
62
78
|
* Try to parse any language string into one of the locales supported by WebGIS SDK.
|
|
63
79
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
80
|
+
* > Follows the ArcGIS Maps SDK for JavaScript locale support:
|
|
81
|
+
* > https://developers.arcgis.com/javascript/latest/localization/#locale-support
|
|
82
|
+
*
|
|
83
|
+
* > If language includes a region code, but we don't have a bundle for it, the
|
|
84
|
+
* > language is normalized to the language code only.
|
|
67
85
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
86
|
+
* @public
|
|
87
|
+
* @param lang
|
|
70
88
|
*/
|
|
71
89
|
export declare const normalizeLocale: (lang: string) => SupportedLocale;
|
|
72
|
-
export {};
|
package/dist/log.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @public */
|
|
1
2
|
export type LogLevel = "error" | "info" | "warn";
|
|
3
|
+
/** @public */
|
|
2
4
|
type CustomElementLike = {
|
|
3
5
|
el: {
|
|
4
6
|
localName: string;
|
|
@@ -6,17 +8,30 @@ type CustomElementLike = {
|
|
|
6
8
|
} | {
|
|
7
9
|
localName: string;
|
|
8
10
|
};
|
|
11
|
+
/** @public */
|
|
9
12
|
type AccessorLike = {
|
|
10
13
|
declaredClass: string;
|
|
11
14
|
};
|
|
15
|
+
/** @public */
|
|
12
16
|
export type LogContext = AccessorLike | CustomElementLike | string;
|
|
17
|
+
/** @public */
|
|
13
18
|
type LogOptions = {
|
|
14
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Whether the message should only be logged once.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
15
24
|
once?: boolean;
|
|
16
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Additional objects to log after `message`. Use this to avoid memory leaks when logging objects to the console. Each object value will be automatically wrapped in a `WeakRef` before logging so it can be garbage-collected.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
17
30
|
detail?: Record<string, unknown>;
|
|
18
31
|
};
|
|
32
|
+
/** @public */
|
|
19
33
|
type EsriConfig = {
|
|
34
|
+
/** @public */
|
|
20
35
|
log: {
|
|
21
36
|
/**
|
|
22
37
|
* @link {https://developers.arcgis.com/javascript/latest/references/core/config/#LogInterceptor}
|
|
@@ -25,9 +40,11 @@ type EsriConfig = {
|
|
|
25
40
|
};
|
|
26
41
|
};
|
|
27
42
|
/**
|
|
28
|
-
* Workaround for setting
|
|
29
|
-
* @see
|
|
30
|
-
*
|
|
43
|
+
* Workaround for setting [log interceptors](https://developers.arcgis.com/javascript/latest/references/core/config/#log) and maintaining compatibility with [js-api's interceptor usage](https://devtopia.esri.com/WebGIS/arcgis-websceneviewer-app/blob/8f0a1bbcf12d1193134d94589d9e187f0afa72fa/src/js/support/ApiLoggerInstrumentation.ts#L17).
|
|
44
|
+
* @see https://devtopia.esri.com/WebGIS/arcgis-js-api/discussions/74935
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
* @param config https://developers.arcgis.com/javascript/latest/references/core/config/
|
|
31
48
|
* @example
|
|
32
49
|
* ```ts
|
|
33
50
|
* // IMPORTANT: do this only in config.ts or another early-loaded module
|
|
@@ -45,12 +62,13 @@ export declare const setEsriConfig: (config: EsriConfig) => void;
|
|
|
45
62
|
/**
|
|
46
63
|
* Helper utility for logging messages in a consistent manner.
|
|
47
64
|
*
|
|
65
|
+
* @public
|
|
48
66
|
* @param level The log level
|
|
49
67
|
* @param context The context of the log message (e.g., `this` inside a Lit-like component, or just a custom string)
|
|
50
68
|
* @param message A custom message to log
|
|
51
69
|
* @param options Additional options for logging, such as to provide a context object
|
|
52
70
|
*
|
|
53
|
-
* @see
|
|
71
|
+
* @see {@link log!setEsriConfig}
|
|
54
72
|
*
|
|
55
73
|
* @example
|
|
56
74
|
* ```ts
|
|
@@ -71,6 +89,7 @@ export declare const log: (level: LogLevel, context: LogContext, message: string
|
|
|
71
89
|
* Rethrows an error and prepends context information to the error message. The error is
|
|
72
90
|
* thrown asynchronously to avoid interrupting the current execution stack, so it cannot be caught
|
|
73
91
|
* with `try/catch` and will bubble to the global object.
|
|
92
|
+
* @public
|
|
74
93
|
* @param context From where the error is being thrown (e.g., `this` inside a Lit-like component, or just a custom string)
|
|
75
94
|
* @returns A function that can be used in `try-catch`/`.catch` to rethrow an error
|
|
76
95
|
*
|
|
@@ -89,10 +108,17 @@ export declare const log: (level: LogLevel, context: LogContext, message: string
|
|
|
89
108
|
* ```
|
|
90
109
|
*/
|
|
91
110
|
export declare const rethrowError: (context: LogContext) => ((error: unknown) => void);
|
|
111
|
+
/** @public */
|
|
92
112
|
type LogContextOrObject = Exclude<LogContext, string> | object;
|
|
113
|
+
/**
|
|
114
|
+
* @public
|
|
115
|
+
* @privateRemarks
|
|
116
|
+
* https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
|
|
117
|
+
*/
|
|
93
118
|
type InferPropertyType<T extends LogContextOrObject> = [object] extends [T] ? string : keyof T;
|
|
94
119
|
/**
|
|
95
120
|
* Returns a string that can be used in log messages for missing required properties.
|
|
121
|
+
* @public
|
|
96
122
|
* @param property The name of the required property
|
|
97
123
|
* @example
|
|
98
124
|
* ```ts
|
|
@@ -105,6 +131,7 @@ type InferPropertyType<T extends LogContextOrObject> = [object] extends [T] ? st
|
|
|
105
131
|
export declare const composeMissingPropertyMessage: <T extends LogContextOrObject = object>(property: InferPropertyType<T>) => string;
|
|
106
132
|
/**
|
|
107
133
|
* Returns a string that can be used in log messages for empty required arrays.
|
|
134
|
+
* @public
|
|
108
135
|
* @param property The name of the required property
|
|
109
136
|
* @example
|
|
110
137
|
* ```ts
|
|
@@ -117,6 +144,11 @@ export declare const composeMissingPropertyMessage: <T extends LogContextOrObjec
|
|
|
117
144
|
export declare const composeEmptyPropertyMessage: <T extends LogContextOrObject = object>(property: InferPropertyType<T>) => string;
|
|
118
145
|
/**
|
|
119
146
|
* Logs a warning message for deprecated object properties.
|
|
147
|
+
* @public
|
|
148
|
+
* @param context
|
|
149
|
+
* @param oldName
|
|
150
|
+
* @param newName
|
|
151
|
+
* @param options
|
|
120
152
|
* @example
|
|
121
153
|
* ```ts
|
|
122
154
|
* logDeprecatedProperty(this, "oldName", "newName", {
|
package/dist/number.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Clamps a value between a minimum and maximum value.
|
|
3
3
|
*
|
|
4
|
+
* @public
|
|
4
5
|
* @param value The number to clamp.
|
|
5
6
|
* @param min The minimum value.
|
|
6
7
|
* @param max The maximum value.
|
|
7
|
-
*
|
|
8
8
|
* @returns The clamped value.
|
|
9
9
|
*/
|
|
10
10
|
export declare function clamp(value: number, min: number, max: number): number;
|
|
11
11
|
/**
|
|
12
12
|
* Linearly interpolates between two numbers.
|
|
13
13
|
*
|
|
14
|
+
* @public
|
|
14
15
|
* @param min - The start value.
|
|
15
16
|
* @param max - The end value.
|
|
16
17
|
* @param t - The interpolation factor, typically between 0 and 1.
|
package/dist/predicate.d.ts
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { nil } from
|
|
1
|
+
import type { nil } from "./type.ts";
|
|
2
2
|
/**
|
|
3
|
-
* Safeguard to ensure that an
|
|
4
|
-
* @
|
|
5
|
-
* @
|
|
3
|
+
* Safeguard to ensure that an value is not undefined.
|
|
4
|
+
* @public
|
|
5
|
+
* @param value The value to check.
|
|
6
|
+
* @returns Returns true if the value is not undefined.
|
|
6
7
|
* @example
|
|
7
8
|
* ```ts
|
|
8
9
|
* const arr = [1, undefined, 3];
|
|
9
10
|
* const result = arr.filter(isNotUndefined);
|
|
10
11
|
* ```
|
|
11
12
|
*/
|
|
12
|
-
export declare const isNotUndefined: <T>(
|
|
13
|
+
export declare const isNotUndefined: <T>(value: T | undefined) => value is T;
|
|
13
14
|
/**
|
|
14
|
-
* Safeguard to ensure that an
|
|
15
|
-
* @
|
|
16
|
-
* @
|
|
15
|
+
* Safeguard to ensure that an value is not null.
|
|
16
|
+
* @public
|
|
17
|
+
* @param value The value to check.
|
|
18
|
+
* @returns Returns true if the value is not null.
|
|
17
19
|
*/
|
|
18
|
-
export declare const isNotNull: <T>(
|
|
20
|
+
export declare const isNotNull: <T>(value: T | null) => value is T;
|
|
19
21
|
/**
|
|
20
|
-
* Safeguard to ensure that an
|
|
21
|
-
* @
|
|
22
|
-
* @
|
|
22
|
+
* Safeguard to ensure that an value is not null or undefined.
|
|
23
|
+
* @public
|
|
24
|
+
* @param value The value to check.
|
|
25
|
+
* @returns Returns true if the value is not undefined and not null.
|
|
23
26
|
*/
|
|
24
|
-
export declare const isNotNil: <T>(
|
|
27
|
+
export declare const isNotNil: <T>(value: nil | T) => value is T;
|
package/dist/predicate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const isNotUndefined = (
|
|
2
|
-
const isNotNull = (
|
|
3
|
-
const isNotNil = (
|
|
1
|
+
const isNotUndefined = (value) => value !== void 0;
|
|
2
|
+
const isNotNull = (value) => value !== null;
|
|
3
|
+
const isNotNil = (value) => value != null;
|
|
4
4
|
export {
|
|
5
5
|
isNotNil,
|
|
6
6
|
isNotNull,
|
package/dist/promise.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* A deferred promise.
|
|
3
3
|
* Useful for when you want to return a promise but don't have the value yet.
|
|
4
4
|
*
|
|
5
|
+
* @public
|
|
5
6
|
* @example
|
|
6
7
|
* ```ts
|
|
7
8
|
* const deferred = new Deferred<string>();
|
|
@@ -16,24 +17,31 @@
|
|
|
16
17
|
export declare class Deferred<T> {
|
|
17
18
|
/**
|
|
18
19
|
* The promise that can be awaited.
|
|
20
|
+
* @public
|
|
19
21
|
*/
|
|
20
22
|
promise: Promise<T>;
|
|
21
23
|
/**
|
|
22
24
|
* Creates a new deferred promise.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
23
27
|
*/
|
|
24
28
|
constructor();
|
|
25
29
|
}
|
|
30
|
+
/** @public */
|
|
26
31
|
export interface Deferred<T> {
|
|
27
32
|
/**
|
|
28
33
|
* Resolves the promise.
|
|
34
|
+
* @public
|
|
29
35
|
* @param value The value to resolve the promise with.
|
|
30
|
-
*
|
|
31
36
|
* @privateRemarks
|
|
32
37
|
* Defined as a method to disable covariance checks. Overridden in constructor.
|
|
33
38
|
*/
|
|
34
39
|
resolve(_value: PromiseLike<T> | T): void;
|
|
35
40
|
/**
|
|
36
41
|
* Rejects the promise.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
* @param error
|
|
37
45
|
*/
|
|
38
46
|
reject(_error: unknown): void;
|
|
39
47
|
}
|
|
@@ -42,6 +50,10 @@ export interface Deferred<T> {
|
|
|
42
50
|
* operations.
|
|
43
51
|
* Useful for rate-limiting or to avoid overwhelming resources with too many concurrent operations.
|
|
44
52
|
*
|
|
53
|
+
* @public
|
|
54
|
+
* @param items
|
|
55
|
+
* @param concurrency
|
|
56
|
+
* @param callback
|
|
45
57
|
* @example
|
|
46
58
|
* ```ts
|
|
47
59
|
* const items = [...lotsOfItems];
|
|
@@ -55,6 +67,9 @@ export declare function forEachWithConcurrency<T>(items: readonly T[], concurren
|
|
|
55
67
|
* Like setTimeout(), but does not advance the clock if the program is
|
|
56
68
|
* stopped on a debugger breakpoint.
|
|
57
69
|
*
|
|
70
|
+
* @public
|
|
71
|
+
* @param callback
|
|
72
|
+
* @param timeout
|
|
58
73
|
* @see https://devtopia.esri.com/WebGIS/arcgis-js-api/discussions/60405
|
|
59
74
|
*/
|
|
60
75
|
export declare const devToolsAwareTimeout: (callback: () => void, timeout: number) => ReturnType<typeof setInterval>;
|
package/dist/promise.js
CHANGED
package/dist/string.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Convert kebab-case string to PascalCase
|
|
3
3
|
*
|
|
4
|
+
* @public
|
|
5
|
+
* @param string
|
|
4
6
|
* @example
|
|
5
7
|
* ```ts
|
|
6
8
|
* const pascal = kebabToPascal("my-component-name");
|
|
@@ -10,6 +12,8 @@ export declare const kebabToPascal: (string: string) => string;
|
|
|
10
12
|
/**
|
|
11
13
|
* Convert camelCase string to kebab-case
|
|
12
14
|
*
|
|
15
|
+
* @public
|
|
16
|
+
* @param string
|
|
13
17
|
* @example
|
|
14
18
|
* ```ts
|
|
15
19
|
* const kebab = camelToKebab("myComponentName");
|
|
@@ -20,6 +24,8 @@ export declare const camelToKebab: (string: string) => string;
|
|
|
20
24
|
/**
|
|
21
25
|
* Convert camelCase string to Sentence case.
|
|
22
26
|
*
|
|
27
|
+
* @public
|
|
28
|
+
* @param string
|
|
23
29
|
* @example
|
|
24
30
|
* ```ts
|
|
25
31
|
* const human = camelToHuman("myComponentName");
|
|
@@ -27,26 +33,44 @@ export declare const camelToKebab: (string: string) => string;
|
|
|
27
33
|
* ```
|
|
28
34
|
*/
|
|
29
35
|
export declare const camelToHuman: (string: string) => string;
|
|
30
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Capitalize the first letter of a string.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
* @param string
|
|
41
|
+
*/
|
|
31
42
|
export declare const capitalize: <T extends string>(string: T) => Capitalize<T>;
|
|
32
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Uncapitalize the first letter of a string.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
* @param string
|
|
48
|
+
*/
|
|
33
49
|
export declare const uncapitalize: <T extends string>(string: T) => Uncapitalize<T>;
|
|
34
50
|
/**
|
|
35
51
|
* Add quotes to a string for display purposes.
|
|
36
52
|
* If the string contains a double quote, then single quotes will be used.
|
|
37
53
|
* If the string contains a single quote, then double quotes will be used.
|
|
38
54
|
* If the string contains both, then double quotes will be used and the single quotes will be escaped.
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
* @param value
|
|
39
58
|
*/
|
|
40
59
|
export declare const quoteString: (value: string) => string;
|
|
41
60
|
/**
|
|
42
61
|
* Create a filter expression from a filter word.
|
|
43
62
|
*
|
|
44
|
-
*
|
|
63
|
+
* > Once browser support permits, use `RegExp.escape()` instead.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
* @param filterWord
|
|
45
67
|
* @privateRemarks TODO: DEPRECATE
|
|
46
68
|
*/
|
|
47
69
|
export declare const createFilterExpression: (filterWord: string) => RegExp;
|
|
48
70
|
/**
|
|
49
71
|
* Add LTR marks to a string to ensure it is displayed as LTR even in RTL contexts.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
50
74
|
* @param value The string to add LTR marks to.
|
|
51
75
|
* @returns The string with LTR marks.
|
|
52
76
|
*
|
|
@@ -58,6 +82,8 @@ export declare const createFilterExpression: (filterWord: string) => RegExp;
|
|
|
58
82
|
export declare const addLtrMark: (value: string | undefined) => string;
|
|
59
83
|
/**
|
|
60
84
|
* A string containing a randomly generated, 36 character long v4 UUID.
|
|
85
|
+
*
|
|
86
|
+
* @public
|
|
61
87
|
*/
|
|
62
88
|
export type UUID = ReturnType<typeof crypto.randomUUID>;
|
|
63
89
|
/**
|
|
@@ -69,6 +95,7 @@ export type UUID = ReturnType<typeof crypto.randomUUID>;
|
|
|
69
95
|
* Avoid using GUID and other non-deterministic output in render() as they
|
|
70
96
|
* cause SSR hydration issues and snapshot test instability.
|
|
71
97
|
*
|
|
98
|
+
* @public
|
|
72
99
|
* @example
|
|
73
100
|
* ```ts
|
|
74
101
|
* const id = generateGuid();
|
|
@@ -79,6 +106,8 @@ export declare const generateGuid: () => UUID;
|
|
|
79
106
|
/**
|
|
80
107
|
* Extract the major and minor version from a full version string.
|
|
81
108
|
*
|
|
109
|
+
* @public
|
|
110
|
+
* @param version
|
|
82
111
|
* @example
|
|
83
112
|
* ```ts
|
|
84
113
|
* const minorVersion = getMinorVersion("4.34.0-next.123");
|
|
@@ -93,6 +122,8 @@ export declare const getMinorVersion: (version: string) => string;
|
|
|
93
122
|
* The version number should normally come from package.json.
|
|
94
123
|
*
|
|
95
124
|
* @see https://webgis.esri.com/sdk/contributing/licensing
|
|
125
|
+
* @public
|
|
126
|
+
* @param version
|
|
96
127
|
* @example
|
|
97
128
|
* ```ts
|
|
98
129
|
* const preamble = getPreamble("5.0.1-next.456");
|
|
@@ -104,6 +135,9 @@ export declare const getPreamble: (version: string) => string;
|
|
|
104
135
|
* Replace values in a string using the format {valueName} with the value from the values object.
|
|
105
136
|
* If the value is not found in the values object, then the value is not replaced.
|
|
106
137
|
*
|
|
138
|
+
* @public
|
|
139
|
+
* @param message
|
|
140
|
+
* @param values
|
|
107
141
|
* @deprecated Import from https://next.gha.afd.arcgis.com/javascript/latest/references/core/intl/#substitute instead
|
|
108
142
|
*/
|
|
109
143
|
export declare const setValuesInString: (message: string | null | undefined, values?: Record<string, string>) => string;
|
|
@@ -113,6 +147,9 @@ export declare const setValuesInString: (message: string | null | undefined, val
|
|
|
113
147
|
*
|
|
114
148
|
* Throws when the named region cannot be found or is missing its closing marker.
|
|
115
149
|
*
|
|
150
|
+
* @public
|
|
151
|
+
* @param source
|
|
152
|
+
* @param regionName
|
|
116
153
|
* @example
|
|
117
154
|
* ```ts
|
|
118
155
|
* import code from "my-code-file.ts?raw";
|
package/dist/type.d.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A convenient alias for `null | undefined`.
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* > Named `nil` over `Nil` as per https://devtopia.esri.com/WebGIS/arcgis-js-api/pull/66920
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
4
7
|
*/
|
|
5
8
|
export type nil = null | undefined;
|
|
6
9
|
/**
|
|
10
|
+
* @public
|
|
7
11
|
* @deprecated import type { ResourceHandle } from "@arcgis/core/core/Handles.js";
|
|
8
12
|
*/
|
|
9
13
|
export type IHandle = {
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
* @deprecated import type { ResourceHandle } from "@arcgis/core/core/Handles.js";
|
|
17
|
+
*/
|
|
10
18
|
remove: () => void;
|
|
11
19
|
};
|
|
12
20
|
/**
|
|
21
|
+
* @public
|
|
13
22
|
* @deprecated Import type { nil } from `@arcgis/toolkit/type` instead
|
|
14
23
|
*/
|
|
15
24
|
export type Nil = nil;
|
|
@@ -23,6 +32,7 @@ export type Nil = nil;
|
|
|
23
32
|
* During production end-application build, such type tests will be removed as
|
|
24
33
|
* they have no runtime impact.
|
|
25
34
|
*
|
|
35
|
+
* @public
|
|
26
36
|
* @privateRemarks
|
|
27
37
|
* Using `0` over `undefined` to take fewer bytes if minifier is disabled.
|
|
28
38
|
*/
|
package/dist/url.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compares two url strings for their origin and returns true if they have the same origin.
|
|
3
3
|
*
|
|
4
|
+
* @public
|
|
4
5
|
* @param url1 First url string
|
|
5
6
|
* @param url2 Second url string
|
|
6
7
|
* @param ignoreProtocol Indicates if protocol comparison should be ignored
|
|
@@ -9,10 +10,10 @@
|
|
|
9
10
|
export declare const hasSameOrigin: (url1: string | null | undefined, url2: string | null | undefined, ignoreProtocol?: boolean) => boolean;
|
|
10
11
|
/**
|
|
11
12
|
* Tests if a url string is a URL or not.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
* @deprecated Use https://developer.mozilla.org/docs/Web/API/URL/parse_static instead
|
|
12
16
|
* @param url The url string to test
|
|
13
17
|
* @returns True if the string is a URL.
|
|
14
|
-
*
|
|
15
|
-
* @remarks If browser support permits, use https://developer.mozilla.org/docs/Web/API/URL/parse_static instead
|
|
16
|
-
* @privateRemarks TODO: DEPRECATE
|
|
17
18
|
*/
|
|
18
19
|
export declare const isURL: (url: string) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/toolkit",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.93",
|
|
4
4
|
"description": "Collection of common internal patterns and utilities for ArcGIS Maps SDK for JavaScript components.",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"sideEffects": false,
|