@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,187 +1,116 @@
1
- import { IHandle } from '@arcgis/toolkit/type';
2
- import { ReactiveControllerHost, ReactiveController, PropertyDeclaration, PropertyValues } from 'lit';
3
- import { LitElement } from '../LitElement.ts';
4
- export type TrackKeyResolution = {
5
- readonly key: string;
6
- readonly host: BaseController | LitElement;
7
- /**
8
- * True if property is decorated with a `@state()` or `@property()` decorator
9
- */
10
- readonly isReactive: boolean;
11
- };
12
- /**
13
- * @deprecated use LitElement instead
14
- */
15
- export type BaseComponent = Omit<LitElement, "componentOnReady"> & {
16
- autoDestroyDisabled?: boolean;
17
- destroy?: () => Promise<void>;
18
- };
1
+ import type { IHandle } from "@arcgis/toolkit/type";
2
+ import type { ReactiveController, PropertyDeclaration, PropertyValues } from "lit";
3
+ import type { LitElement } from "../LitElement.js";
4
+
5
+ export interface TrackKeyResolution {
6
+ readonly key: string;
7
+ readonly host: BaseController | LitElement;
8
+ /** True if property is decorated with a `@state()` or `@property()` decorator */
9
+ readonly isReactive: boolean;
10
+ }
11
+
19
12
  /**
20
13
  * Helper utility to get component type from a controller. Can be used in
21
- * "implements"
14
+ * "implements".
15
+ *
16
+ * TypeScript detects errors even without `Use<typeof useHomeViewModel>`, but Use
17
+ * makes errors display in a more readable format.
18
+ *
22
19
  * @example
20
+ * ```ts
23
21
  * const useHomeViewModel = makeViewModelController(newWidgetsHomeHomeViewModel);
24
22
  * export class Home extends LitElement implements Use<typeof useHomeViewModel> {
25
- *
26
- * @remarks
27
- * TypeScript detects errors even without Use<typeof useHomeViewModel>, but Use
28
- * makes errors display in a more readable format
23
+ * ```
29
24
  */
30
25
  export type Use<Callback extends (component: any) => unknown> = Parameters<Callback>[0];
