@arcgis/lumina 5.2.0-next.2 → 5.2.0-next.21

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.
Files changed (58) hide show
  1. package/dist/{ControllerManager-DpJfvft9.js → ControllerManager-4cSEnB5Y.js} +12 -8
  2. package/dist/{Controller-Cer_6Z29.js → GenericController-C8NSb50b.js} +59 -23
  3. package/dist/LitElement.d.ts +179 -250
  4. package/dist/PublicLitElement.d.ts +64 -30
  5. package/dist/config.d.ts +22 -16
  6. package/dist/context.d.ts +24 -24
  7. package/dist/controllers/Controller.d.ts +106 -139
  8. package/dist/controllers/ControllerInternals.d.ts +33 -25
  9. package/dist/controllers/ControllerManager.d.ts +40 -61
  10. package/dist/controllers/GenericController.d.ts +26 -0
  11. package/dist/controllers/accessor/index.d.ts +6 -4
  12. package/dist/controllers/accessor/index.js +23 -5
  13. package/dist/controllers/accessor/reEmitEvent.d.ts +6 -3
  14. package/dist/controllers/accessor/store.d.ts +21 -14
  15. package/dist/controllers/accessor/useAccessor.d.ts +86 -68
  16. package/dist/controllers/functional.d.ts +11 -4
  17. package/dist/controllers/index.d.ts +35 -36
  18. package/dist/controllers/index.js +5 -7
  19. package/dist/controllers/load.d.ts +3 -2
  20. package/dist/controllers/proxyExports.d.ts +6 -5
  21. package/dist/controllers/toFunction.d.ts +4 -2
  22. package/dist/controllers/trackKey.d.ts +9 -4
  23. package/dist/controllers/trackPropKey.d.ts +8 -2
  24. package/dist/controllers/trackPropertyKey.d.ts +11 -6
  25. package/dist/controllers/types.d.ts +99 -170
  26. package/dist/controllers/useDirection.d.ts +5 -6
  27. package/dist/controllers/useMedia.d.ts +3 -2
  28. package/dist/controllers/usePropertyChange.d.ts +9 -10
  29. package/dist/controllers/useSlottableRequest.d.ts +15 -10
  30. package/dist/controllers/useT9n.d.ts +44 -38
  31. package/dist/controllers/useWatchAttributes.d.ts +6 -3
  32. package/dist/controllers/utils.d.ts +13 -5
  33. package/dist/createEvent.d.ts +32 -32
  34. package/dist/decorators.d.ts +16 -9
  35. package/dist/formAssociatedUtils.d.ts +5 -47
  36. package/dist/globalTypes/importMeta.d.ts +18 -10
  37. package/dist/globalTypes/index.d.ts +6 -4
  38. package/dist/globalTypes/jsxGlobals.d.ts +36 -23
  39. package/dist/globalTypes/loadLitCss.d.ts +61 -40
  40. package/dist/globalTypes/viteEnv.d.ts +60 -26
  41. package/dist/hmrSupport.d.ts +24 -28
  42. package/dist/index.d.ts +17 -16
  43. package/dist/index.js +27 -7
  44. package/dist/jsx/baseTypes.d.ts +26 -26
  45. package/dist/jsx/directives.d.ts +30 -42
  46. package/dist/jsx/generatedTypes.d.ts +3002 -2923
  47. package/dist/jsx/types.d.ts +214 -171
  48. package/dist/jsx/utils.d.ts +19 -14
  49. package/dist/lazyLoad.d.ts +31 -110
  50. package/dist/makeRuntime.d.ts +104 -127
  51. package/dist/{proxyExports-BkN6hND0.js → proxyExports-ZRLty8oJ.js} +1 -1
  52. package/dist/render.d.ts +4 -2
  53. package/dist/utils.d.ts +9 -14
  54. package/dist/wrappersUtils.d.ts +25 -26
  55. package/package.json +7 -4
  56. package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +0 -14
  57. package/dist/lifecycleSupport.d.ts +0 -8
  58. package/dist/tests/wrappersUtils.typeTest.d.ts +0 -1
