@studiometa/js-toolkit 2.4.4-alpha.4 → 2.4.4-alpha.7
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/Base/types.d.ts +5 -1
- package/decorators/index.cjs +11 -34
- package/decorators/index.d.ts +10 -11
- package/decorators/index.js +10 -24
- package/decorators/withBreakpointManager.cjs +6 -12
- package/decorators/withBreakpointManager.d.ts +3 -2
- package/decorators/withBreakpointManager.js +4 -4
- package/decorators/withBreakpointObserver.cjs +5 -11
- package/decorators/withBreakpointObserver.d.ts +7 -112
- package/decorators/withBreakpointObserver.js +2 -2
- package/decorators/withDrag.cjs +5 -11
- package/decorators/withDrag.d.ts +8 -93
- package/decorators/withDrag.js +4 -4
- package/decorators/withExtraConfig.cjs +1 -1
- package/decorators/withExtraConfig.d.ts +3 -96
- package/decorators/withExtraConfig.js +1 -1
- package/decorators/withFreezedOptions.cjs +1 -1
- package/decorators/withFreezedOptions.d.ts +6 -105
- package/decorators/withFreezedOptions.js +1 -1
- package/decorators/withIntersectionObserver.cjs +1 -1
- package/decorators/withIntersectionObserver.d.ts +4 -110
- package/decorators/withIntersectionObserver.js +1 -1
- package/decorators/withMountWhenInView.cjs +1 -1
- package/decorators/withMountWhenInView.d.ts +16 -116
- package/decorators/withMountWhenInView.js +1 -1
- package/decorators/withResponsiveOptions.cjs +1 -1
- package/decorators/withResponsiveOptions.d.ts +3 -98
- package/decorators/withResponsiveOptions.js +1 -1
- package/decorators/withScrolledInView.cjs +21 -15
- package/decorators/withScrolledInView.d.ts +29 -307
- package/decorators/withScrolledInView.js +21 -9
- package/decorators/withVue2.cjs +1 -1
- package/decorators/withVue2.d.ts +8 -106
- package/decorators/withVue2.js +1 -1
- package/helpers/importOnInteraction.d.ts +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/decorators/withType.cjs +0 -28
- package/decorators/withType.d.ts +0 -5
- package/decorators/withType.js +0 -6
package/decorators/withVue2.d.ts
CHANGED
|
@@ -1,114 +1,16 @@
|
|
|
1
1
|
import type Vue from 'vue';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
2
|
+
import type { VueConstructor } from 'vue';
|
|
3
|
+
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
4
|
+
import type { Base, BaseTypeParameter } from '../Base/index.js';
|
|
5
|
+
export interface WithVue2TypeParameter extends BaseTypeParameter {
|
|
5
6
|
$refs: {
|
|
6
7
|
vue: HTMLElement;
|
|
7
8
|
};
|
|
8
9
|
}
|
|
10
|
+
export interface WithVue2Interface extends BaseInterface {
|
|
11
|
+
$vue: Vue;
|
|
12
|
+
}
|
|
9
13
|
/**
|
|
10
14
|
* withVue decorator.
|
|
11
15
|
*/
|
|
12
|
-
export
|
|
13
|
-
new (...args: any[]): {
|
|
14
|
-
$vue: Vue;
|
|
15
|
-
$parent: Base<BaseTypeParameter>;
|
|
16
|
-
$id: string;
|
|
17
|
-
$el: HTMLElement & {
|
|
18
|
-
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
19
|
-
};
|
|
20
|
-
$isMounted: boolean;
|
|
21
|
-
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
22
|
-
readonly $root: Base<BaseTypeParameter>;
|
|
23
|
-
readonly __config: import("../Base/index.js").BaseConfig;
|
|
24
|
-
__services: import("../Base/managers/ServicesManager.js").default;
|
|
25
|
-
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
26
|
-
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
27
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
28
|
-
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
29
|
-
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
30
|
-
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
31
|
-
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
32
|
-
__events: import("../Base/managers/EventsManager.js").default;
|
|
33
|
-
readonly $log: (...args: unknown[]) => void;
|
|
34
|
-
readonly __debug: (...args: unknown[]) => void;
|
|
35
|
-
readonly __managers: import("../Base/index.js").Managers;
|
|
36
|
-
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
37
|
-
__hasEvent(event: string): boolean;
|
|
38
|
-
$mount(): any;
|
|
39
|
-
$update(): any;
|
|
40
|
-
$destroy(): any;
|
|
41
|
-
$terminate(): void;
|
|
42
|
-
__addEmits(event: string): void;
|
|
43
|
-
__removeEmits(event: string): void;
|
|
44
|
-
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
45
|
-
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
46
|
-
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
47
|
-
$emit(event: string, ...args: unknown[]): void;
|
|
48
|
-
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
49
|
-
dispatchEvent(event: Event): boolean;
|
|
50
|
-
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
51
|
-
};
|
|
52
|
-
prototype: Base<BaseTypeParameter>;
|
|
53
|
-
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory"> & Pick<{
|
|
54
|
-
new (element: HTMLElement): {
|
|
55
|
-
$vue: Vue;
|
|
56
|
-
$parent: Base<BaseTypeParameter>;
|
|
57
|
-
$id: string;
|
|
58
|
-
$el: HTMLElement & {
|
|
59
|
-
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
60
|
-
};
|
|
61
|
-
$isMounted: boolean;
|
|
62
|
-
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
63
|
-
readonly $root: Base<BaseTypeParameter>;
|
|
64
|
-
readonly __config: import("../Base/index.js").BaseConfig;
|
|
65
|
-
__services: import("../Base/managers/ServicesManager.js").default;
|
|
66
|
-
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
67
|
-
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
68
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
69
|
-
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
70
|
-
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
71
|
-
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
72
|
-
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
73
|
-
__events: import("../Base/managers/EventsManager.js").default;
|
|
74
|
-
readonly $log: (...args: unknown[]) => void;
|
|
75
|
-
readonly __debug: (...args: unknown[]) => void;
|
|
76
|
-
readonly __managers: import("../Base/index.js").Managers;
|
|
77
|
-
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
78
|
-
__hasEvent(event: string): boolean;
|
|
79
|
-
$mount(): any;
|
|
80
|
-
$update(): any;
|
|
81
|
-
$destroy(): any;
|
|
82
|
-
$terminate(): void;
|
|
83
|
-
__addEmits(event: string): void;
|
|
84
|
-
__removeEmits(event: string): void;
|
|
85
|
-
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
86
|
-
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
87
|
-
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
88
|
-
$emit(event: string, ...args: unknown[]): void;
|
|
89
|
-
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
90
|
-
dispatchEvent(event: Event): boolean;
|
|
91
|
-
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
92
|
-
};
|
|
93
|
-
config: {
|
|
94
|
-
name: string;
|
|
95
|
-
refs: string[];
|
|
96
|
-
debug?: boolean;
|
|
97
|
-
log?: boolean;
|
|
98
|
-
emits?: string[];
|
|
99
|
-
components?: import("../Base/index.js").BaseConfigComponents;
|
|
100
|
-
options?: import("../Base/managers/OptionsManager.js").OptionsSchema;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Vue app configuration.
|
|
104
|
-
*/
|
|
105
|
-
vueConfig: ComponentOptions<VueTypeParameter, import("vue/types/options.js").DefaultData<VueTypeParameter>, import("vue/types/options.js").DefaultMethods<VueTypeParameter>, import("vue/types/options.js").DefaultComputed, import("vue/types/options.js").PropsDefinition<import("vue/types/options.js").DefaultProps>, import("vue/types/options.js").DefaultProps> & {
|
|
106
|
-
render: ComponentOptions<VueTypeParameter>['render'];
|
|
107
|
-
};
|
|
108
|
-
readonly $isBase: true;
|
|
109
|
-
$factory: typeof Base.$factory;
|
|
110
|
-
} & S, "prototype" | "$isBase" | "config" | "$factory" | "vueConfig" | keyof S> & S & {
|
|
111
|
-
new (...args: any[]): Base<T & WithVue2Interface>;
|
|
112
|
-
prototype: Base<BaseTypeParameter>;
|
|
113
|
-
};
|
|
114
|
-
export {};
|
|
16
|
+
export declare function withVue2<S extends Base, VueTypeParameter extends Vue = Vue>(BaseClass: typeof Base, VueCtor: VueConstructor): BaseDecorator<WithVue2Interface, S>;
|
package/decorators/withVue2.js
CHANGED
|
@@ -15,4 +15,4 @@ import type { Base, BaseConstructor } from '../Base/index.js';
|
|
|
15
15
|
*/
|
|
16
16
|
export default function importOnInteraction<T extends BaseConstructor = BaseConstructor>(fn: () => Promise<T | {
|
|
17
17
|
default: T;
|
|
18
|
-
}>, nameOrSelectorOrElement: string | HTMLElement | HTMLElement[], events: string | string[], parent
|
|
18
|
+
}>, nameOrSelectorOrElement: string | HTMLElement | HTMLElement[], events: string | string[], parent?: Base): Promise<T>;
|
package/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export * from './decorators/index.js';
|
|
|
3
3
|
export * from './helpers/index.js';
|
|
4
4
|
export * from './services/index.js';
|
|
5
5
|
export type { BaseTypeParameter, BaseConstructor, BaseAsyncConstructor, BaseConfig, } from './Base/index.js';
|
|
6
|
-
export type { BaseInterface } from './Base/types.js';
|
|
6
|
+
export type { BaseInterface, BaseDecorator } from './Base/types.js';
|
package/package.json
CHANGED
package/decorators/withType.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/js-toolkit/decorators/withType.ts
|
|
20
|
-
var withType_exports = {};
|
|
21
|
-
__export(withType_exports, {
|
|
22
|
-
default: () => withType
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(withType_exports);
|
|
25
|
-
function withType(BaseClass) {
|
|
26
|
-
return BaseClass;
|
|
27
|
-
}
|
|
28
|
-
if (module.exports.default) module.exports = module.exports.default;
|
package/decorators/withType.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Base, BaseTypeParameter, BaseConstructor } from '../Base/index.js';
|
|
2
|
-
export default function withType<T extends BaseConstructor<Base>, U extends BaseTypeParameter = BaseTypeParameter>(BaseClass: T): T & {
|
|
3
|
-
new (...args: any[]): Base<U>;
|
|
4
|
-
prototype: Base<BaseTypeParameter>;
|
|
5
|
-
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory">;
|