@oscarpalmer/abydon 0.13.0 → 0.14.0
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/dist/abydon.full.js +616 -710
- package/dist/constants.js +10 -0
- package/dist/fragment.js +12 -12
- package/dist/helpers/dom.js +3 -3
- package/dist/node/attribute/index.js +19 -14
- package/dist/node/attribute/value.js +10 -12
- package/dist/node/event.js +7 -9
- package/dist/node/index.js +2 -2
- package/dist/node/value.js +75 -60
- package/dist/parse.js +1 -4
- package/package.json +14 -16
- package/src/constants.ts +20 -0
- package/src/fragment.ts +50 -22
- package/src/helpers/dom.ts +3 -3
- package/src/index.ts +3 -2
- package/src/models.ts +8 -3
- package/src/node/attribute/index.ts +24 -19
- package/src/node/attribute/value.ts +31 -28
- package/src/node/event.ts +11 -12
- package/src/node/index.ts +3 -4
- package/src/node/value.ts +164 -116
- package/src/parse.ts +10 -3
- package/types/constants.d.ts +9 -0
- package/types/fragment.d.ts +3 -5
- package/types/models.d.ts +1 -2
- package/types/fragment.d.cts +0 -27
- package/types/helpers/dom.d.cts +0 -7
- package/types/helpers/index.d.cts +0 -29
- package/types/index.d.cts +0 -302
- package/types/models.d.cts +0 -107
- package/types/node/attribute/index.d.cts +0 -109
- package/types/node/attribute/value.d.cts +0 -109
- package/types/node/event.d.cts +0 -7
- package/types/node/index.d.cts +0 -108
- package/types/node/value.d.cts +0 -108
- package/types/parse.d.cts +0 -108
package/types/node/index.d.cts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A generic key type
|
|
5
|
-
*/
|
|
6
|
-
export type Key = number | string;
|
|
7
|
-
export type GenericCallback = (...args: any[]) => any;
|
|
8
|
-
declare class Effect {
|
|
9
|
-
private readonly $mora;
|
|
10
|
-
private readonly state;
|
|
11
|
-
constructor(callback: GenericCallback);
|
|
12
|
-
}
|
|
13
|
-
declare class Computed<Value> extends Reactive<Value> {
|
|
14
|
-
private readonly effect;
|
|
15
|
-
constructor(callback: () => Value, options?: ReactiveOptions<Value>);
|
|
16
|
-
/**
|
|
17
|
-
* @inheritdoc
|
|
18
|
-
*/
|
|
19
|
-
get(): Value;
|
|
20
|
-
}
|
|
21
|
-
declare abstract class Reactive<Value, Equal = Value> {
|
|
22
|
-
protected readonly state: ReactiveState<Value, Equal>;
|
|
23
|
-
constructor(name: string, value: Value, options?: ReactiveOptions<Equal>);
|
|
24
|
-
/**
|
|
25
|
-
* Get the value
|
|
26
|
-
*/
|
|
27
|
-
abstract get(): Value;
|
|
28
|
-
/**
|
|
29
|
-
* Get the value _(without reactivity)_
|
|
30
|
-
*/
|
|
31
|
-
peek(): Value;
|
|
32
|
-
/**
|
|
33
|
-
* Subscribe to changes
|
|
34
|
-
*/
|
|
35
|
-
subscribe(callback: (value: Value) => void): Unsubscribe;
|
|
36
|
-
/**
|
|
37
|
-
* JSON representation of the value
|
|
38
|
-
*/
|
|
39
|
-
toJSON(): Value;
|
|
40
|
-
/**
|
|
41
|
-
* String representation of the value
|
|
42
|
-
*/
|
|
43
|
-
toString(): string;
|
|
44
|
-
/**
|
|
45
|
-
* Unsubscribe from changes
|
|
46
|
-
*/
|
|
47
|
-
unsubscribe(callback: (value: Value) => void): void;
|
|
48
|
-
}
|
|
49
|
-
export type ReactiveOptions<Value> = {
|
|
50
|
-
/**
|
|
51
|
-
* Method to compare values for equality
|
|
52
|
-
*/
|
|
53
|
-
equal?: (first: Value, second: Value) => boolean;
|
|
54
|
-
};
|
|
55
|
-
export type ReactiveState<Value, Equal> = {
|
|
56
|
-
computeds: Set<Computed<unknown>>;
|
|
57
|
-
effects: Set<Effect>;
|
|
58
|
-
equal: (first: Equal, second: Equal) => boolean;
|
|
59
|
-
subscriptions: Map<GenericCallback, Subscription>;
|
|
60
|
-
value: Value;
|
|
61
|
-
};
|
|
62
|
-
declare class Subscription {
|
|
63
|
-
state: ReactiveState<unknown, never>;
|
|
64
|
-
callback: GenericCallback;
|
|
65
|
-
constructor(state: ReactiveState<unknown, never>, callback: GenericCallback);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Unsubscribe from changes
|
|
69
|
-
*/
|
|
70
|
-
export type Unsubscribe = () => void;
|
|
71
|
-
declare class Fragment {
|
|
72
|
-
private readonly $fragment;
|
|
73
|
-
private readonly data;
|
|
74
|
-
get identifier(): Key | undefined;
|
|
75
|
-
constructor(strings: TemplateStringsArray, expressions: unknown[]);
|
|
76
|
-
/**
|
|
77
|
-
* Appends the fragment to the given element
|
|
78
|
-
*/
|
|
79
|
-
appendTo(element: Element): void;
|
|
80
|
-
/**
|
|
81
|
-
* Gets a list of the fragment's nodes
|
|
82
|
-
*/
|
|
83
|
-
get(): ChildNode[];
|
|
84
|
-
identify(identifier: Key): Fragment;
|
|
85
|
-
/**
|
|
86
|
-
* Removes the fragment from the DOM
|
|
87
|
-
*/
|
|
88
|
-
remove(): void;
|
|
89
|
-
}
|
|
90
|
-
export type FragmentData = {
|
|
91
|
-
expressions: unknown[];
|
|
92
|
-
identifier?: Key;
|
|
93
|
-
items: FragmentItem[];
|
|
94
|
-
mora: MoraData;
|
|
95
|
-
strings: TemplateStringsArray;
|
|
96
|
-
values: unknown[];
|
|
97
|
-
};
|
|
98
|
-
export type FragmentItem = {
|
|
99
|
-
fragments?: Fragment[];
|
|
100
|
-
nodes: ChildNode[];
|
|
101
|
-
};
|
|
102
|
-
export type MoraData = {
|
|
103
|
-
subscribers: Set<() => void>;
|
|
104
|
-
values: Set<Reactive<unknown>>;
|
|
105
|
-
};
|
|
106
|
-
export declare function mapNodes(data: FragmentData, nodes: ChildNode[]): void;
|
|
107
|
-
|
|
108
|
-
export {};
|
package/types/node/value.d.cts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A generic key type
|
|
5
|
-
*/
|
|
6
|
-
export type Key = number | string;
|
|
7
|
-
export type GenericCallback = (...args: any[]) => any;
|
|
8
|
-
declare class Effect {
|
|
9
|
-
private readonly $mora;
|
|
10
|
-
private readonly state;
|
|
11
|
-
constructor(callback: GenericCallback);
|
|
12
|
-
}
|
|
13
|
-
declare class Computed<Value> extends Reactive<Value> {
|
|
14
|
-
private readonly effect;
|
|
15
|
-
constructor(callback: () => Value, options?: ReactiveOptions<Value>);
|
|
16
|
-
/**
|
|
17
|
-
* @inheritdoc
|
|
18
|
-
*/
|
|
19
|
-
get(): Value;
|
|
20
|
-
}
|
|
21
|
-
declare abstract class Reactive<Value, Equal = Value> {
|
|
22
|
-
protected readonly state: ReactiveState<Value, Equal>;
|
|
23
|
-
constructor(name: string, value: Value, options?: ReactiveOptions<Equal>);
|
|
24
|
-
/**
|
|
25
|
-
* Get the value
|
|
26
|
-
*/
|
|
27
|
-
abstract get(): Value;
|
|
28
|
-
/**
|
|
29
|
-
* Get the value _(without reactivity)_
|
|
30
|
-
*/
|
|
31
|
-
peek(): Value;
|
|
32
|
-
/**
|
|
33
|
-
* Subscribe to changes
|
|
34
|
-
*/
|
|
35
|
-
subscribe(callback: (value: Value) => void): Unsubscribe;
|
|
36
|
-
/**
|
|
37
|
-
* JSON representation of the value
|
|
38
|
-
*/
|
|
39
|
-
toJSON(): Value;
|
|
40
|
-
/**
|
|
41
|
-
* String representation of the value
|
|
42
|
-
*/
|
|
43
|
-
toString(): string;
|
|
44
|
-
/**
|
|
45
|
-
* Unsubscribe from changes
|
|
46
|
-
*/
|
|
47
|
-
unsubscribe(callback: (value: Value) => void): void;
|
|
48
|
-
}
|
|
49
|
-
export type ReactiveOptions<Value> = {
|
|
50
|
-
/**
|
|
51
|
-
* Method to compare values for equality
|
|
52
|
-
*/
|
|
53
|
-
equal?: (first: Value, second: Value) => boolean;
|
|
54
|
-
};
|
|
55
|
-
export type ReactiveState<Value, Equal> = {
|
|
56
|
-
computeds: Set<Computed<unknown>>;
|
|
57
|
-
effects: Set<Effect>;
|
|
58
|
-
equal: (first: Equal, second: Equal) => boolean;
|
|
59
|
-
subscriptions: Map<GenericCallback, Subscription>;
|
|
60
|
-
value: Value;
|
|
61
|
-
};
|
|
62
|
-
declare class Subscription {
|
|
63
|
-
state: ReactiveState<unknown, never>;
|
|
64
|
-
callback: GenericCallback;
|
|
65
|
-
constructor(state: ReactiveState<unknown, never>, callback: GenericCallback);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Unsubscribe from changes
|
|
69
|
-
*/
|
|
70
|
-
export type Unsubscribe = () => void;
|
|
71
|
-
declare class Fragment {
|
|
72
|
-
private readonly $fragment;
|
|
73
|
-
private readonly data;
|
|
74
|
-
get identifier(): Key | undefined;
|
|
75
|
-
constructor(strings: TemplateStringsArray, expressions: unknown[]);
|
|
76
|
-
/**
|
|
77
|
-
* Appends the fragment to the given element
|
|
78
|
-
*/
|
|
79
|
-
appendTo(element: Element): void;
|
|
80
|
-
/**
|
|
81
|
-
* Gets a list of the fragment's nodes
|
|
82
|
-
*/
|
|
83
|
-
get(): ChildNode[];
|
|
84
|
-
identify(identifier: Key): Fragment;
|
|
85
|
-
/**
|
|
86
|
-
* Removes the fragment from the DOM
|
|
87
|
-
*/
|
|
88
|
-
remove(): void;
|
|
89
|
-
}
|
|
90
|
-
export type FragmentData = {
|
|
91
|
-
expressions: unknown[];
|
|
92
|
-
identifier?: Key;
|
|
93
|
-
items: FragmentItem[];
|
|
94
|
-
mora: MoraData;
|
|
95
|
-
strings: TemplateStringsArray;
|
|
96
|
-
values: unknown[];
|
|
97
|
-
};
|
|
98
|
-
export type FragmentItem = {
|
|
99
|
-
fragments?: Fragment[];
|
|
100
|
-
nodes: ChildNode[];
|
|
101
|
-
};
|
|
102
|
-
export type MoraData = {
|
|
103
|
-
subscribers: Set<() => void>;
|
|
104
|
-
values: Set<Reactive<unknown>>;
|
|
105
|
-
};
|
|
106
|
-
export declare function setReactiveValue(data: FragmentData, comment: Comment, reactive: Reactive<unknown>): void;
|
|
107
|
-
|
|
108
|
-
export {};
|
package/types/parse.d.cts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A generic key type
|
|
5
|
-
*/
|
|
6
|
-
export type Key = number | string;
|
|
7
|
-
export type GenericCallback = (...args: any[]) => any;
|
|
8
|
-
declare class Effect {
|
|
9
|
-
private readonly $mora;
|
|
10
|
-
private readonly state;
|
|
11
|
-
constructor(callback: GenericCallback);
|
|
12
|
-
}
|
|
13
|
-
declare class Computed<Value> extends Reactive<Value> {
|
|
14
|
-
private readonly effect;
|
|
15
|
-
constructor(callback: () => Value, options?: ReactiveOptions<Value>);
|
|
16
|
-
/**
|
|
17
|
-
* @inheritdoc
|
|
18
|
-
*/
|
|
19
|
-
get(): Value;
|
|
20
|
-
}
|
|
21
|
-
declare abstract class Reactive<Value, Equal = Value> {
|
|
22
|
-
protected readonly state: ReactiveState<Value, Equal>;
|
|
23
|
-
constructor(name: string, value: Value, options?: ReactiveOptions<Equal>);
|
|
24
|
-
/**
|
|
25
|
-
* Get the value
|
|
26
|
-
*/
|
|
27
|
-
abstract get(): Value;
|
|
28
|
-
/**
|
|
29
|
-
* Get the value _(without reactivity)_
|
|
30
|
-
*/
|
|
31
|
-
peek(): Value;
|
|
32
|
-
/**
|
|
33
|
-
* Subscribe to changes
|
|
34
|
-
*/
|
|
35
|
-
subscribe(callback: (value: Value) => void): Unsubscribe;
|
|
36
|
-
/**
|
|
37
|
-
* JSON representation of the value
|
|
38
|
-
*/
|
|
39
|
-
toJSON(): Value;
|
|
40
|
-
/**
|
|
41
|
-
* String representation of the value
|
|
42
|
-
*/
|
|
43
|
-
toString(): string;
|
|
44
|
-
/**
|
|
45
|
-
* Unsubscribe from changes
|
|
46
|
-
*/
|
|
47
|
-
unsubscribe(callback: (value: Value) => void): void;
|
|
48
|
-
}
|
|
49
|
-
export type ReactiveOptions<Value> = {
|
|
50
|
-
/**
|
|
51
|
-
* Method to compare values for equality
|
|
52
|
-
*/
|
|
53
|
-
equal?: (first: Value, second: Value) => boolean;
|
|
54
|
-
};
|
|
55
|
-
export type ReactiveState<Value, Equal> = {
|
|
56
|
-
computeds: Set<Computed<unknown>>;
|
|
57
|
-
effects: Set<Effect>;
|
|
58
|
-
equal: (first: Equal, second: Equal) => boolean;
|
|
59
|
-
subscriptions: Map<GenericCallback, Subscription>;
|
|
60
|
-
value: Value;
|
|
61
|
-
};
|
|
62
|
-
declare class Subscription {
|
|
63
|
-
state: ReactiveState<unknown, never>;
|
|
64
|
-
callback: GenericCallback;
|
|
65
|
-
constructor(state: ReactiveState<unknown, never>, callback: GenericCallback);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Unsubscribe from changes
|
|
69
|
-
*/
|
|
70
|
-
export type Unsubscribe = () => void;
|
|
71
|
-
declare class Fragment {
|
|
72
|
-
private readonly $fragment;
|
|
73
|
-
private readonly data;
|
|
74
|
-
get identifier(): Key | undefined;
|
|
75
|
-
constructor(strings: TemplateStringsArray, expressions: unknown[]);
|
|
76
|
-
/**
|
|
77
|
-
* Appends the fragment to the given element
|
|
78
|
-
*/
|
|
79
|
-
appendTo(element: Element): void;
|
|
80
|
-
/**
|
|
81
|
-
* Gets a list of the fragment's nodes
|
|
82
|
-
*/
|
|
83
|
-
get(): ChildNode[];
|
|
84
|
-
identify(identifier: Key): Fragment;
|
|
85
|
-
/**
|
|
86
|
-
* Removes the fragment from the DOM
|
|
87
|
-
*/
|
|
88
|
-
remove(): void;
|
|
89
|
-
}
|
|
90
|
-
export type FragmentData = {
|
|
91
|
-
expressions: unknown[];
|
|
92
|
-
identifier?: Key;
|
|
93
|
-
items: FragmentItem[];
|
|
94
|
-
mora: MoraData;
|
|
95
|
-
strings: TemplateStringsArray;
|
|
96
|
-
values: unknown[];
|
|
97
|
-
};
|
|
98
|
-
export type FragmentItem = {
|
|
99
|
-
fragments?: Fragment[];
|
|
100
|
-
nodes: ChildNode[];
|
|
101
|
-
};
|
|
102
|
-
export type MoraData = {
|
|
103
|
-
subscribers: Set<() => void>;
|
|
104
|
-
values: Set<Reactive<unknown>>;
|
|
105
|
-
};
|
|
106
|
-
export declare function parse(data: FragmentData): string;
|
|
107
|
-
|
|
108
|
-
export {};
|