31
- /**
32
- * Base API for a controller. Compatible with Lit's Reactive controllers
33
- */
26
+
27
+ /** Base API for a controller. Compatible with Lit's Reactive controllers */
34
28
  export type ControllerLifecycleMethods = {
35
- readonly hostConnected?: ReactiveController["hostConnected"];
36
- readonly hostDisconnected?: ReactiveController["hostDisconnected"];
37
- readonly hostLoad?: () => Promise<void> | void;
38
- readonly hostLoaded?: () => void;
39
- /**
40
- * Called during the client-side host update, just before the host calls
41
- * its own update.
42
- *
43
- * Code in `update()` can depend on the DOM as it is not called in
44
- * server-side rendering.
45
- */
46
- hostUpdate?(changes: PropertyValues): void;
47
- /**
48
- * Called after a host update, just before the host calls firstUpdated and
49
- * updated. It is not called in server-side rendering.
50
- */
51
- hostUpdated?(changes: PropertyValues): void;
52
- /**
53
- * Called when the component is finally being destroyed (rather than
54
- * temporary disconnected from the DOM)
55
- */
56
- readonly hostDestroy?: () => void;
57
- /**
58
- * lifecycle() is a convenience higher-level callback that:
59
- * - calls the provided callback right away the first time if
60
- * connectedCallback has already happened once
61
- * - otherwise, calls it on connectedCallback
62
- * - calls the callback on each future connectedCallback
63
- * - if you returned a function, or an object like {remove:()=>void}, that
64
- * function will be called on the next disconnectedCallback
65
- *
66
- * This is a bit like useEffect(callback, []) in React
67
- */
68
- readonly hostLifecycle?: () => (() => void)[] | IHandle | IHandle[] | (() => void) | undefined | void;
69
- /**
70
- * Called after component.removeComponent(controller) was called on this
71
- * controller
72
- */
73
- readonly controllerRemoved?: () => void;
74
- };
75
- /**
76
- * Controller host interface, compatible with both Lit's Reactive controllers
77
- * and Stencil's lifecycle.
78
- * These members are added to the component instance by ControllerManager.
79
- *
80
- * @deprecated use LitElement instead
81
- */
82
- export type ControllerHost = {
83
- /**
84
- * Adds a controller to the host, which connects the controller's lifecycle
85
- * methods to the host's lifecycle.
86
- */
87
- addController(controller: BaseController): void;
88
- addController(controller: ReactiveController): void;
89
- /**
90
- * Removes a controller from the host.
91
- */
92
- removeController(controller: BaseController): void;
93
- removeController(controller: ReactiveController): void;
94
- /**
95
- * Requests a host update which is processed asynchronously. The update can
96
- * be waited on via the `updateComplete` property.
97
- *
98
- * @remarks
99
- * It is recommended to provide the property name describing what property
100
- * triggered the update - property name will be provided to the willUpdate()
101
- * lifecycle hook, giving it the ability to react to the change.
102
- *
103
- * @see https://lit.dev/docs/api/ReactiveElement/#ReactiveElement.requestUpdate
104
- */
105
- requestUpdate: (name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration) => void;
106
- readonly updateComplete: ReactiveControllerHost["updateComplete"];
29
+ readonly hostConnected?: ReactiveController["hostConnected"];
30
+ readonly hostDisconnected?: ReactiveController["hostDisconnected"];
31
+ hostLoad?(): Promise<void> | void;
32
+ hostLoaded?(): void;
33
+ /**
34
+ * Called during the client-side host update, just before the host calls
35
+ * its own update.
36
+ *
37
+ * Code in `update()` can depend on the DOM as it is not called in
38
+ * server-side rendering.
39
+ *
40
+ * @param changes
41
+ */
42
+ hostUpdate?(changes: PropertyValues): void;
43
+ /**
44
+ * Called after a host update, just before the host calls firstUpdated and
45
+ * updated. It is not called in server-side rendering.
46
+ *
47
+ * @param changes
48
+ */
49
+ hostUpdated?(changes: PropertyValues): void;
50
+ /**
51
+ * Called when the component is finally being destroyed (rather than
52
+ * temporary disconnected from the DOM)
53
+ */
54
+ hostDestroy?(): void;
55
+ /**
56
+ * lifecycle() is a convenience higher-level callback that:
57
+ * - calls the provided callback right away the first time if
58
+ * connectedCallback has already happened once
59
+ * - otherwise, calls it on connectedCallback
60
+ * - calls the callback on each future connectedCallback
61
+ * - if you returned a function, or an object like {remove:()=>void}, that
62
+ * function will be called on the next disconnectedCallback
63
+ *
64
+ * This is a bit like `useEffect(callback, [])` in React
65
+ */
66
+ hostLifecycle?(): (() => void)[] | IHandle | IHandle[] | (() => void) | undefined | void;
67
+ /**
68
+ * Called after component.removeComponent(controller) was called on this
69
+ * controller
70
+ */
71
+ controllerRemoved?(): void;
107
72
  };
73
+
108
74
  /**
109
75
  * A symbol is used to mark providers/controllers on a component instance.
110
76
  * This helps to distinguish them from regular properties.
77
+ *
78
+ * @internal
111
79
  */
112
- export declare const controllerSymbol: unique symbol;
80
+ export const controllerSymbol: unique symbol;
81
+
113
82
  /**
114
83
  * Adding an optional symbol to satisfy TypeScript
115
84
  * "type Controller has no properties in common with BaseController"
116
85
  */
