dothtml-interfaces 0.4.2 → 0.4.3
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/package.json +1 -1
- package/src/i-dot.d.ts +6 -1
- package/src/i-reactive.d.ts +10 -0
package/package.json
CHANGED
package/src/i-dot.d.ts
CHANGED
|
@@ -65,7 +65,12 @@ export interface IDotDocument {
|
|
|
65
65
|
*/
|
|
66
66
|
iterate(n: number, callback: (i: number) => DotContent): IDotDocument;
|
|
67
67
|
each<T>(a: Array<T> | { [key: string | number]: T }, callback: (x: T, i: number, k: string | number) => DotContent): IDotDocument;
|
|
68
|
-
each<T>(a:
|
|
68
|
+
each<T>(a:
|
|
69
|
+
IReactive<Array<T>>
|
|
70
|
+
|IReactive<Record<string|number, T>>
|
|
71
|
+
|IBoundReactive<any, Array<T>>
|
|
72
|
+
|IBoundReactive<any, IReactive<Record<string|number, T>>>
|
|
73
|
+
, callback: (x: T, i: IBoundReactive<number>, k: string | number) => DotContent): IDotDocument;
|
|
69
74
|
|
|
70
75
|
/**
|
|
71
76
|
* Removes the targeted document and everything in it.
|
package/src/i-reactive.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export interface IReactive<T = any>{
|
|
|
14
14
|
// subscribeCallback(callback: (value: T)=>void): number;
|
|
15
15
|
// detachBinding(id: number);
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Subscribe to changes in the reactive object.
|
|
19
|
+
*/
|
|
20
|
+
subscribe(callback: Function): number;
|
|
21
|
+
|
|
17
22
|
_subscribe(boundReactive: IBoundReactive, item: any);
|
|
18
23
|
_detachBinding(id: number);
|
|
19
24
|
|
|
@@ -39,6 +44,11 @@ export interface IBoundReactive<T = any, Td = T>{
|
|
|
39
44
|
_source: IReactive<T>;
|
|
40
45
|
_get: ()=>Td;
|
|
41
46
|
_set: (v: string|number|boolean)=>void;
|
|
47
|
+
|
|
48
|
+
_transform: {
|
|
49
|
+
display?: (v: T)=>Td;
|
|
50
|
+
read?: (v: string)=>T;
|
|
51
|
+
}
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
export type AnyReactive = IBoundReactive|IReactive;
|