@@ -1,17 +1,9 @@
1
- import { CSSResultGroup, CSSResultOrNative, PropertyValues, ReactiveController, LitElement as OriginalLitElement } from 'lit';
2
- import { Runtime } from './makeRuntime.ts';
3
- import { ProxyComponent } from './lazyLoad.ts';
4
- import { ToElement } from './jsx/types.ts';
5
- import { BaseController, LuminaPropertyDeclaration } from './controllers/types.ts';
6
- import { ControllerManager } from './controllers/ControllerManager.ts';
7
- import { Controller } from './controllers/Controller.ts';
8
- import { FormAssociatedEvents } from './formAssociatedUtils.ts';
9
- type ComponentLifecycle = {
10
- connectedCallback?: () => void;
11
- disconnectedCallback?: () => void;
12
- load?: () => Promise<void> | void;
13
- loaded?: () => void;
14
- };
1
+ import type { ReactiveController, LitElement as OriginalLitElement } from "lit";
2
+ import type { ToElement } from "./jsx/types.js";
3
+ import type { BaseController } from "./controllers/types.js";
4
+ import type { ControllerManager } from "./controllers/ControllerManager.js";
5
+ import type { FormAssociatedEvents } from "./formAssociatedUtils.js";
6
+
15
7
  /**
16
8
  * Base Lit class that should be used by all components instead of the original
17
9
  * Lit element.
@@ -23,9 +15,8 @@ type ComponentLifecycle = {
23
15
  * (like componentWillLoad and componentDidLoad in Stencil)
24
16
  * - Provides a .listen() method like Stencil's \@Listen decorator
25
17
  *
26
- * @remarks
27
18
  * Even though all components will extend this class, it is not exposed in the
28
- * public typings as we do not want to expose internal methods like
19
+ * public types as we do not want to expose internal methods like
29
20
  * addController() and connectedCallback() to the public typings.
30
21
  *
31
22
  * Instead, `@arcgis/lumina-compiler` will make it appear that your component
@@ -34,239 +25,177 @@ type ComponentLifecycle = {
34
25
  * `PublicLitElement` will never be called at runtime - it exists for typings
35
26
  * only.
36
27
  */
