@studiometa/js-toolkit 2.4.4-alpha.7 → 2.4.4-alpha.8
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/index.d.ts +4 -3
- package/Base/types.d.ts +2 -2
- package/decorators/withBreakpointObserver.d.ts +2 -2
- package/decorators/withDrag.d.ts +1 -1
- package/decorators/withIntersectionObserver.d.ts +9 -3
- package/decorators/withMountWhenInView.d.ts +2 -2
- package/decorators/withScrolledInView.d.ts +2 -2
- package/decorators/withVue2.d.ts +3 -3
- package/helpers/createApp.d.ts +2 -2
- package/index.d.ts +1 -1
- package/package.json +1 -1
package/Base/index.d.ts
CHANGED
|
@@ -34,11 +34,12 @@ export declare type BaseConfig = {
|
|
|
34
34
|
components?: BaseConfigComponents;
|
|
35
35
|
options?: import('./managers/OptionsManager').OptionsSchema;
|
|
36
36
|
};
|
|
37
|
-
export declare type
|
|
37
|
+
export declare type BaseProps = {
|
|
38
38
|
$el?: HTMLElement;
|
|
39
39
|
$options?: BaseOptions;
|
|
40
40
|
$refs?: BaseRefs;
|
|
41
41
|
$children?: BaseChildren;
|
|
42
|
+
$parent?: Base;
|
|
42
43
|
};
|
|
43
44
|
export declare type Managers = {
|
|
44
45
|
ChildrenManager: typeof ChildrenManager;
|
|
@@ -50,7 +51,7 @@ export declare type Managers = {
|
|
|
50
51
|
/**
|
|
51
52
|
* Base class.
|
|
52
53
|
*/
|
|
53
|
-
export declare class Base<T extends
|
|
54
|
+
export declare class Base<T extends BaseProps = BaseProps> extends EventTarget {
|
|
54
55
|
/**
|
|
55
56
|
* This is a Base instance.
|
|
56
57
|
*/
|
|
@@ -58,7 +59,7 @@ export declare class Base<T extends BaseTypeParameter = BaseTypeParameter> exten
|
|
|
58
59
|
/**
|
|
59
60
|
* The instance parent.
|
|
60
61
|
*/
|
|
61
|
-
$parent: Base;
|
|
62
|
+
$parent: T['$parent'] & Base;
|
|
62
63
|
/**
|
|
63
64
|
* The instance id.
|
|
64
65
|
*/
|
package/Base/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Base,
|
|
1
|
+
import type { Base, BaseProps } from './index.js';
|
|
2
2
|
import type { KeyServiceProps, LoadServiceProps, PointerServiceProps, RafServiceProps, ResizeServiceProps, ScrollServiceProps } from '../services/index.js';
|
|
3
3
|
export interface BaseInterface {
|
|
4
4
|
/**
|
|
@@ -43,5 +43,5 @@ export interface BaseInterface {
|
|
|
43
43
|
scrolled?(props: ScrollServiceProps): void;
|
|
44
44
|
}
|
|
45
45
|
export declare type BaseDecorator<S extends BaseInterface, T extends Base> = {
|
|
46
|
-
new <W extends
|
|
46
|
+
new <W extends BaseProps = BaseProps>(...args: unknown[]): S & T & Base<W>;
|
|
47
47
|
} & Partial<Pick<T, keyof T>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
-
import type { Base,
|
|
3
|
-
export interface
|
|
2
|
+
import type { Base, BaseProps } from '../Base/index.js';
|
|
3
|
+
export interface WithBreakpointObserverProps extends BaseProps {
|
|
4
4
|
$options: {
|
|
5
5
|
activeBreakpoints?: string;
|
|
6
6
|
inactiveBreakpoints?: string;
|
package/decorators/withDrag.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { DragServiceOptions, DragServiceProps } from '../services/drag.js';
|
|
|
4
4
|
export declare type DragDecoratorOptions = DragServiceOptions & {
|
|
5
5
|
target?: (this: Base, instance: Base) => HTMLElement;
|
|
6
6
|
};
|
|
7
|
-
export interface
|
|
7
|
+
export interface WithDragInterface extends BaseInterface {
|
|
8
8
|
dragged?(props: DragServiceProps): void;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
-
import type { Base } from '../Base/index.js';
|
|
3
|
-
interface
|
|
2
|
+
import type { Base, BaseProps } from '../Base/index.js';
|
|
3
|
+
export interface WithIntersectionObserverProps extends BaseProps {
|
|
4
|
+
$options: {
|
|
5
|
+
intersectionObserver: IntersectionObserverInit;
|
|
6
|
+
};
|
|
7
|
+
$observer: IntersectionObserver;
|
|
8
|
+
intersected(entries: IntersectionObserverEntry[]): void;
|
|
9
|
+
}
|
|
10
|
+
export interface WithIntersectionObserverInterface extends BaseInterface {
|
|
4
11
|
$observer: IntersectionObserver;
|
|
5
12
|
}
|
|
6
13
|
/**
|
|
7
14
|
* IntersectionObserver decoration.
|
|
8
15
|
*/
|
|
9
16
|
export declare function withIntersectionObserver<S extends Base>(BaseClass: typeof Base, defaultOptions?: IntersectionObserverInit): BaseDecorator<WithIntersectionObserverInterface, S>;
|
|
10
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseInterface, BaseDecorator } from '../Base/types.js';
|
|
2
|
-
import type { Base,
|
|
3
|
-
export interface
|
|
2
|
+
import type { Base, BaseProps } from '../Base/index.js';
|
|
3
|
+
export interface WithMountWhenInViewProps extends BaseProps {
|
|
4
4
|
$options: {
|
|
5
5
|
intersectionObserver: IntersectionObserverInit;
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseInterface, BaseDecorator } from '../Base/types.js';
|
|
2
|
-
import type { Base,
|
|
2
|
+
import type { Base, BaseProps } from '../Base/index.js';
|
|
3
3
|
import type { RafServiceProps, ScrollServiceProps, ResizeServiceProps } from '../services/index.js';
|
|
4
|
-
export interface
|
|
4
|
+
export interface WithScrolledInViewProps extends BaseProps {
|
|
5
5
|
$options: {
|
|
6
6
|
dampFactor: number;
|
|
7
7
|
dampPrecision: number;
|
package/decorators/withVue2.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type Vue from 'vue';
|
|
2
2
|
import type { VueConstructor } from 'vue';
|
|
3
3
|
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
4
|
-
import type { Base,
|
|
5
|
-
export interface
|
|
4
|
+
import type { Base, BaseProps } from '../Base/index.js';
|
|
5
|
+
export interface WithVue2Props extends BaseProps {
|
|
6
6
|
$refs: {
|
|
7
7
|
vue: HTMLElement;
|
|
8
8
|
};
|
|
@@ -13,4 +13,4 @@ export interface WithVue2Interface extends BaseInterface {
|
|
|
13
13
|
/**
|
|
14
14
|
* withVue decorator.
|
|
15
15
|
*/
|
|
16
|
-
export declare function withVue2<S extends Base,
|
|
16
|
+
export declare function withVue2<S extends Base, T extends Vue = Vue>(BaseClass: typeof Base, VueCtor: VueConstructor): BaseDecorator<WithVue2Interface, S>;
|
package/helpers/createApp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Base, BaseConstructor,
|
|
1
|
+
import type { Base, BaseConstructor, BaseProps } from '../Base/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Instantiate and mount the given component on the given root element when the page has been loaded
|
|
4
4
|
* and return a function to use the app instance when it is ready.
|
|
5
5
|
*/
|
|
6
|
-
export default function createApp<S extends BaseConstructor<Base>, T extends
|
|
6
|
+
export default function createApp<S extends BaseConstructor<Base>, T extends BaseProps = BaseProps>(App: S, rootElement?: HTMLElement): () => Promise<S & Base<T>>;
|
package/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { Base } from './Base/index.js';
|
|
|
2
2
|
export * from './decorators/index.js';
|
|
3
3
|
export * from './helpers/index.js';
|
|
4
4
|
export * from './services/index.js';
|
|
5
|
-
export type {
|
|
5
|
+
export type { BaseProps, BaseConstructor, BaseAsyncConstructor, BaseConfig, } from './Base/index.js';
|
|
6
6
|
export type { BaseInterface, BaseDecorator } from './Base/types.js';
|