117
- export type BaseController = ControllerLifecycleMethods & {
118
- readonly [controllerSymbol]?: true;
119
- };
120
- /**
121
- * Property declaration with additional `reaDonly` option (handled by Controllers)
122
- */
123
- export type LuminaPropertyDeclaration = PropertyDeclaration & {
124
- /**
125
- * Declare a property that can't be modified by the developer.
126
- *
127
- * @example
128
- * ```ts
129
- * \@property({ readOnly: true })
130
- * myReadonlyProp = 'initialValue';
131
- * ```
132
- *
133
- * @example
134
- * Inside the component code, you can overwrite the readOnly property like so:
135
- * ```ts
136
- * bypassReadOnly(() => {
137
- * this.myReadonlyProp = 'newValue';
138
- * });
139
- * ```
140
- *
141
- * @example
142
- * Alternatively, you can declare a readOnly prop like so:
143
- *
144
- * ```ts
145
- * \@property()
146
- * get myReadonlyProp(): string {
147
- * return 'someValue';
148
- * }
149
- * ```
150
- */
151
- readonly readOnly?: boolean;
152
- /**
153
- * Short for "changed"
154
- *
155
- * Temporary set during a setter to track whether property is considered
156
- * changed.
157
- * @private
158
- */
159
- c?: boolean;
160
- /**
161
- * Short for "descriptor"
162
- *
163
- * Stores a reference to the property getter and setter. This is overwritten
164
- * in useAccessor to proxy the get/set through the Accessor instance.
165
- * @private
166
- */
167
- d?: PropertyDescriptor;
168
- /**
169
- * The positional index of the Accessor controller to which this property is
170
- * bound.
171
- * @private
172
- */
173
- i?: number;
174
- };
175
- /** @private */
176
- export type AccessorObservableLike = {
177
- /**
178
- * A callback that will be called in the setter if the value hasChanged to
179
- * integrate with Accessor's reactivity notification system.
180
- */
181
- notify: () => void;
182
- };
183
- /** @private */
184
- export type ReactiveTrackingTarget = {
185
- clear: () => void;
186
- destroy: () => void;
187
- };
86
+ export type BaseController = ControllerLifecycleMethods;
87
+
88
+ /** Property declaration with additional `reaDonly` option (handled by Controllers) */
89
+ export interface LuminaPropertyDeclaration extends PropertyDeclaration {
90
+ /**
91
+ * Declare a property that can't be modified by the developer.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * \@property({ readOnly: true })
96
+ * myReadonlyProp = 'initialValue';
97
+ * ```
98
+ * @example
99
+ * Inside the component code, you can overwrite the readOnly property like so:
100
+ * ```ts
101
+ * bypassReadOnly(() => {
102
+ * this.myReadonlyProp = 'newValue';
103
+ * });
104
+ * ```
105
+ * @example
106
+ * Alternatively, you can declare a readOnly prop like so:
107
+ *
108
+ * ```ts
109
+ * \@property()
110
+ * get myReadonlyProp(): string {
111
+ * return 'someValue';
112
+ * }
113
+ * ```
114
+ */
115
+ readonly readOnly?: boolean;
116
+ }
@@ -1,11 +1,10 @@
1
- type Direction = "ltr" | "rtl";
1
+ export type Direction = "ltr" | "rtl";
2
+
2
3
  /**
3
4
  * Finds the closest "dir" attribute to current component and returns it's value.
4
5
  * Watches for changes to "dir" and will re-render your component if needed.
5
6
  *
6
- * Documentation: https://webgis.esri.com/references/lumina/controllers/useDirection
7
- *
8
- * Design decisions: https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987
7
+ * @see https://webgis.esri.com/references/lumina/controllers/useDirection
8
+ * @see [Design decisions](https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987)
9
9
  */
10
- export declare const useDirection: () => Direction;
11
- export {};
10
+ export function useDirection(): Direction;
@@ -3,6 +3,7 @@
3
3
  * whether user asked to use reduced motion, or whether the screen size is above
4
4
  * certain threshold).
5
5
  *
6
- * Documentation: https://webgis.esri.com/references/lumina/controllers/useMedia
6
+ * @param query
7
+ * @see https://webgis.esri.com/references/lumina/controllers/useMedia
7
8
  */
8
- export declare const useMedia: (query: string) => boolean;
9
+ export function useMedia(query: string): boolean;
@@ -1,14 +1,13 @@
1
- import { EventEmitter } from '../createEvent.ts';
2
- import { LitElement } from '../LitElement.ts';
3
- type PropertyChangeController<Component extends LitElement> = <ToWatch extends keyof Component>(...toWatch: ToWatch[]) => EventEmitter<{
4
- name: ToWatch & string;
5
- }>;
1
+ import type { EventEmitter } from "../createEvent.js";
2
+ import type { LitElement } from "../LitElement.js";
3
+
4
+ /** @param toWatch */
5
+ export type PropertyChangeController<Component extends LitElement> = <ToWatch extends keyof Component>(...toWatch: ToWatch[]) => EventEmitter<{ name: ToWatch & string; }>;
6
+
6
7
  /**
7
8
  * Let user easily set watchers for component properties.
8
9
  *
9
- * Documentation: https://webgis.esri.com/references/lumina/controllers/usePropertyChange
10
+ * @param component
11
+ * @see [Documentation](https://webgis.esri.com/references/lumina/controllers/usePropertyChange)
10
12
  */
