@studiometa/js-toolkit 2.4.4-alpha.0 → 2.4.4-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/Base/index.d.ts +336 -0
  2. package/Base/managers/AbstractManager.d.ts +44 -0
  3. package/Base/managers/ChildrenManager.d.ts +41 -0
  4. package/Base/managers/EventsManager.d.ts +112 -0
  5. package/Base/managers/OptionsManager.d.ts +87 -0
  6. package/Base/managers/RefsManager.d.ts +32 -0
  7. package/Base/managers/ResponsiveOptionsManager.cjs +1 -1
  8. package/Base/managers/ResponsiveOptionsManager.d.ts +22 -0
  9. package/Base/managers/ServicesManager.d.ts +109 -0
  10. package/Base/utils.d.ts +40 -0
  11. package/decorators/index.d.ts +10 -0
  12. package/decorators/withBreakpointManager.d.ts +87 -0
  13. package/decorators/withBreakpointObserver.d.ts +93 -0
  14. package/decorators/withDrag.d.ts +84 -0
  15. package/decorators/withExtraConfig.d.ts +85 -0
  16. package/decorators/withFreezedOptions.d.ts +84 -0
  17. package/decorators/withIntersectionObserver.d.ts +97 -0
  18. package/decorators/withMountWhenInView.d.ts +95 -0
  19. package/decorators/withResponsiveOptions.d.ts +81 -0
  20. package/decorators/withScrolledInView.d.ts +198 -0
  21. package/decorators/withVue2.cjs +2 -2
  22. package/decorators/withVue2.d.ts +98 -0
  23. package/decorators/withVue2.js +2 -2
  24. package/helpers/createApp.d.ts +14 -0
  25. package/helpers/getDirectChildren.d.ts +31 -0
  26. package/helpers/getInstanceFromElement.d.ts +14 -0
  27. package/helpers/importOnInteraction.d.ts +23 -0
  28. package/helpers/importWhenIdle.d.ts +21 -0
  29. package/helpers/importWhenVisible.d.ts +23 -0
  30. package/helpers/index.d.ts +6 -0
  31. package/helpers/utils.d.ts +10 -0
  32. package/index.d.ts +5 -0
  33. package/package.json +1 -1
  34. package/services/drag.d.ts +1 -1
  35. package/services/index.cjs +1 -1
  36. package/services/index.d.ts +33 -25
  37. package/services/key.d.ts +1 -1
  38. package/services/load.d.ts +1 -1
  39. package/services/pointer.d.ts +1 -1
  40. package/services/raf.d.ts +1 -1
  41. package/services/resize.d.ts +1 -1
  42. package/services/scroll.d.ts +1 -1
