@base-framework/base 3.5.14 → 3.5.16
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.
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ConnectionTracker
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* connections
|
|
4
|
+
* Tracks active connections in the data binder. Supports multiple
|
|
5
|
+
* connections per element+attribute pair.
|
|
6
6
|
*
|
|
7
7
|
* @class
|
|
8
8
|
*/
|
|
9
9
|
export class ConnectionTracker {
|
|
10
10
|
/**
|
|
11
|
-
* @member {Map} connections
|
|
11
|
+
* @member {Map<string, Map<string, object|object[]>>} connections
|
|
12
12
|
*/
|
|
13
13
|
connections: Map<any, any>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Adds a connection to be tracked.
|
|
16
16
|
*
|
|
17
17
|
* @param {string} id
|
|
18
18
|
* @param {string} attr
|
|
@@ -21,25 +21,34 @@ export class ConnectionTracker {
|
|
|
21
21
|
*/
|
|
22
22
|
add(id: string, attr: string, connection: object): object;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Gets the most recent connection for an element+attribute.
|
|
25
25
|
*
|
|
26
26
|
* @param {string} id
|
|
27
27
|
* @param {string} attr
|
|
28
|
-
* @returns {object|
|
|
28
|
+
* @returns {object|false}
|
|
29
29
|
*/
|
|
30
|
-
get(id: string, attr: string): object |
|
|
30
|
+
get(id: string, attr: string): object | false;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Gets or creates the attribute map for an element.
|
|
33
33
|
*
|
|
34
34
|
* @param {string} id
|
|
35
|
-
* @returns {object}
|
|
35
|
+
* @returns {Map<string, object|object[]>}
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
getOrCreate(id: string): Map<string, object | object[]>;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Removes connections by id, or by id+attr.
|
|
40
|
+
*
|
|
40
41
|
* @param {string} id
|
|
41
42
|
* @param {string} [attr]
|
|
42
43
|
* @returns {void}
|
|
43
44
|
*/
|
|
44
45
|
remove(id: string, attr?: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Unsubscribes a connection or array of connections.
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
* @param {object|object[]|undefined} connection
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
|
+
private unsubscribe;
|
|
45
54
|
}
|