11
- export declare const usePropertyChange: <Component extends LitElement>(
12
- /** Needed for typings only */
13
- _component?: LitElement) => PropertyChangeController<Component>;
14
- export {};
13
+ export function usePropertyChange<Component extends LitElement>(component?: LitElement): PropertyChangeController<Component>;
@@ -1,15 +1,21 @@
1
- import { EventEmitter } from '../createEvent.ts';
2
- import { LitElement } from '../LitElement.ts';
3
- type SlottableRequestDetail = {
4
- name: string;
5
- slotName: string;
6
- data: unknown;
7
- };
8
- type WatchedProps<Component extends LitElement, ToWatch extends readonly (keyof Component)[]> = Pick<Component, ToWatch[number]>;
1
+ import type { EventEmitter } from "../createEvent.js";
2
+ import type { LitElement } from "../LitElement.js";
3
+
4
+ export interface SlottableRequestDetail {
5
+ name: string;
6
+ slotName: string;
7
+ data: unknown;
8
+ }
9
+
10
+ export type WatchedProps<Component extends LitElement, ToWatch extends readonly (keyof Component)[]> = Pick<Component, ToWatch[number]>;
11
+
9
12
  /**
10
13
  * Watches host properties and emits slottable request details when the
11
14
  * requested slot details are added, removed, or changed.
12
15
  *
16
+ * @param component
17
+ * @param watch
18
+ * @param getDetailsBySlotName
13
19
  * @example
14
20
  * ```ts
15
21
  * const slottableRequest = useSlottableRequest(this, ["item"], ({ item }) => {
@@ -18,5 +24,4 @@ type WatchedProps<Component extends LitElement, ToWatch extends readonly (keyof
18
24
  * return details;
19
25
  * });
20
26
  */
21
- export declare const useSlottableRequest: <Component extends LitElement, const ToWatch extends readonly (keyof Component)[], Detail extends SlottableRequestDetail>(component: Component, watch: ToWatch, getDetailsBySlotName: (component: WatchedProps<Component, ToWatch>) => ReadonlyMap<string, Detail>) => EventEmitter<Detail>;
22
- export {};
27
+ export function useSlottableRequest<Component extends LitElement, const ToWatch extends readonly (keyof Component)[], Detail extends SlottableRequestDetail>(component: Component, watch: ToWatch, getDetailsBySlotName: (component: WatchedProps<Component, ToWatch>) => ReadonlyMap<string, Detail>): EventEmitter<Detail>;
@@ -1,48 +1,54 @@
1
- import { GenericT9nStrings, LocaleObserverResult } from '@arcgis/toolkit/intl';
1
+ import type { GenericT9nStrings, LocaleObserverResult } from "@arcgis/toolkit/intl";
2
+
2
3
  export type T9nMeta<T9nStrings extends GenericT9nStrings> = {
3
- _lang: LocaleObserverResult["lang"];
4
- _t9nLocale: LocaleObserverResult["t9nLocale"];
5
- _loading: boolean;
6
- /**
7
- * The "_overrides" property won't actually exist at runtime and exists only
8
- * to simplify typing like so:
9
- *
10
- * @example
11
- * ```ts
12
- * // Type of the messageOverrides is set automatically based on _overrides:
13
- * @property() messageOverrides?: typeof this.messages._overrides;
14
- * ```
15
- */
16
- _overrides: DeepPartial<T9nStrings>;
17
- /**
18
- * If messageOverrides are in effect, this will contain original strings
19
- */
20
- _original?: T9nStrings;
4
+ _lang: LocaleObserverResult["lang"];
5
+ _t9nLocale: LocaleObserverResult["t9nLocale"];
6
+ _loading: boolean;
7
+ /**
8
+ * The "_overrides" property won't actually exist at runtime and exists only
9
+ * to simplify typing like so:
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * // Type of the messageOverrides is set automatically based on _overrides:
14
+ * \@property() messageOverrides?: typeof this.messages._overrides;
15
+ * ```
16
+ */
17
+ _overrides: DeepPartial<T9nStrings>;
18
+ /** If messageOverrides are in effect, this will contain original strings */
19
+ _original?: T9nStrings;
21
20
  };