@@ -0,0 +1,109 @@
1
+ /**
2
+ * @typedef {typeof SERVICES_MAP & Record<string, () => ServiceInterface>} Services
3
+ * @typedef {keyof SERVICES_MAP|string} ServiceName
4
+ */
5
+ /**
6
+ * Services management for the Base class.
7
+ *
8
+ * @todo Add support for disabled services on mount when the method is defined.
9
+ */
10
+ export default class ServicesManager extends AbstractManager {
11
+ /**
12
+ * @type {Record<string, () => ServiceInterface>}
13
+ */
14
+ __customServices: Record<string, () => import("../../services").ServiceInterface<any>>;
15
+ /**
16
+ * @returns {Record<string, () => ServiceInterface>}
17
+ */
18
+ get __services(): Record<string, () => import("../../services").ServiceInterface<any>>;
19
+ /**
20
+ * Test if the given service is registered.
21
+ *
22
+ * @param {ServiceName} service The name of the service.
23
+ * @returns {boolean}
24
+ */
25
+ has(service: ServiceName): boolean;
26
+ /**
27
+ * Get a service props by name.
28
+ * @param {ServiceName} service The name of the service.
29
+ * @returns {ReturnType<ServiceInterface['props']>}
30
+ */
31
+ get(service: ServiceName): ReturnType<import("../../services").ServiceInterface<any>['props']>;
32
+ /**
33
+ * Init the given service and bind it to the given instance.
34
+ *
35
+ * @param {ServiceName} service The name of the service.
36
+ * @returns {() => void} A function to unbind the service.
37
+ */
38
+ enable(service: ServiceName): () => void;
39
+ /**
40
+ * Enable all services and return methods to disable them.
41
+ *
42
+ * @returns {Function[]}
43
+ */
44
+ enableAll(): Function[];
45
+ /**
46
+ * Disable all services.
47
+ *
48
+ * @returns {void}
49
+ */
50
+ disableAll(): void;
51
+ /**
52
+ * Disable a service.
53
+ *
54
+ * @param {string} service The name of the service.
55
+ * @returns {void}
56
+ */
57
+ disable(service: string): void;
58
+ /**
59
+ * Toggle a service.
60
+ * @param {string} service The name of the service.
61
+ * @param {boolean} [force] The state to force.
62
+ * @returns {void}
63
+ */
64
+ toggle(service: string, force?: boolean): void;
65
+ /**
66
+ * Register a new service to be enabled/disabled.
67
+ *
68
+ * @param {string} name
69
+ * The name of the service hook.
70
+ * @param {() => ServiceInterface} useFunction
71
+ * The `use...` function for the service.
72
+ */
73
+ register(name: string, useFunction: () => import("../../services").ServiceInterface<any>): void;
74
+ /**
75
+ * Unregister a new service to be enabled disabled.
76
+ *
77
+ * @param {string} name
78
+ * The name of the service hook.
79
+ */
80
+ unregister(name: string): void;
81
+ }
82
+ export type Base = import('../index').default;
83
+ export type BaseConstructor = import('../index').BaseConstructor;
84
+ export type ServiceInterface = import('../../services').ServiceInterface<any>;
85
+ export type Services = typeof SERVICES_MAP & Record<string, () => import("../../services").ServiceInterface<any>>;
86
+ export type ServiceName = keyof {
87
+ scrolled: typeof useScroll;
88
+ resized: typeof useResize;
89
+ ticked: typeof useRaf;
90
+ moved: typeof usePointer;
91
+ keyed: typeof useKey;
92
+ loaded: typeof useLoad;
93
+ } | string;
94
+ import AbstractManager from "./AbstractManager.js";
95
+ declare namespace SERVICES_MAP {
96
+ export { useScroll as scrolled };
97
+ export { useResize as resized };
98
+ export { useRaf as ticked };
99
+ export { usePointer as moved };
100
+ export { useKey as keyed };
101
+ export { useLoad as loaded };
102
+ }
103
+ import useScroll from "../../services/scroll.js";
104
+ import useResize from "../../services/resize.js";
105
+ import useRaf from "../../services/raf.js";
106
+ import usePointer from "../../services/pointer.js";
107
+ import useKey from "../../services/key.js";
108
+ import useLoad from "../../services/load.js";
109
+ export {};
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @typedef {import('./index.js').default} Base
3
+ */
4
+ /**
5
+ * Get a list of elements based on the name of a component.
6
+ *
7
+ * @param {string} nameOrSelector
8
+ * The name or selector to used for this component.
9
+ * @param {HTMLElement|Document} element
10
+ * The root element on which to query the selector, defaults to `document`.
11
+ * @returns {Array<HTMLElement>}
12
+ * A list of elements on which the component should be mounted.
13
+ */
14
+ export function getComponentElements(nameOrSelector: string, element?: HTMLElement | Document): Array<HTMLElement>;
15
+ /**
16
+ * Test if an event is defined in the given config.
17
+ *
18
+ * @param {string} event
19
+ * @param {import('./index.js').BaseConfig} config
20
+ * @returns {boolean}
21
+ */
22
+ export function eventIsDefinedInConfig(event: string, config: import('./index.js').BaseConfig): boolean;
23
+ /**
24
+ * Test if an event can be used on the given element.
25
+ *
26
+ * @param {string} event
27
+ * @param {HTMLElement} element
28
+ * @returns {boolean}
29
+ */
30
+ export function eventIsNative(event: string, element: HTMLElement): boolean;
31
+ /**
32
+ * Get the target of a given event.
33
+ *
34
+ * @param {Base} instance
35
+ * @param {string} event
36
+ * @param {import('./index.js').BaseConfig} config
37
+ * @returns {Base|Base['$el']}
38
+ */
39
+ export function getEventTarget(instance: Base, event: string, config: import('./index.js').BaseConfig): Base | Base['$el'];
40
+ export type Base = import('./index.js').default;
@@ -0,0 +1,10 @@
1
+ export { default as withBreakpointManager } from './withBreakpointManager.js';
2
+ export { default as withBreakpointObserver } from './withBreakpointObserver.js';
3
+ export { default as withDrag } from './withDrag.js';
4
+ export { default as withExtraConfig } from './withExtraConfig.js';
5
+ export { default as withFreezedOptions } from './withFreezedOptions.js';
6
+ export { default as withIntersectionObserver } from './withIntersectionObserver.js';
7
+ export { default as withMountWhenInView } from './withMountWhenInView.js';
8
+ export { default as withResponsiveOptions } from './withResponsiveOptions.js';
9
+ export { default as withScrolledInView } from './withScrolledInView.js';
10
+ export { default as withVue2 } from './withVue2.js';
@@ -0,0 +1,87 @@
1
+ import type Base from '../Base/index.js';
2
+ import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
3
+ /**
4
+ * BreakpointManager class.
5
+ */
6
+ export default function withBreakpointManager<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor, breakpoints: Array<[string, BaseConstructor]>): typeof Base | {
7
+ new <U extends BaseTypeParameter = BaseTypeParameter>(element: any): {
8
+ /**
9
+ * Override the default $mount method to prevent component's from being
10
+ * mounted when they should not.
11
+ *
12
+ * @returns {this}
13
+ */
14
+ $mount(): any;
15
+ /**
16
+ * Destroy all instances when the main one is destroyed.
17
+ *
18
+ * @returns {this}
19
+ */
20
+ $destroy(): any;
21
+ $parent: Base<{
22
+ $el: HTMLElement;
23
+ $options: import("../Base/index.js").BaseOptions;
24
+ $refs: import("../Base/index.js").BaseRefs;
25
+ $children: {
26
+ [name: string]: Base<any> | Promise<Base<any>>;
27
+ };
28
+ }>;
29
+ $id: string;
30
+ $el: (T & U)["$el"] & HTMLElement & {
31
+ __base__?: WeakMap<typeof Base, Base<{
32
+ $el: HTMLElement;
33
+ $options: import("../Base/index.js").BaseOptions;
34
+ $refs: import("../Base/index.js").BaseRefs;
35
+ $children: {
36
+ [name: string]: Base<any> | Promise<Base<any>>;
37
+ };
38
+ }> | "terminated">;
39
+ };
40
+ $isMounted: boolean;
41
+ __eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
42
+ readonly $root: Base<{
43
+ $el: HTMLElement;
44
+ $options: import("../Base/index.js").BaseOptions;
45
+ $refs: import("../Base/index.js").BaseRefs;
46
+ $children: {
47
+ [name: string]: Base<any> | Promise<Base<any>>;
48
+ };
49
+ }>;
50
+ readonly __config: import("../Base/index.js").BaseConfig;
51
+ __services: import("../Base/managers/ServicesManager.js").default;
52
+ readonly $services: import("../Base/managers/ServicesManager.js").default;
53
+ __refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
54
+ readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
55
+ __options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
56
+ readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
57
+ __children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
58
+ readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
59
+ __events: import("../Base/managers/EventsManager.js").default;
60
+ readonly $log: (...args: any) => void;
61
+ readonly __debug: (...args: any) => void;
62
+ readonly __managers: import("../Base/index.js").Managers;
63
+ __callMethod(method: string, ...args: any[]): any;
64
+ __hasEvent(event: string): boolean;
65
+ $update(): any;
66
+ $terminate(): void;
67
+ __addEmits(event: string): void;
68
+ __removeEmits(event: string): void;
69
+ readonly __ctor: typeof Base;
70
+ $on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
71
+ $off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
72
+ $emit(event: string, ...args: any[]): void;
73
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
74
+ dispatchEvent(event: Event): boolean;
75
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
76
+ };
77
+ readonly $isBase: boolean;
78
+ config: import("../Base/index.js").BaseConfig;
79
+ $factory(nameOrSelector: string): Base<{
80
+ $el: HTMLElement;
81
+ $options: import("../Base/index.js").BaseOptions;
82
+ $refs: import("../Base/index.js").BaseRefs;
83
+ $children: {
84
+ [name: string]: Base<any> | Promise<Base<any>>;
85
+ };
86
+ }>[];
87
+ };
@@ -0,0 +1,93 @@
1
+ import type Base from '../Base/index.js';
2
+ import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
3
+ /**
4
+ * BreakpointObserver class.
5
+ */
6
+ export default function withBreakpointObserver<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor): {
7
+ new <U extends BaseTypeParameter = BaseTypeParameter>(element: any): {
8
+ /**
9
+ * Override the default $mount method to prevent component's from being
10
+ * mounted when they should not.
11
+ *
12
+ * @returns {this}
13
+ */
14
+ $mount(): any;
15
+ $parent: Base<{
16
+ $el: HTMLElement;
17
+ $options: import("../Base/index.js").BaseOptions;
18
+ $refs: import("../Base/index.js").BaseRefs;
19
+ $children: {
20
+ [name: string]: Base<any> | Promise<Base<any>>;
21
+ };
22
+ }>;
23
+ $id: string;
24
+ $el: (T & U)["$el"] & HTMLElement & {
25
+ __base__?: WeakMap<typeof Base, Base<{
26
+ $el: HTMLElement;
27
+ $options: import("../Base/index.js").BaseOptions;
28
+ $refs: import("../Base/index.js").BaseRefs;
29
+ $children: {
30
+ [name: string]: Base<any> | Promise<Base<any>>;
31
+ };
32
+ }> | "terminated">;
33
+ };
34
+ $isMounted: boolean;
35
+ __eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
36
+ readonly $root: Base<{
37
+ $el: HTMLElement;
38
+ $options: import("../Base/index.js").BaseOptions;
39
+ $refs: import("../Base/index.js").BaseRefs;
40
+ $children: {
41
+ [name: string]: Base<any> | Promise<Base<any>>;
42
+ };
43
+ }>;
44
+ readonly __config: import("../Base/index.js").BaseConfig;
45
+ __services: import("../Base/managers/ServicesManager.js").default;
46
+ readonly $services: import("../Base/managers/ServicesManager.js").default;
47
+ __refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
48
+ readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
49
+ __options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
50
+ readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
51
+ __children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
52
+ readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
53
+ __events: import("../Base/managers/EventsManager.js").default;
54
+ readonly $log: (...args: any) => void;
55
+ readonly __debug: (...args: any) => void;
56
+ readonly __managers: import("../Base/index.js").Managers;
57
+ __callMethod(method: string, ...args: any[]): any;
58
+ __hasEvent(event: string): boolean;
59
+ $update(): any;
60
+ $destroy(): any;
61
+ $terminate(): void;
62
+ __addEmits(event: string): void;
63
+ __removeEmits(event: string): void;
64
+ readonly __ctor: typeof Base;
65
+ $on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
66
+ $off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
67
+ $emit(event: string, ...args: any[]): void;
68
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
69
+ dispatchEvent(event: Event): boolean;
70
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
71
+ };
72
+ config: {
73
+ name: string;
74
+ options: {
75
+ activeBreakpoints: StringConstructor;
76
+ inactiveBreakpoints: StringConstructor;
77
+ };
78
+ debug?: boolean;
79
+ log?: boolean;
80
+ refs?: string[];
81
+ emits?: string[];
82
+ components?: import("../Base/index.js").BaseConfigComponents;
83
+ };
84
+ readonly $isBase: boolean;
85
+ $factory(nameOrSelector: string): Base<{
86
+ $el: HTMLElement;
87
+ $options: import("../Base/index.js").BaseOptions;
88
+ $refs: import("../Base/index.js").BaseRefs;
89
+ $children: {
90
+ [name: string]: Base<any> | Promise<Base<any>>;
91
+ };
92
+ }>[];
93
+ };
@@ -0,0 +1,84 @@
1
+ import type Base from '../Base/index.js';
2
+ import type { BaseTypeParameter, BaseConstructor } from '../Base/index.js';
3
+ import type { DragServiceOptions } from '../services/drag.js';
4
+ declare type DragDecoratorOptions = DragServiceOptions & {
5
+ target?: (this: Base, instance: Base) => HTMLElement;
6
+ };
7
+ /**
8
+ * Add dragging capabilities to a component.
9
+ */
10
+ export default function withDrag<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor, { target, ...options }?: DragDecoratorOptions): {
11
+ new <U extends BaseTypeParameter = BaseTypeParameter>(el: any): {
12
+ $parent: Base<{
13
+ $el: HTMLElement;
14
+ $options: import("../Base/index.js").BaseOptions;
15
+ $refs: import("../Base/index.js").BaseRefs;
16
+ $children: {
17
+ [name: string]: Base<any> | Promise<Base<any>>;
18
+ };
19
+ }>;
20
+ $id: string;
21
+ $el: (T & U)["$el"] & HTMLElement & {
22
+ __base__?: WeakMap<typeof Base, Base<{
23
+ $el: HTMLElement;
24
+ $options: import("../Base/index.js").BaseOptions;
25
+ $refs: import("../Base/index.js").BaseRefs;
26
+ $children: {
27
+ [name: string]: Base<any> | Promise<Base<any>>;
28
+ };
29
+ }> | "terminated">;
30
+ };
31
+ $isMounted: boolean;
32
+ __eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
33
+ readonly $root: Base<{
34
+ $el: HTMLElement;
35
+ $options: import("../Base/index.js").BaseOptions;
36
+ $refs: import("../Base/index.js").BaseRefs;
37
+ $children: {
38
+ [name: string]: Base<any> | Promise<Base<any>>;
39
+ };
40
+ }>;
41
+ readonly __config: import("../Base/index.js").BaseConfig;
42
+ __services: import("../Base/managers/ServicesManager.js").default;
43
+ readonly $services: import("../Base/managers/ServicesManager.js").default;
44
+ __refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
45
+ readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
46
+ __options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
47
+ readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
48
+ __children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
49
+ readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
50
+ __events: import("../Base/managers/EventsManager.js").default;
51
+ readonly $log: (...args: any) => void;
52
+ readonly __debug: (...args: any) => void;
53
+ readonly __managers: import("../Base/index.js").Managers;
54
+ __callMethod(method: string, ...args: any[]): any;
55
+ __hasEvent(event: string): boolean;
56
+ $mount(): any;
57
+ $update(): any;
58
+ $destroy(): any;
59
+ $terminate(): void;
60
+ __addEmits(event: string): void;
61
+ __removeEmits(event: string): void;
62
+ readonly __ctor: typeof Base;
63
+ $on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
64
+ $off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
65
+ $emit(event: string, ...args: any[]): void;
66
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
67
+ dispatchEvent(event: Event): boolean;
68
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
69
+ };
70
+ config: {
71
+ name: string;
72
+ emits: string[];
73
+ };
74
+ readonly $isBase: boolean;
75
+ $factory(nameOrSelector: string): Base<{
76
+ $el: HTMLElement;
77
+ $options: import("../Base/index.js").BaseOptions;
78
+ $refs: import("../Base/index.js").BaseRefs;
79
+ $children: {
80
+ [name: string]: Base<any> | Promise<Base<any>>;
81
+ };
82
+ }>[];
83
+ };
84
+ export {};
@@ -0,0 +1,85 @@
1
+ import type { Options as DeepmergeOptions } from 'deepmerge';
2
+ import type { BaseTypeParameter, BaseConstructor, BaseConfig } from '../Base/index.js';
3
+ /**
4
+ * Extends the configuration of an existing class.
5
+ *
6
+ * @template {BaseConstructor} T
7
+ * @param {T} BaseClass The Base class to extend.
8
+ * @param {Partial<BaseConfig>} config Extra configuration to merge.
9
+ * @param {DeepmergeOptions} options Options for the `deepmerge` function. {@link https://github.com/TehShrike/deepmerge#options}
10
+ */
11
+ export default function withExtraConfig<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor, config: Partial<BaseConfig>, options?: DeepmergeOptions): {
12
+ new <U extends BaseTypeParameter = BaseTypeParameter>(element: HTMLElement): {
13
+ $parent: import("../Base/index.js").default<{
14
+ $el: HTMLElement;
15
+ $options: import("../Base/index.js").BaseOptions;
16
+ $refs: import("../Base/index.js").BaseRefs;
17
+ $children: {
18
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
19
+ };
20
+ }>;
21
+ $id: string;
22
+ $el: (T & U)["$el"] & HTMLElement & {
23
+ __base__?: WeakMap<typeof import("../Base/index.js").default, import("../Base/index.js").default<{
24
+ $el: HTMLElement;
25
+ $options: import("../Base/index.js").BaseOptions;
26
+ $refs: import("../Base/index.js").BaseRefs;
27
+ $children: {
28
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
29
+ };
30
+ }> | "terminated">;
31
+ };
32
+ $isMounted: boolean;
33
+ __eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
34
+ readonly $root: import("../Base/index.js").default<{
35
+ $el: HTMLElement;
36
+ $options: import("../Base/index.js").BaseOptions;
37
+ $refs: import("../Base/index.js").BaseRefs;
38
+ $children: {
39
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
40
+ };
41
+ }>;
42
+ readonly __config: BaseConfig;
43
+ __services: import("../Base/managers/ServicesManager.js").default;
44
+ readonly $services: import("../Base/managers/ServicesManager.js").default;
45
+ __refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
46
+ readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
47
+ __options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
48
+ readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
49
+ __children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
50
+ readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
51
+ __events: import("../Base/managers/EventsManager.js").default;
52
+ readonly $log: (...args: any) => void;
53
+ readonly __debug: (...args: any) => void;
54
+ readonly __managers: import("../Base/index.js").Managers;
55
+ __callMethod(method: string, ...args: any[]): any;
56
+ __hasEvent(event: string): boolean;
57
+ $mount(): any;
58
+ $update(): any;
59
+ $destroy(): any;
60
+ $terminate(): void;
61
+ __addEmits(event: string): void;
62
+ __removeEmits(event: string): void;
63
+ readonly __ctor: typeof import("../Base/index.js").default;
64
+ $on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
65
+ $off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
66
+ $emit(event: string, ...args: any[]): void;
67
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
68
+ dispatchEvent(event: Event): boolean;
69
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
70
+ };
71
+ /**
72
+ * Class config.
73
+ * @type {BaseConfig}
74
+ */
75
+ config: BaseConfig;
76
+ readonly $isBase: boolean;
77
+ $factory(nameOrSelector: string): import("../Base/index.js").default<{
78
+ $el: HTMLElement;
79
+ $options: import("../Base/index.js").BaseOptions;
80
+ $refs: import("../Base/index.js").BaseRefs;
81
+ $children: {
82
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
83
+ };
84
+ }>[];
85
+ };
@@ -0,0 +1,84 @@
1
+ import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
2
+ /**
3
+ * Freeze the `$options` property to improve performance.
4
+ */
5
+ export default function withFreezedOptions<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor): {
6
+ new <U extends BaseTypeParameter = BaseTypeParameter>(element: HTMLElement): {
7
+ /**
8
+ * Hold freezed options
9
+ * @private
10
+ */
11
+ __freezedOptions: any;
12
+ /**
13
+ * Lazyly freeze the `$options` property.
14
+ * @returns {Readonly<this['$options']>}
15
+ */
16
+ readonly $options: any;
17
+ $parent: import("../Base/index.js").default<{
18
+ $el: HTMLElement;
19
+ $options: import("../Base/index.js").BaseOptions;
20
+ $refs: import("../Base/index.js").BaseRefs;
21
+ $children: {
22
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
23
+ };
24
+ }>;
25
+ $id: string;
26
+ $el: (T & U)["$el"] & HTMLElement & {
27
+ __base__?: WeakMap<typeof import("../Base/index.js").default, import("../Base/index.js").default<{
28
+ $el: HTMLElement;
29
+ $options: import("../Base/index.js").BaseOptions;
30
+ $refs: import("../Base/index.js").BaseRefs;
31
+ $children: {
32
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
33
+ };
34
+ }> | "terminated">;
35
+ };
36
+ $isMounted: boolean;
37
+ __eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
38
+ readonly $root: import("../Base/index.js").default<{
39
+ $el: HTMLElement;
40
+ $options: import("../Base/index.js").BaseOptions;
41
+ $refs: import("../Base/index.js").BaseRefs;
42
+ $children: {
43
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
44
+ };
45
+ }>;
46
+ readonly __config: import("../Base/index.js").BaseConfig;
47
+ __services: import("../Base/managers/ServicesManager.js").default;
48
+ readonly $services: import("../Base/managers/ServicesManager.js").default;
49
+ __refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
50
+ readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
51
+ __options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
52
+ __children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
53
+ readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
54
+ __events: import("../Base/managers/EventsManager.js").default;
55
+ readonly $log: (...args: any) => void;
56
+ readonly __debug: (...args: any) => void;
57
+ readonly __managers: import("../Base/index.js").Managers;
58
+ __callMethod(method: string, ...args: any[]): any;
59
+ __hasEvent(event: string): boolean;
60
+ $mount(): any;
61
+ $update(): any;
62
+ $destroy(): any;
63
+ $terminate(): void;
64
+ __addEmits(event: string): void;
65
+ __removeEmits(event: string): void;
66
+ readonly __ctor: typeof import("../Base/index.js").default;
67
+ $on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
68
+ $off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
69
+ $emit(event: string, ...args: any[]): void;
70
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
71
+ dispatchEvent(event: Event): boolean;
72
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
73
+ };
74
+ readonly $isBase: boolean;
75
+ config: import("../Base/index.js").BaseConfig;
76
+ $factory(nameOrSelector: string): import("../Base/index.js").default<{
77
+ $el: HTMLElement;
78
+ $options: import("../Base/index.js").BaseOptions;
79
+ $refs: import("../Base/index.js").BaseRefs;
80
+ $children: {
81
+ [name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
82
+ };
83
+ }>[];
84
+ };