37
- export declare class LitElement extends OriginalLitElement implements ComponentLifecycle {
38
- #private;
39
- /**
40
- * @private
41
- * @remarks
42
- * We prefix private variables with double underscore to avoid collisions with
43
- * subclasses. All runtime properties that start with underscore are mangled
44
- * in production build, so collision avoidance is mainly important to avoid
45
- * triggering TypeScript errors.
46
- */
47
- static __runtime: Runtime;
48
- /** @private */
49
- static __tagName: string;
50
- static elementProperties: Map<PropertyKey, LuminaPropertyDeclaration>;
51
- /**
52
- * Customize Lit's default style handling to support non-shadow-root styles
53
- */
54
- static finalizeStyles(styles?: CSSResultGroup): CSSResultOrNative[];
55
- static createProperty(name: PropertyKey,
56
- /**
57
- * While in vanilla Lit this type is always LuminaPropertyDeclaration,
58
- * in Lumina it is always number or
59
- * [number,LuminaPropertyDeclaration], so we don't even check for the
60
- * LuminaPropertyDeclaration case. LuminaPropertyDeclaration is here
61
- * only to satisfy the type checker.
62
- */
63
- options?: LuminaPropertyDeclaration | number | [number, LuminaPropertyDeclaration]): void;
64
- protected static getPropertyDescriptor(name: PropertyKey, key: string | symbol, options: LuminaPropertyDeclaration): PropertyDescriptor | undefined;
65
- /**
66
- * Since we can't pass arguments to web component constructor, before lazy
67
- * loading logic calls document.createElement(), it temporary sets this static
68
- * property.
69
- *
70
- * @private
71
- * */
72
- static __lazy: ProxyComponent | undefined;
73
- static readonly lumina = true;
74
- /**
75
- * In lazy build, the actual DOM element differs from the class instance:
76
- * - "this.el" is a proxy custom element - it's physically present in the DOM
77
- * even before the Lit component is loaded.
78
- * - "this" is the actual Lit component - in case of Lazy builds, it's
79
- * never directly attached to the DOM. Instead, all interactions with the
80
- * proxy are forwarded to the actual Lit component. And, when Lit wants to
81
- * render, it renders into the shadow root of the proxy.
82
- *
83
- * "this.el" should be used instead of "this" for all things involving the
84
- * DOM (addEventListener, querySelector, children, setAttribute,
85
- * MutationObserver, etc...)
86
- *
87
- * @example
88
- * ```ts
89
- * // Generally, you shouldn't have to write logic specific to lazy or non-lazy
90
- * // build, but if you have to, you can detect if you are in a lazy build like so:
91
- * const isLazy = this.el !== this;
92
- * ```
93
- */
94
- readonly el: ToElement<this>;
95
- /**
96
- * Controller does not need to be an instance of the Controller class. Any
97
- * Lit's Reactive controller will work as well. See examples:
98
- * https://lit.dev/docs/composition/controllers/
99
- *
100
- * @private
101
- * @privateRemarks
102
- * For most private names I tried to prefix with __ to not conflict with
103
- * private names on subclasses. However, Lit already has __controllers private.
104
- */
105
- readonly _controllers: (BaseController | Controller<unknown>)[];
106
- /**
107
- * Controller Manager orchestrates all controllers used by this component,
108
- * connecting their lifecycle hooks and providing context information.
109
- */
110
- readonly manager: ControllerManager;
111
- /** @private */
112
- __postLoadDeferred: ProxyComponent["__postLoadDeferred"];
113
- /**
114
- * Direct offspring that should be awaited before loaded() is emitted.
115
- *
116
- * `attachToAncestor()` will add elements to this array
117
- *
118
- * @private
119
- */
120
- __offspringComponents: ProxyComponent["__offspringComponents"];
121
- /**
122
- * For HMR, if the .elementInternals was created, preserve that element
123
- * internals instance across hot reloads. This method lets HMR get a reference
124
- * to element internals in a side-effect free way and without adding production
125
- * bytes.
126
- *
127
- * @private
128
- */
129
- devOnly$PureGetElementInternals?: () => ElementInternals | undefined;
130
- /**
131
- * @see [MDN ElementInternals](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)
132
- */
133
- get elementInternals(): ElementInternals;
134
- constructor();
135
- connectedCallback(): void;
136
- disconnectedCallback(): void;
137
- /**
138
- * Overwrite Lit's default behavior of attaching shadow root to the lit
139
- * element, and instead use this.el to support lazy builds.
140
- *
141
- * Also, support the case when component asked to not use shadow root
142
- */
143
- protected createRenderRoot(): DocumentFragment | HTMLElement;
144
- /**
145
- * Overwriting default shouldUpdate simply to get access to
146
- * "changedProperties" so that we can later provide it to ControllerManager
147
- */
148
- protected shouldUpdate(_changedProperties: PropertyValues): boolean;
149
- protected update(changedProperties: PropertyValues): void;
150
- /**
151
- * A helper for setting event listener on the current component.
152
- *
153
- * The event listener will be removed automatically when component
154
- * disconnects, and added back if component re-comments, thus you don't have
155
- * to clean it up manually.
156
- *
157
- * @remarks
158
- * This listens for any event on the component or one of it's children.
159
- * If you only want to listen for events originating from the component itself
160
- * use `const isSelf = event.target === this.el;` to check.
161
- *
162
- * @example
163
- * ```tsx
164
- * constructor() {
165
- * // Handle click will only be called while component is connected
166
- * this.listen('click', this.handleClick);
167
- * }
168
- * handleClick(event: MouseEvent):void {
169
- * console.log('clicked');
170
- * }
171
- * ```
172
- */
173
- listen<K extends keyof HTMLElementEventMap>(name: K, listener: (this: this, event: HTMLElementEventMap[K]) => unknown, options?: AddEventListenerOptions | boolean): void;
174
- listen<K extends keyof FormAssociatedEvents>(name: K, listener: (this: this, event: FormAssociatedEvents[K]) => unknown, options?: Omit<AddEventListenerOptions, "capture" | "passive"> | boolean): void;
175
- listen(name: string, listener: (this: this, event: Event) => unknown, options?: AddEventListenerOptions | boolean): void;
176
- listen<EventType extends Event = CustomEvent<"Provide type like this.listenOn<ToEvents<ArcgisCounter>['arcgisClick']>() to get type-checked payload type">>(name: string,
177
- /**
178
- * The "NoInfer" here forces type argument to be specified explicitly.
179
- * Without it, the following would be allowed:
180
- * ```tsx
181
- * this.listen("focus",(event:NotFocusEvent)=>{....})
182
- * ```
183
- */
184
- listener: (this: this, event: NoInfer<EventType>) => unknown, options?: AddEventListenerOptions | boolean): void;
185
- /**
186
- * A helper for setting even listener on any element (or window / document).
187
- *
188
- * The event listener will be removed automatically when component
189
- * disconnects, and added back if component re-comments, thus you don't have
190
- * to clean it up manually.
191
- *
192
- * Use cases:
193
- * - Listening for pointer events on the top-most element
194
- * - Listening to events that are emitted exclusively on document/window/body
195
- * - Imperatively listening for events on children components
196
- * - Listening for events on non-Element objects (like Worker, WebSocket, etc)
197
- * - Your component could emit a custom event, and then listen for that event
198
- * on the window. This lets consumer of the component handle the event and
199
- * stop propagation - and if they didn't and event reached the window, your
200
- * component can handle the event itself using the default behavior.
201
- *
202
- * @example
203
- * ```tsx
204
- * constructor() {
205
- * // Handle click will only be called while component is connected
206
- * this.listenOn(window, 'click', this.handleWindowClick);
207
- * }
208
- * handleWindowClick(event: MouseEvent):void {
209
- * console.log('clicked');
210
- * }
211
- * ```
212
- */
213
- listenOn<Name extends keyof WindowEventMap>(target: Window, name: Name, listener: Listener<this, WindowEventMap[Name] & {
214
- currentTarget: Window;
215
- }>, options?: AddEventListenerOptions | boolean): void;
216
- listenOn<Name extends keyof DocumentEventMap>(target: Document, name: Name, listener: Listener<this, DocumentEventMap[Name] & {
217
- currentTarget: Document;
218
- }>, options?: AddEventListenerOptions | boolean): void;
219
- listenOn<Name extends keyof HTMLElementEventMap>(target: HTMLElement, name: Name, listener: Listener<this, HTMLElementEventMap[Name] & {
220
- currentTarget: HTMLElement;
221
- }>, options?: AddEventListenerOptions | boolean): void;
222
- listenOn<EventType extends Event = CustomEvent<"Provide type like this.listenOn<ToEvents<ArcgisCounter>['arcgisClick']>() to get type-checked payload type">, Target = EventTarget>(target: Target, name: string,
223
- /**
224
- * The "NoInfer" here forces type argument to be specified explicitly.
225
- * Without it, the following would be allowed:
226
- * ```tsx
227
- * this.listen("focus",(event:NotFocusEvent)=>{....})
228
- * ```
229
- */
230
- listener: Listener<this, NoInfer<EventType> & {
231
- currentTarget: Target;
232
- }>, options?: AddEventListenerOptions | boolean): void;
233
- /**
234
- * Creates a promise that resolves once the component is fully loaded.
235
- *
236
- * @example
237
- * const map = document.createElement('arcgis-map');
238
- * document.body.append(map);
239
- * map.componentOnReady().then(() => {
240
- * console.log('Map is ready to go!');
241
- * });
242
- */
243
- componentOnReady(): Promise<this>;
244
- /**
245
- * Adds a controller to the host, which connects the controller's lifecycle
246
- * methods to the host's lifecycle.
247
- *
248
- * @remarks
249
- * Even though Lit's LitElement already has addController,
250
- * we overwrite it with a compatible version to have more control over
251
- * timing, and to add support for load/loaded lifecycle hooks.
252
- */
253
- addController(controller: BaseController | ReactiveController): void;
254
- /**
255
- * Removes a controller from the host.
256
- */
257
- removeController(controller: BaseController | ReactiveController): void;
28
+ export class LitElement extends OriginalLitElement {
29
+ static readonly lumina: true;
30
+ /** @internal */
31
+ constructor();
32
+ /**
33
+ * In lazy build, the actual DOM element differs from the class instance:
34
+ * - "this.el" is a proxy custom element - it's physically present in the DOM
35
+ * even before the Lit component is loaded.
36
+ * - "this" is the actual Lit component - in case of Lazy builds, it's
37
+ * never directly attached to the DOM. Instead, all interactions with the
38
+ * proxy are forwarded to the actual Lit component. And, when Lit wants to
39
+ * render, it renders into the shadow root of the proxy.
40
+ *
41
+ * "this.el" should be used instead of "this" for all things involving the
42
+ * DOM (addEventListener, querySelector, children, setAttribute,
43
+ * MutationObserver, etc...)
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * // Generally, you shouldn't have to write logic specific to lazy or non-lazy
48
+ * // build, but if you have to, you can detect if you are in a lazy build like so:
49
+ * const isLazy = this.el !== this;
50
+ * ```
51
+ */
52
+ readonly el: ToElement<this>;
53
+ /** @see [MDN ElementInternals](https://developer.mozilla.org/docs/Web/API/ElementInternals) */
54
+ get elementInternals(): ElementInternals;
55
+ /**
56
+ * Controller Manager orchestrates all controllers used by this component,
57
+ * connecting their lifecycle hooks and providing context information.
58
+ */
59
+ readonly manager: ControllerManager;
60
+ /**
61
+ * Adds a controller to the host, which connects the controller's lifecycle
62
+ * methods to the host's lifecycle.
63
+ *
64
+ * Even though Lit's LitElement already has addController,
65
+ * we overwrite it with a compatible version to have more control over
66
+ * timing, and to add support for load/loaded lifecycle hooks.
67
+ *
68
+ * @param controller
69
+ */
70
+ addController(controller: BaseController | ReactiveController): void;
71
+ /**
72
+ * Creates a promise that resolves once the component is fully loaded.
73
+ *
74
+ * @example
75
+ * ```js
76
+ * const map = document.createElement('arcgis-map');
77
+ * document.body.append(map);
78
+ * map.componentOnReady().then(() => {
79
+ * console.log('Map is ready to go!');
80
+ * });
81
+ * ```
82
+ */
83
+ componentOnReady(): Promise<this>;
84
+ /**
85
+ * A helper for setting event listener on the current component.
86
+ *
87
+ * The event listener will be removed automatically when component
88
+ * disconnects, and added back if component re-comments, thus you don't have
89
+ * to clean it up manually.
90
+ *
91
+ * This listens for any event on the component or one of it's children.
92
+ * If you only want to listen for events originating from the component itself
93
+ * use `const isSelf = event.target === this.el;` to check.
94
+ *
95
+ * @param name
96
+ * @param listener
97
+ * @param options
98
+ * @example
99
+ * ```tsx
100
+ * constructor() {
101
+ * // Handle click will only be called while component is connected
102
+ * this.listen('click', this.handleClick);
103
+ * }
104
+ * handleClick(event: MouseEvent):void {
105
+ * console.log('clicked');
106
+ * }
107
+ * ```
108
+ */
109
+ listen<K extends keyof HTMLElementEventMap>(name: K, listener: (this: this, event: HTMLElementEventMap[K]) => unknown, options?: AddEventListenerOptions | boolean): void;
110
+ /**
111
+ * @param name
112
+ * @param listener
113
+ * @param options
114
+ */
115
+ listen<K extends keyof FormAssociatedEvents>(name: K, listener: (this: this, event: FormAssociatedEvents[K]) => unknown, options?: Omit<AddEventListenerOptions, "capture" | "passive"> | boolean): void;
116
+ /**
117
+ * @param name
118
+ * @param listener
119
+ * @param options
120
+ */
121
+ listen(name: string, listener: (this: this, event: Event) => unknown, options?: AddEventListenerOptions | boolean): void;
122
+ /**
123
+ * @param name
124
+ * @param listener
125
+ * @param options
126
+ */
127
+ listen<EventType extends Event = CustomEvent<"Provide type like this.listenOn<ToEvents<ArcgisCounter>['arcgisClick']>() to get type-checked payload type">>(name: string, listener: (this: this, event: NoInfer<EventType>) => unknown, options?: AddEventListenerOptions | boolean): void;
128
+ /**
129
+ * A helper for setting even listener on any element (or window / document).
130
+ *
131
+ * The event listener will be removed automatically when component
132
+ * disconnects, and added back if component re-comments, thus you don't have
133
+ * to clean it up manually.
134
+ *
135
+ * Use cases:
136
+ * - Listening for pointer events on the top-most element
137
+ * - Listening to events that are emitted exclusively on document/window/body
138
+ * - Imperatively listening for events on children components
139
+ * - Listening for events on non-Element objects (like Worker, WebSocket, etc)
140
+ * - Your component could emit a custom event, and then listen for that event
141
+ * on the window. This lets consumer of the component handle the event and
142
+ * stop propagation - and if they didn't and event reached the window, your
143
+ * component can handle the event itself using the default behavior.
144
+ *
145
+ * @param target
146
+ * @param name
147
+ * @param listener
148
+ * @param options
149
+ * @example
150
+ * ```tsx
151
+ * constructor() {
152
+ * // Handle click will only be called while component is connected
153
+ * this.listenOn(window, 'click', this.handleWindowClick);
154
+ * }
155
+ * handleWindowClick(event: MouseEvent):void {
156
+ * console.log('clicked');
157
+ * }
158
+ * ```
159
+ */
160
+ listenOn<Name extends keyof WindowEventMap>(target: Window, name: Name, listener: Listener<this, WindowEventMap[Name] & { currentTarget: Window; }>, options?: AddEventListenerOptions | boolean): void;
161
+ /**
162
+ * @param target
163
+ * @param name
164
+ * @param listener
165
+ * @param options
166
+ */
167
+ listenOn<Name extends keyof DocumentEventMap>(target: Document, name: Name, listener: Listener<this, DocumentEventMap[Name] & { currentTarget: Document; }>, options?: AddEventListenerOptions | boolean): void;
168
+ /**
169
+ * @param target
170
+ * @param name
171
+ * @param listener
172
+ * @param options
173
+ */
174
+ listenOn<Name extends keyof HTMLElementEventMap>(target: HTMLElement, name: Name, listener: Listener<this, HTMLElementEventMap[Name] & { currentTarget: HTMLElement; }>, options?: AddEventListenerOptions | boolean): void;
175
+ /**
176
+ * @param target
177
+ * @param name
178
+ * @param listener
179
+ * @param options
180
+ */
181
+ listenOn<EventType extends Event = CustomEvent<"Provide type like this.listenOn<ToEvents<ArcgisCounter>['arcgisClick']>() to get type-checked payload type">, Target = EventTarget>(target: Target, name: string, listener: Listener<this, NoInfer<EventType> & { currentTarget: Target; }>, options?: AddEventListenerOptions | boolean): void;
182
+ /**
183
+ * @param target
184
+ * @param name
185
+ * @param listener
186
+ * @param options
187
+ */
188
+ listenOn(target: EventTarget, name: string, listener: Listener<this, Event>, options?: AddEventListenerOptions | boolean): void;
189
+ /**
190
+ * Removes a controller from the host.
191
+ *
192
+ * @param controller
193
+ */
194
+ removeController(controller: BaseController | ReactiveController): void;
258
195
  }
259
- type Listener<ThisType, EventType> = ((this: ThisType, event: EventType) => unknown) | {
260
- handleEvent(event: EventType): unknown;
261
- };
262
- /**
263
- * List of tag names defined by this library.
264
- *
265
- * @private
266
- */
267
- export type GlobalThisWithOwnTagNames = typeof globalThis & {
268
- devOnly$ownTagNames?: Set<string>;
269
- };
196
+
197
+ export type Listener<ThisType, EventType> = ((this: ThisType, event: EventType) => unknown) | { handleEvent(event: EventType): unknown; };
198
+
270
199
  /**
271
200
  * Lumina tracks accesses to JSAPI Accessor properties during render() and
272
201
  * automatically re-renders the component when any tracked property changes.
@@ -276,6 +205,7 @@ export type GlobalThisWithOwnTagNames = typeof globalThis & {
276
205
  * give you time to complete the migration and refactor the code.
277
206
  *
278
207
  * @deprecated Use this as a **temporary** workaround only.
208
+ * @param componentClass
279
209
  * @example
280
210
  * ```ts
281
211
  * import { disableReactiveUtilsIntegration } from "@arcgis/lumina";
@@ -285,5 +215,4 @@ export type GlobalThisWithOwnTagNames = typeof globalThis & {
285
215
  * disableReactiveUtilsIntegration(MyComponent);
286
216
  * ```
287
217
  */
288
- export declare function disableReactiveUtilsIntegration(componentClass: typeof LitElement): void;
289
- export {};
218
+ export function disableReactiveUtilsIntegration(componentClass: typeof LitElement): void;
@@ -1,30 +1,64 @@
1
- import { TargetedEvent } from './jsx/types.ts';
2
- /**
3
- * The base public interface for all `@arcgis/lumina` components
4
- */
5
- export declare class PublicLitElement extends HTMLElement {
6
- private el;
7
- ["@eventTypes"]: Record<never, never>;
8
- /**
9
- * Web components are not constructable via the `new` operator.
10
- * Instead use `document.createElement("some-tag-name")`.
11
- */
12
- protected constructor();
13
- /**
14
- * Creates a promise that resolves once the component is fully loaded.
15
- *
16
- * @example
17
- * const map = document.createElement("arcgis-map");
18
- * document.body.append(map);
19
- * map.componentOnReady().then(() => {
20
- * console.log("Map is ready to go!");
21
- * });
22
- */
23
- componentOnReady(): Promise<this>;
24
- addEventListener<K extends keyof this["@eventTypes"]>(type: K, listener: (this: this, event: TargetedEvent<this, this["@eventTypes"][K]>) => unknown, options?: AddEventListenerOptions | boolean): void;
25
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: this, event: HTMLElementEventMap[K]) => unknown, options?: AddEventListenerOptions | boolean): void;
26
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
27
- removeEventListener<K extends keyof this["@eventTypes"]>(type: K, listener: (this: this, event: TargetedEvent<this, this["@eventTypes"][K]>) => unknown, options?: EventListenerOptions | boolean): void;
28
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: this, event: HTMLElementEventMap[K]) => unknown, options?: EventListenerOptions | boolean): void;
29
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
30
- }
1
+ import type { TargetedEvent } from "./jsx/types.js";
2
+
3
+ /** The base public interface for all `@arcgis/lumina` components */
4
+ export class PublicLitElement extends HTMLElement {
5
+ /**
6
+ * @deprecated
7
+ * Do not directly reference this property.
8
+ * Use EventNames and EventTypes helpers from \@arcgis/core/Evented
9
+ */
10
+ "@eventTypes": unknown;
11
+ /**
12
+ * Web components are not constructable via the `new` operator.
13
+ * Instead use `document.createElement("some-tag-name")`.
14
+ */
15
+ protected constructor();
16
+ el: this;
17
+ /**
18
+ * @param type
19
+ * @param listener
20
+ * @param options
21
+ */
22
+ addEventListener<K extends keyof this["@eventTypes"]>(type: K, listener: (this: this, event: TargetedEvent<this, this["@eventTypes"][K]>) => unknown, options?: AddEventListenerOptions | boolean): void;
23
+ /**
24
+ * @param type
25
+ * @param listener
26
+ * @param options
27
+ */
28
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: this, event: HTMLElementEventMap[K]) => unknown, options?: AddEventListenerOptions | boolean): void;
29
+ /**
30
+ * @param type
31
+ * @param listener
32
+ * @param options
33
+ */
34
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
35
+ /**
36
+ * Creates a promise that resolves once the component is fully loaded.
37
+ *
38
+ * @example
39
+ * const map = document.createElement("arcgis-map");
40
+ * document.body.append(map);
41
+ * map.componentOnReady().then(() => {
42
+ * console.log("Map is ready to go!");
43
+ * });
44
+ */
45
+ componentOnReady(): Promise<this>;
46
+ /**
47
+ * @param type
48
+ * @param listener
49
+ * @param options
50
+ */
51
+ removeEventListener<K extends keyof this["@eventTypes"]>(type: K, listener: (this: this, event: TargetedEvent<this, this["@eventTypes"][K]>) => unknown, options?: EventListenerOptions | boolean): void;
52
+ /**
53
+ * @param type
54
+ * @param listener
55
+ * @param options
56
+ */
57
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: this, event: HTMLElementEventMap[K]) => unknown, options?: EventListenerOptions | boolean): void;
58
+ /**
59
+ * @param type
60
+ * @param listener
61
+ * @param options
62
+ */
63
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
64
+ }
package/dist/config.d.ts CHANGED
@@ -1,22 +1,28 @@
1
- /**
2
- * Configuration options that are shared between `@arcgis/lumina` and
3
- * `@arcgis/lumina-compiler`. To avoid the need of loading DOM modules in Node.js,
4
- * this file is extracted into a separate entrypoint.
5
- */
6
- export declare const lazyMetaGroupJoiner = ";";
7
- export declare const lazyMetaItemJoiner = ",";
8
- export declare const lazyMetaSubItemJoiner = ":";
1
+ export const lazyMetaGroupJoiner: ";";
2
+
3
+ export const lazyMetaItemJoiner: ",";
4
+
5
+ export const lazyMetaSubItemJoiner: ":";
6
+
9
7
  /**
10
8
  * By default in Lit, the `@property()` decorator accepts an object. However, to
11
9
  * keep the bundle size smaller, in production builds, instead of passing it an
12
10
  * object, we pass it a compact number, that gets converted back to an object
13
11
  * in createProperty() at runtime.
14
12
  */
15
- export declare const propertyFlagAttribute: number;
16
- export declare const propertyFlagReflect: number;
17
- export declare const propertyFlagBoolean: number;
18
- export declare const propertyFlagNumber: number;
19
- export declare const propertyFlagState: number;
20
- export declare const propertyFlagReadOnly: number;
21
- export declare const propertyFlagNoAccessor: number;
22
- export declare const propertyFlagUseDefault: number;
13
+ export const propertyFlagAttribute: number;
14
+
15
+ export const propertyFlagReflect: number;
16
+
17
+ export const propertyFlagBoolean: number;
18
+
19
+ export const propertyFlagNumber: number;
20
+
21
+ export const propertyFlagState: number;
22
+
23
+ export const propertyFlagReadOnly: number;
24
+
25
+ /** The name is inverted so that the more common case is "false" */
26
+ export const propertyFlagNoAccessor: number;
27
+
28
+ export const propertyFlagUseDefault: number;