22
- type DeepPartial<T> = T extends object ? {
21
+
22
+ export type DeepPartial<T> = T extends object ? {
23
23
  [P in keyof T]?: DeepPartial<T[P]>;
24
24
  } : T;
25
- type Options = {
26
- readonly name?: string | null;
27
- /** @default false */
28
- readonly blocking?: boolean;
29
- };
25
+
26
+ export interface Options {
27
+ /**
28
+ * The name of the bundle to fetch. By default, lowercase tag-name of the
29
+ * component without the "arcgis-" part
30
+ *
31
+ * Set to null if the component has no localization strings, but you still
32
+ * wish to use `useT9n` to get the locale information.
33
+ */
34
+ readonly name?: string | null;
35
+ /** @default false */
36
+ readonly blocking?: boolean;
37
+ }
38
+
30
39
  export interface UseT9n {
31
- <Strings extends GenericT9nStrings>(options: Options & {
32
- readonly blocking: true;
33
- }): Strings & T9nMeta<Strings>;
34
- <Strings extends GenericT9nStrings>(options?: Options & {
35
- readonly blocking?: false;
36
- }): Partial<Strings> & T9nMeta<Strings>;
40
+ /** @param options */
41
+ <Strings extends GenericT9nStrings>(options: Options & { readonly blocking: true; }): Strings & T9nMeta<Strings>;
42
+ /** @param options */
43
+ <Strings extends GenericT9nStrings>(options?: Options & { readonly blocking?: false; }): Partial<Strings> & T9nMeta<Strings>;
37
44
  }
45
+
38
46
  /**
39
47
  * Load component's localization strings.
40
48
  *
41
- * Documentation: https://webgis.esri.com/references/lumina/controllers/useT9n
42
- *
43
- * Design decisions:
44
- * - https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/969
45
- * - https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987
49
+ * @param getAssetPath
50
+ * @see [Documentation](https://webgis.esri.com/references/lumina/controllers/useT9n)
51
+ * @see [Design decisions 1](https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/969)
52
+ * @see [Design decisions 2](https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987)
46
53
  */
47
- export declare const makeT9nController: (getAssetPath: (path: string) => string) => UseT9n;
48
- export {};
54
+ export function makeT9nController(getAssetPath: (path: string) => string): UseT9n;
@@ -1,7 +1,10 @@
1
- import { Controller } from './Controller.ts';
1
+ import type { Controller } from "./Controller.js";
2
+
2
3
  /**
3
4
  * Watch when given attributes change on the component element.
4
5
  *
5
- * Documentation: https://webgis.esri.com/references/lumina/controllers/useWatchAttributes
6
+ * @param attributes
7
+ * @param callback
8
+ * @see https://webgis.esri.com/references/lumina/controllers/useWatchAttributes
6
9
  */
7
- export declare const useWatchAttributes: <T extends string>(attributes: readonly T[], callback: (newValue: string | null, oldValue: string | null, attribute: T) => void) => Controller;
10
+ export function useWatchAttributes<T extends string>(attributes: readonly T[], callback: (newValue: string | null, oldValue: string | null, attribute: T) => void): Controller;
@@ -1,12 +1,20 @@
1
- import { LitElement } from '../LitElement.ts';
2
- import { ControllerLifecycleMethods } from './types.ts';
3
- export declare const isController: (value: unknown) => value is ControllerLifecycleMethods;
1
+ import type { LitElement } from "../LitElement.js";
2
+ import type { ControllerLifecycleMethods } from "./types.js";
3
+
4
+ /** @param value */
5
+ export function isController(value: unknown): value is ControllerLifecycleMethods;
6
+
4
7
  /**
5
8
  * Checks if the argument is a promise by checking if it has a `then` method.
9
+ *
10
+ * @param arg
6
11
  */
7
- export declare const isPromise: <T>(arg: Promise<T> | T) => arg is Promise<T>;
12
+ export function isPromise<T>(arg: Promise<T> | T): arg is Promise<T>;
13
+
8
14
  /**
9
15
  * Get the number of controllers current component has. Can be used to get a
10
16
  * unique id for each controller.
17
+ *
18
+ * @param component
11
19
  */
12
- export declare const getControllersCount: (component: LitElement) => number;
20
+ export function getControllersCount(component: LitElement): number;
@@ -1,42 +1,43 @@
1
- /**
2
- * An event emitter object
3
- */
4
- export type EventEmitter<T = void> = {
5
- emit(payload: T): CustomEvent<T>;
6
- };
1
+ /** An event emitter object. */
2
+ export interface EventEmitter<T = void> {
3
+ /** @param payload */
4
+ emit(payload: T): CustomEvent<T>;
5
+ }
6
+
7
7
  /**
8
8
  * While these defaults don't match DOM defaults (all false), they match
9
9
  * Stencil and Shoelace defaults. Also, they make more sense for our
10
10
  * usage (i.e why would you want events to not be cancelable by default?)
11
11
  */
12
- export type EventOptions = {
13
- /**
14
- * A Boolean indicating whether the event bubbles up through the DOM or not.
15
- *
16
- * @default true
17
- */
18
- bubbles?: boolean;
19
- /**
20
- * A Boolean indicating whether the event is cancelable. Defaults to `true`,
21
- * unlike the DOM's default of `false`, as that is the desired behavior most
22
- * of the time.
23
- *
24
- * @default true
25
- */
26
- cancelable?: boolean;
27
- /**
28
- * A Boolean value indicating whether or not the event can bubble across the
29
- * boundary between the shadow DOM and the regular DOM.
30
- *
31
- * @default true
32
- */
33
- composed?: boolean;
34
- };
35
- export declare const createEventFactory: <T = void>(eventName?: string, options?: EventOptions, component?: import('./LitElement.ts').LitElement) => EventEmitter<T>;
12
+ export interface EventOptions {
13
+ /**
14
+ * A Boolean indicating whether the event bubbles up through the DOM or not.
15
+ *
16
+ * @default true
17
+ */
18
+ bubbles?: boolean;
19
+ /**
20
+ * A Boolean indicating whether the event is cancelable. Defaults to `true`,
21
+ * unlike the DOM's default of `false`, as that is the desired behavior most
22
+ * of the time.
23
+ *
24
+ * @default true
25
+ */
26
+ cancelable?: boolean;
27
+ /**
28
+ * A Boolean value indicating whether or not the event can bubble across the
29
+ * boundary between the shadow DOM and the regular DOM.
30
+ *
31
+ * @default true
32
+ */
33
+ composed?: boolean;
34
+ }
35
+
36
36
  /**
37
37
  * Creates an event emitter.
38
38
  * Events emitted by your component will be included in the documentation.
39
39
  *
40
+ * @param options
40
41
  * @example
41
42
  * Declaring an event whose payload is of type `number`:
42
43
  *
@@ -45,6 +46,5 @@ export declare const createEventFactory: <T = void>(eventName?: string, options?
45
46
  * arcgisClick = createEvent<number>();
46
47
  * }
47
48
  * ```
48
- *
49
49
  */
50
- export declare const createEvent: <T = void>(options?: EventOptions) => EventEmitter<T>;
50
+ export const createEvent: <T = void>(options?: EventOptions) => EventEmitter<T>;
@@ -1,5 +1,7 @@
1
- import { LuminaPropertyDeclaration } from './controllers/types.ts';
2
- export { state } from 'lit/decorators/state.js';
1
+ import type { LuminaPropertyDeclaration } from "./controllers/types.js";
2
+
3
+ export { state } from "lit/decorators/state.js";
4
+
3
5
  /**
4
6
  * A class field or accessor decorator which creates a reactive property that
5
7
  * reflects a corresponding attribute value. When a decorated property is set
@@ -22,15 +24,14 @@ export { state } from 'lit/decorators/state.js';
22
24
  * needed, state properties can be initialized via public properties to
23
25
  * facilitate complex interactions.
24
26
  *
27
+ * @param options
25
28
  * @example
26
- *
27
29
  * ```ts
28
30
  * class MyElement {
29
31
  * \@property()
30
32
  * clicked = false;
31
33
  * }
32
34
  * ```
33
- *
34
35
  * @example
35
36
  * Declaring a readOnly property:
36
37
  *
@@ -41,15 +42,21 @@ export { state } from 'lit/decorators/state.js';
41
42
  * }
42
43
  * ```
43
44
  */
44
- export declare const property: (options?: Omit<LuminaPropertyDeclaration, "state">) => PropertyDecorator;
45
- declare type CustomMethodDecorator<T> = (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
45
+ export const property: (options?: Omit<LuminaPropertyDeclaration, "state">) => PropertyDecorator;
46
+
47
+ /**
48
+ * @param target
49
+ * @param propertyKey
50
+ * @param descriptor
51
+ */
52
+ export type CustomMethodDecorator<T> = (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
53
+
46
54
  /**
47
55
  * The `@method()` decorator is used to expose methods on the public API.
48
56
  * Class methods decorated with the `@method()` decorator can be called directly
49
57
  * from the element, meaning they are intended to be callable from the outside.
50
58
  *
51
- * @remarks
52
59
  * This decorator does not exist at runtime and is only used as a hint for the
53
- * compiler to declare certain methods as public.
60
+ * compiler to expose the methods in NPM and CDN builds.
54
61
  */
55
- export declare const method: () => CustomMethodDecorator<(...args: never[]) => any>;
62
+ export const method: () => CustomMethodDecorator<(...args: never[]) => any>;