@base-framework/base 3.0.79 → 3.0.81
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/base.js +1 -1
- package/dist/base.js.map +3 -3
- package/dist/types/base.d.ts +25 -0
- package/dist/types/main/base.d.ts +94 -0
- package/dist/types/main/data-tracker/data-tracker.d.ts +93 -0
- package/dist/types/main/data-tracker/tracker-types.d.ts +23 -0
- package/dist/types/main/data-tracker/tracker.d.ts +56 -0
- package/dist/types/main/equals.d.ts +1 -0
- package/dist/types/main/events/event-methods.d.ts +124 -0
- package/dist/types/main/events/events.d.ts +208 -0
- package/dist/types/modules/ajax/ajax.d.ts +153 -0
- package/dist/types/modules/animation/animation.d.ts +79 -0
- package/dist/types/modules/animations/animation-controller.d.ts +61 -0
- package/dist/types/modules/animations/animation.d.ts +28 -0
- package/dist/types/modules/animations/attr-movement.d.ts +5 -0
- package/dist/types/modules/animations/css-movement.d.ts +8 -0
- package/dist/types/modules/animations/movement-factory.d.ts +34 -0
- package/dist/types/modules/animations/movement.d.ts +24 -0
- package/dist/types/modules/animations/value.d.ts +30 -0
- package/dist/types/modules/atom/atom.d.ts +1 -0
- package/dist/types/modules/atom/atoms.d.ts +343 -0
- package/dist/types/modules/component/component.d.ts +99 -0
- package/dist/types/modules/component/event-helper.d.ts +59 -0
- package/dist/types/modules/component/jot.d.ts +1 -0
- package/dist/types/modules/component/parse-args.d.ts +1 -0
- package/dist/types/modules/component/state-helper.d.ts +102 -0
- package/dist/types/modules/component/unit.d.ts +281 -0
- package/dist/types/modules/data/attrs.d.ts +1 -0
- package/dist/types/modules/data/basic-data.d.ts +259 -0
- package/dist/types/modules/data/data-proxy.d.ts +1 -0
- package/dist/types/modules/data/data-utils.d.ts +17 -0
- package/dist/types/modules/data/data.d.ts +3 -0
- package/dist/types/modules/data/deep-data.d.ts +162 -0
- package/dist/types/modules/data/model-service.d.ts +280 -0
- package/dist/types/modules/data/model.d.ts +33 -0
- package/dist/types/modules/data/simple-data.d.ts +12 -0
- package/dist/types/modules/data-binder/connection-tracker/connection-tracker.d.ts +45 -0
- package/dist/types/modules/data-binder/connection-tracker/connections/connection.d.ts +15 -0
- package/dist/types/modules/data-binder/connection-tracker/connections/one-way-connection.d.ts +23 -0
- package/dist/types/modules/data-binder/connection-tracker/connections/two-way-connection.d.ts +62 -0
- package/dist/types/modules/data-binder/data-binder.d.ts +175 -0
- package/dist/types/modules/data-binder/data-pub-sub.d.ts +66 -0
- package/dist/types/modules/data-binder/sources/data-source.d.ts +51 -0
- package/dist/types/modules/data-binder/sources/element-source.d.ts +84 -0
- package/dist/types/modules/data-binder/sources/one-way-source.d.ts +33 -0
- package/dist/types/modules/data-binder/sources/source.d.ts +26 -0
- package/dist/types/modules/data-binder/sources/two-way-source.d.ts +42 -0
- package/dist/types/modules/date/date-time.d.ts +165 -0
- package/dist/types/modules/history/history.d.ts +10 -0
- package/dist/types/modules/html/html.d.ts +136 -0
- package/dist/types/modules/import/import.d.ts +1 -0
- package/dist/types/modules/layout/builder.d.ts +102 -0
- package/dist/types/modules/layout/directives/core/aria/aria.d.ts +2 -0
- package/dist/types/modules/layout/directives/core/context/context-directives.d.ts +3 -0
- package/dist/types/modules/layout/directives/core/default-directives.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/dom-methods.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/parent/parent-directives.d.ts +5 -0
- package/dist/types/modules/layout/directives/core/reactive/bind.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/for-each.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/get-parent-data.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/map.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/on-created.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/on-destroyed.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/on-set.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/on-state.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/reactive/watch.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/route.d.ts +1 -0
- package/dist/types/modules/layout/directives/core/switch.d.ts +1 -0
- package/dist/types/modules/layout/directives/directive.d.ts +1 -0
- package/dist/types/modules/layout/directives/directives.d.ts +25 -0
- package/dist/types/modules/layout/element/attribute-directive.d.ts +1 -0
- package/dist/types/modules/layout/element/attribute.d.ts +1 -0
- package/dist/types/modules/layout/element/element.d.ts +1 -0
- package/dist/types/modules/layout/element/parser.d.ts +65 -0
- package/dist/types/modules/layout/html-helper.d.ts +57 -0
- package/dist/types/modules/layout/render/browser-render.d.ts +10 -0
- package/dist/types/modules/layout/render/render-controller.d.ts +23 -0
- package/dist/types/modules/layout/render/render.d.ts +18 -0
- package/dist/types/modules/layout/render/server-render.d.ts +10 -0
- package/dist/types/modules/layout/watcher-helper.d.ts +103 -0
- package/dist/types/modules/mouse/mouse.d.ts +45 -0
- package/dist/types/modules/router/history/browser-history.d.ts +39 -0
- package/dist/types/modules/router/history/hash-history.d.ts +25 -0
- package/dist/types/modules/router/history/history-controller.d.ts +21 -0
- package/dist/types/modules/router/history/history.d.ts +35 -0
- package/dist/types/modules/router/nav-link.d.ts +37 -0
- package/dist/types/modules/router/router.d.ts +268 -0
- package/dist/types/modules/router/routes/component-helper.d.ts +75 -0
- package/dist/types/modules/router/routes/param-pattern.d.ts +2 -0
- package/dist/types/modules/router/routes/route-pattern.d.ts +1 -0
- package/dist/types/modules/router/routes/route.d.ts +120 -0
- package/dist/types/modules/router/set-title.d.ts +1 -0
- package/dist/types/modules/router/utils.d.ts +9 -0
- package/dist/types/modules/state/state-target.d.ts +45 -0
- package/dist/types/modules/state/state-tracker.d.ts +103 -0
- package/dist/types/shared/arrays.d.ts +26 -0
- package/dist/types/shared/dom.d.ts +272 -0
- package/dist/types/shared/encode/encode.d.ts +38 -0
- package/dist/types/shared/encode/json.d.ts +15 -0
- package/dist/types/shared/objects.d.ts +62 -0
- package/dist/types/shared/strings.d.ts +34 -0
- package/dist/types/shared/types.d.ts +52 -0
- package/package.json +5 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data
|
|
3
|
+
*
|
|
4
|
+
* This will create a new data object that can be used to
|
|
5
|
+
* bind elements to values.
|
|
6
|
+
*
|
|
7
|
+
* @class
|
|
8
|
+
* @augments BasicData
|
|
9
|
+
*/
|
|
10
|
+
export class Data extends BasicData {
|
|
11
|
+
attributes: any;
|
|
12
|
+
/**
|
|
13
|
+
* This will update an attribute value.
|
|
14
|
+
*
|
|
15
|
+
* @protected
|
|
16
|
+
* @param {object} obj
|
|
17
|
+
* @param {string} attr
|
|
18
|
+
* @param {*} val
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
21
|
+
protected _updateAttr(obj: object, attr: string, val: any): void;
|
|
22
|
+
/**
|
|
23
|
+
* This will set the attribute value.
|
|
24
|
+
*
|
|
25
|
+
* @override
|
|
26
|
+
* @protected
|
|
27
|
+
* @param {string} attr
|
|
28
|
+
* @param {*} val
|
|
29
|
+
* @param {object} committer
|
|
30
|
+
* @param {boolean} stopMerge
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
protected override _setAttr(attr: string, val: any, committer: object, stopMerge: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* This will link a data attr object to another data object.
|
|
36
|
+
*
|
|
37
|
+
* @param {object} data
|
|
38
|
+
* @param {string} attr
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
41
|
+
linkAttr(data: object, attr: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* This will create a new data source by scoping the parent
|
|
44
|
+
* data attr and linking the two sources.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} attr
|
|
47
|
+
* @param {object} [constructor]
|
|
48
|
+
* @returns {object}
|
|
49
|
+
*/
|
|
50
|
+
scope(attr: string, constructor?: object): object;
|
|
51
|
+
/**
|
|
52
|
+
* This will splice a value from an array and set
|
|
53
|
+
* the result.
|
|
54
|
+
*
|
|
55
|
+
* @param {string} attr
|
|
56
|
+
* @param {number} index
|
|
57
|
+
* @returns {object} this
|
|
58
|
+
*/
|
|
59
|
+
splice(attr: string, index: number): object;
|
|
60
|
+
/**
|
|
61
|
+
* This will add a value to an array and set the result.
|
|
62
|
+
*
|
|
63
|
+
* @param {string} attr
|
|
64
|
+
* @param {*} value
|
|
65
|
+
* @returns {object} this
|
|
66
|
+
*/
|
|
67
|
+
push(attr: string, value: any): object;
|
|
68
|
+
/**
|
|
69
|
+
* This will add a value to an array and set the result.
|
|
70
|
+
*
|
|
71
|
+
* @param {string} attr
|
|
72
|
+
* @param {*} value
|
|
73
|
+
* @returns {object} this
|
|
74
|
+
*/
|
|
75
|
+
unshift(attr: string, value: any): object;
|
|
76
|
+
/**
|
|
77
|
+
* This will add a value to an array and set the result.
|
|
78
|
+
*
|
|
79
|
+
* @param {string} attr
|
|
80
|
+
* @returns {*}
|
|
81
|
+
*/
|
|
82
|
+
shift(attr: string): any;
|
|
83
|
+
/**
|
|
84
|
+
* This will pop the last value from an array and set the result.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} attr
|
|
87
|
+
* @returns {*}
|
|
88
|
+
*/
|
|
89
|
+
pop(attr: string): any;
|
|
90
|
+
/**
|
|
91
|
+
* This will refresh the value.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} attr
|
|
94
|
+
* @returns {object} this
|
|
95
|
+
*/
|
|
96
|
+
refresh(attr: string): object;
|
|
97
|
+
/**
|
|
98
|
+
* This will publish an update to the data binder.
|
|
99
|
+
*
|
|
100
|
+
* @protected
|
|
101
|
+
* @param {string} attr
|
|
102
|
+
* @param {*} val
|
|
103
|
+
* @param {*} committer
|
|
104
|
+
* @returns {void}
|
|
105
|
+
*/
|
|
106
|
+
protected _publish(attr: string, val: any, committer: any): void;
|
|
107
|
+
/**
|
|
108
|
+
* This will publish deep and simple data to the data binder.
|
|
109
|
+
*
|
|
110
|
+
* @protected
|
|
111
|
+
* @param {string} attr
|
|
112
|
+
* @param {*} val
|
|
113
|
+
* @param {object} committer
|
|
114
|
+
* @returns {void}
|
|
115
|
+
*/
|
|
116
|
+
protected publishDeep(attr: string, val: any, committer: object): void;
|
|
117
|
+
/**
|
|
118
|
+
* This will publish an update to the data binder.
|
|
119
|
+
*
|
|
120
|
+
* @protected
|
|
121
|
+
* @param {string} pathString
|
|
122
|
+
* @param {*} obj
|
|
123
|
+
* @param {*} committer
|
|
124
|
+
* @returns {void}
|
|
125
|
+
*/
|
|
126
|
+
protected publish(pathString: string, obj: any, committer: any): void;
|
|
127
|
+
/**
|
|
128
|
+
* This will check if the value is an object and publish
|
|
129
|
+
* the value or the object.
|
|
130
|
+
*
|
|
131
|
+
* @protected
|
|
132
|
+
* @param {string} subPath
|
|
133
|
+
* @param {*} val
|
|
134
|
+
* @param {object} committer
|
|
135
|
+
* @returns {void}
|
|
136
|
+
*/
|
|
137
|
+
protected _checkPublish(subPath: string, val: any, committer: object): void;
|
|
138
|
+
/**
|
|
139
|
+
* This will publish an update on an attribute.
|
|
140
|
+
*
|
|
141
|
+
* @protected
|
|
142
|
+
* @param {string} subPath
|
|
143
|
+
* @param {*} val
|
|
144
|
+
* @param {object} committer
|
|
145
|
+
* @returns {void}
|
|
146
|
+
*/
|
|
147
|
+
protected _publishAttr(subPath: string, val: any, committer: object): void;
|
|
148
|
+
/**
|
|
149
|
+
* This will merge the attribute with the stage.
|
|
150
|
+
*
|
|
151
|
+
* @protected
|
|
152
|
+
* @returns {void}
|
|
153
|
+
*/
|
|
154
|
+
protected mergeStage(): void;
|
|
155
|
+
/**
|
|
156
|
+
* This will revert the stage back to the previous attributes.
|
|
157
|
+
*
|
|
158
|
+
* @returns {void}
|
|
159
|
+
*/
|
|
160
|
+
revert(): void;
|
|
161
|
+
}
|
|
162
|
+
import { BasicData } from './basic-data.js';
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModelService
|
|
3
|
+
*
|
|
4
|
+
* This will create a new model service.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
export class ModelService {
|
|
9
|
+
/**
|
|
10
|
+
* This will extend the model service.
|
|
11
|
+
*
|
|
12
|
+
* @param {object} child
|
|
13
|
+
* @returns {object}
|
|
14
|
+
*/
|
|
15
|
+
static extend(child: object): object;
|
|
16
|
+
/**
|
|
17
|
+
* This will create a model service.
|
|
18
|
+
*
|
|
19
|
+
* @constructor
|
|
20
|
+
* @param {object} model
|
|
21
|
+
*/
|
|
22
|
+
constructor(model: object);
|
|
23
|
+
/**
|
|
24
|
+
* @member {object} model
|
|
25
|
+
*/
|
|
26
|
+
model: any;
|
|
27
|
+
/**
|
|
28
|
+
* @member {string} objectType The return type.
|
|
29
|
+
*/
|
|
30
|
+
objectType: string;
|
|
31
|
+
/**
|
|
32
|
+
* @member {string} url
|
|
33
|
+
*/
|
|
34
|
+
url: string;
|
|
35
|
+
/**
|
|
36
|
+
* @member {function} validateCallBack
|
|
37
|
+
*/
|
|
38
|
+
validateCallBack: any;
|
|
39
|
+
/**
|
|
40
|
+
* This will initialize the model service.
|
|
41
|
+
*
|
|
42
|
+
* @protected
|
|
43
|
+
* @returns {void}
|
|
44
|
+
*/
|
|
45
|
+
protected init(): void;
|
|
46
|
+
/**
|
|
47
|
+
* This will check if the model is valid.
|
|
48
|
+
*
|
|
49
|
+
* @returns {boolean}
|
|
50
|
+
*/
|
|
51
|
+
isValid(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* This should be overriden to validate the model
|
|
54
|
+
* before submitting.
|
|
55
|
+
*
|
|
56
|
+
* @returns {boolean}
|
|
57
|
+
*/
|
|
58
|
+
validate(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* This can be overriden to add default params
|
|
61
|
+
* with each request.
|
|
62
|
+
*
|
|
63
|
+
* @protected
|
|
64
|
+
* @returns {string}
|
|
65
|
+
*/
|
|
66
|
+
protected getDefaultParams(): string;
|
|
67
|
+
/**
|
|
68
|
+
* This will setup the request params.
|
|
69
|
+
*
|
|
70
|
+
* @protected
|
|
71
|
+
* @param {(string|object)} params
|
|
72
|
+
* @returns {(string|object)}
|
|
73
|
+
*/
|
|
74
|
+
protected setupParams(params: (string | object)): (string | object);
|
|
75
|
+
/**
|
|
76
|
+
* This will convert an object to a string.
|
|
77
|
+
*
|
|
78
|
+
* @protected
|
|
79
|
+
* @param {object} object
|
|
80
|
+
* @returns {string}
|
|
81
|
+
*/
|
|
82
|
+
protected objectToString(object: object): string;
|
|
83
|
+
/**
|
|
84
|
+
* This will add the params.
|
|
85
|
+
*
|
|
86
|
+
* @protected
|
|
87
|
+
* @param {*} params
|
|
88
|
+
* @param {*} addingParams
|
|
89
|
+
* @returns {(string|object)}
|
|
90
|
+
*/
|
|
91
|
+
protected addParams(params: any, addingParams: any): (string | object);
|
|
92
|
+
/**
|
|
93
|
+
* This will get the model by id.
|
|
94
|
+
*
|
|
95
|
+
* @param {string} [instanceParams]
|
|
96
|
+
* @param {function} [callBack]
|
|
97
|
+
* @returns {object}
|
|
98
|
+
*/
|
|
99
|
+
get(instanceParams?: string, callBack?: Function): object;
|
|
100
|
+
/**
|
|
101
|
+
* This will get the object from the response.
|
|
102
|
+
*
|
|
103
|
+
* @protected
|
|
104
|
+
* @param {object} response
|
|
105
|
+
* @returns {object}
|
|
106
|
+
*/
|
|
107
|
+
protected getObject(response: object): object;
|
|
108
|
+
/**
|
|
109
|
+
* This will return a string with the model data json encoded.
|
|
110
|
+
*
|
|
111
|
+
* @protected
|
|
112
|
+
* @returns {string}
|
|
113
|
+
*/
|
|
114
|
+
protected setupObjectData(): string;
|
|
115
|
+
/**
|
|
116
|
+
* This will add or update the model.
|
|
117
|
+
*
|
|
118
|
+
* @param {string} [instanceParams]
|
|
119
|
+
* @param {function} [callBack]
|
|
120
|
+
* @returns {object}
|
|
121
|
+
*/
|
|
122
|
+
setup(instanceParams?: string, callBack?: Function): object;
|
|
123
|
+
/**
|
|
124
|
+
* This will add the model.
|
|
125
|
+
*
|
|
126
|
+
* @param {string} [instanceParams]
|
|
127
|
+
* @param {function} [callBack]
|
|
128
|
+
* @returns {object}
|
|
129
|
+
*/
|
|
130
|
+
add(instanceParams?: string, callBack?: Function): object;
|
|
131
|
+
/**
|
|
132
|
+
* This will update the model.
|
|
133
|
+
*
|
|
134
|
+
* @param {string} [instanceParams]
|
|
135
|
+
* @param {function} [callBack]
|
|
136
|
+
* @returns {object}
|
|
137
|
+
*/
|
|
138
|
+
update(instanceParams?: string, callBack?: Function): object;
|
|
139
|
+
/**
|
|
140
|
+
* This will delete the model.
|
|
141
|
+
*
|
|
142
|
+
* @param {string} [instanceParams]
|
|
143
|
+
* @param {function} [callBack]
|
|
144
|
+
* @returns {object}
|
|
145
|
+
*/
|
|
146
|
+
delete(instanceParams?: string, callBack?: Function): object;
|
|
147
|
+
/**
|
|
148
|
+
* This will list rows of the model.
|
|
149
|
+
*
|
|
150
|
+
* @param {string} instanceParams
|
|
151
|
+
* @param {function} callBack
|
|
152
|
+
* @param {number} start
|
|
153
|
+
* @param {number} count
|
|
154
|
+
* @param {string} filter
|
|
155
|
+
* @returns {object}
|
|
156
|
+
*/
|
|
157
|
+
all(instanceParams: string, callBack: Function, start: number, count: number, filter: string): object;
|
|
158
|
+
/**
|
|
159
|
+
* This will get the url.
|
|
160
|
+
*
|
|
161
|
+
* @protected
|
|
162
|
+
* @param {string} url
|
|
163
|
+
* @returns {string}
|
|
164
|
+
*/
|
|
165
|
+
protected getUrl(url: string): string;
|
|
166
|
+
/**
|
|
167
|
+
* This will make an ajax request.
|
|
168
|
+
*
|
|
169
|
+
* @protected
|
|
170
|
+
* @param {string} url
|
|
171
|
+
* @param {string} method
|
|
172
|
+
* @param {(string|object)} params
|
|
173
|
+
* @param {function} callBack
|
|
174
|
+
* @param {function} [requestCallBack]
|
|
175
|
+
* @returns {object}
|
|
176
|
+
*/
|
|
177
|
+
protected setupRequest(url: string, method: string, params: (string | object), callBack: Function, requestCallBack?: Function): object;
|
|
178
|
+
/**
|
|
179
|
+
* This will check if the data is a form data object.
|
|
180
|
+
*
|
|
181
|
+
* @protected
|
|
182
|
+
* @param {*} data
|
|
183
|
+
* @returns {boolean}
|
|
184
|
+
*/
|
|
185
|
+
protected _isFormData(data: any): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* This will make an ajax request.
|
|
188
|
+
*
|
|
189
|
+
* @protected
|
|
190
|
+
* @param {(string|object)} params
|
|
191
|
+
* @param {string} instanceParams
|
|
192
|
+
* @param {function} callBack
|
|
193
|
+
* @param {function} [requestCallBack]
|
|
194
|
+
* @returns {object}
|
|
195
|
+
*/
|
|
196
|
+
protected request(params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
|
|
197
|
+
/**
|
|
198
|
+
* This will make a GET request.
|
|
199
|
+
*
|
|
200
|
+
* @protected
|
|
201
|
+
* @param {string} url
|
|
202
|
+
* @param {(string|object)} params
|
|
203
|
+
* @param {string} instanceParams
|
|
204
|
+
* @param {function} callBack
|
|
205
|
+
* @param {function} [requestCallBack]
|
|
206
|
+
* @returns {object}
|
|
207
|
+
*/
|
|
208
|
+
protected _get(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
|
|
209
|
+
/**
|
|
210
|
+
* This will make a POST request.
|
|
211
|
+
*
|
|
212
|
+
* @protected
|
|
213
|
+
* @param {string} url
|
|
214
|
+
* @param {(string|object)} params
|
|
215
|
+
* @param {string} instanceParams
|
|
216
|
+
* @param {function} callBack
|
|
217
|
+
* @param {function} [requestCallBack]
|
|
218
|
+
* @returns {object}
|
|
219
|
+
*/
|
|
220
|
+
protected _post(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
|
|
221
|
+
/**
|
|
222
|
+
* This will make a PUT request.
|
|
223
|
+
*
|
|
224
|
+
* @protected
|
|
225
|
+
* @param {string} url
|
|
226
|
+
* @param {(string|object)} params
|
|
227
|
+
* @param {string} instanceParams
|
|
228
|
+
* @param {function} callBack
|
|
229
|
+
* @param {function} [requestCallBack]
|
|
230
|
+
* @returns {object}
|
|
231
|
+
*/
|
|
232
|
+
protected _put(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
|
|
233
|
+
/**
|
|
234
|
+
* This will make a PATCH request.
|
|
235
|
+
*
|
|
236
|
+
* @protected
|
|
237
|
+
* @param {string} url
|
|
238
|
+
* @param {(string|object)} params
|
|
239
|
+
* @param {string} instanceParams
|
|
240
|
+
* @param {function} callBack
|
|
241
|
+
* @param {function} [requestCallBack]
|
|
242
|
+
* @returns {object}
|
|
243
|
+
*/
|
|
244
|
+
protected _patch(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
|
|
245
|
+
/**
|
|
246
|
+
* This will make a DELETE request.
|
|
247
|
+
*
|
|
248
|
+
* @protected
|
|
249
|
+
* @param {string} url
|
|
250
|
+
* @param {(string|object)} params
|
|
251
|
+
* @param {string} instanceParams
|
|
252
|
+
* @param {function} callBack
|
|
253
|
+
* @param {function} [requestCallBack]
|
|
254
|
+
* @returns {object}
|
|
255
|
+
*/
|
|
256
|
+
protected _delete(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
|
|
257
|
+
/**
|
|
258
|
+
* This will make an ajax request.
|
|
259
|
+
*
|
|
260
|
+
* @protected
|
|
261
|
+
* @param {string} url
|
|
262
|
+
* @param {string} method
|
|
263
|
+
* @param {(string|object)} params
|
|
264
|
+
* @param {string} instanceParams
|
|
265
|
+
* @param {function} callBack
|
|
266
|
+
* @param {function} [requestCallBack]
|
|
267
|
+
* @returns {object}
|
|
268
|
+
*/
|
|
269
|
+
protected _request(url: string, method: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
|
|
270
|
+
/**
|
|
271
|
+
* This will get the response.
|
|
272
|
+
*
|
|
273
|
+
* @protected
|
|
274
|
+
* @param {object} response
|
|
275
|
+
* @param {function} callBack
|
|
276
|
+
* @param {object} xhr
|
|
277
|
+
* @returns {void}
|
|
278
|
+
*/
|
|
279
|
+
protected getResponse(response: object, callBack: Function, xhr: object): void;
|
|
280
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model
|
|
3
|
+
*
|
|
4
|
+
* This will extend Data to add a model that can specify
|
|
5
|
+
* a service that connects to a remote source.
|
|
6
|
+
*
|
|
7
|
+
* @class
|
|
8
|
+
* @extends Data
|
|
9
|
+
*/
|
|
10
|
+
export class Model extends Data {
|
|
11
|
+
/**
|
|
12
|
+
* This will extend the model to a child model.
|
|
13
|
+
*
|
|
14
|
+
* @param {object} [settings]
|
|
15
|
+
* @returns {object}
|
|
16
|
+
*/
|
|
17
|
+
static extend(settings?: object): object;
|
|
18
|
+
/**
|
|
19
|
+
* @member {object|null} xhr
|
|
20
|
+
*/
|
|
21
|
+
xhr: any;
|
|
22
|
+
/**
|
|
23
|
+
* This adds a method to call if you want the model
|
|
24
|
+
* to do something when its initialized.
|
|
25
|
+
*
|
|
26
|
+
* @protected
|
|
27
|
+
* @returns {void}
|
|
28
|
+
*/
|
|
29
|
+
protected initialize(): void;
|
|
30
|
+
service: typeof ModelService;
|
|
31
|
+
}
|
|
32
|
+
import { Data } from './deep-data.js';
|
|
33
|
+
import { ModelService } from './model-service.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SimpleData
|
|
3
|
+
*
|
|
4
|
+
* This will extend Data to add a simple data object
|
|
5
|
+
* that doesn't allow deep nested data.
|
|
6
|
+
*
|
|
7
|
+
* @class
|
|
8
|
+
* @augments BasicData
|
|
9
|
+
*/
|
|
10
|
+
export class SimpleData extends BasicData {
|
|
11
|
+
}
|
|
12
|
+
import { BasicData } from './basic-data.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConnectionTracker
|
|
3
|
+
*
|
|
4
|
+
* This will create a new connection tracker to track active
|
|
5
|
+
* connections in the data binder.
|
|
6
|
+
*
|
|
7
|
+
* @class
|
|
8
|
+
*/
|
|
9
|
+
export class ConnectionTracker {
|
|
10
|
+
/**
|
|
11
|
+
* @member {Map} connections
|
|
12
|
+
*/
|
|
13
|
+
connections: Map<any, any>;
|
|
14
|
+
/**
|
|
15
|
+
* This will add a new connection to be tracked.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} id
|
|
18
|
+
* @param {string} attr
|
|
19
|
+
* @param {object} connection
|
|
20
|
+
* @returns {object}
|
|
21
|
+
*/
|
|
22
|
+
add(id: string, attr: string, connection: object): object;
|
|
23
|
+
/**
|
|
24
|
+
* This will get a connection.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} id
|
|
27
|
+
* @param {string} attr
|
|
28
|
+
* @returns {object|boolean}
|
|
29
|
+
*/
|
|
30
|
+
get(id: string, attr: string): object | boolean;
|
|
31
|
+
/**
|
|
32
|
+
* This will find a connection.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} id
|
|
35
|
+
* @returns {object}
|
|
36
|
+
*/
|
|
37
|
+
find(id: string): object;
|
|
38
|
+
/**
|
|
39
|
+
* This will remove a connection or all connections by id.
|
|
40
|
+
* @param {string} id
|
|
41
|
+
* @param {string} [attr]
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
remove(id: string, attr?: string): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OneWayConnection
|
|
3
|
+
*
|
|
4
|
+
* This will create a one way connection.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
* @augments Connection
|
|
8
|
+
*/
|
|
9
|
+
export class OneWayConnection extends Connection {
|
|
10
|
+
/**
|
|
11
|
+
* @member {object} source
|
|
12
|
+
*/
|
|
13
|
+
source: OneWaySource;
|
|
14
|
+
/**
|
|
15
|
+
* This will setup the connection source.
|
|
16
|
+
*
|
|
17
|
+
* @param {object} data
|
|
18
|
+
* @returns {object}
|
|
19
|
+
*/
|
|
20
|
+
addSource(data: object): object;
|
|
21
|
+
}
|
|
22
|
+
import { Connection } from './connection.js';
|
|
23
|
+
import { OneWaySource } from '../../sources/one-way-source.js';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TwoWayConnection
|
|
3
|
+
*
|
|
4
|
+
* This will setup a two way connection.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
* @augments Connection
|
|
8
|
+
*/
|
|
9
|
+
export class TwoWayConnection extends Connection {
|
|
10
|
+
/**
|
|
11
|
+
* This will create a two way connection.
|
|
12
|
+
*
|
|
13
|
+
* @constructor
|
|
14
|
+
*/
|
|
15
|
+
constructor(pubSub: any);
|
|
16
|
+
/**
|
|
17
|
+
* @member {object} element
|
|
18
|
+
*/
|
|
19
|
+
element: ElementSource;
|
|
20
|
+
/**
|
|
21
|
+
* @member {object} data
|
|
22
|
+
*/
|
|
23
|
+
data: DataSource;
|
|
24
|
+
/**
|
|
25
|
+
* @member {object} pubSub
|
|
26
|
+
*/
|
|
27
|
+
pubSub: any;
|
|
28
|
+
/**
|
|
29
|
+
* This will add the element source.
|
|
30
|
+
*
|
|
31
|
+
* @param {object} element
|
|
32
|
+
* @param {string} attr
|
|
33
|
+
* @param {(string|function)} filter
|
|
34
|
+
* @returns {object}
|
|
35
|
+
*/
|
|
36
|
+
addElement(element: object, attr: string, filter: (string | Function)): object;
|
|
37
|
+
/**
|
|
38
|
+
* This will add the data source.
|
|
39
|
+
*
|
|
40
|
+
* @param {object} data
|
|
41
|
+
* @param {string} prop
|
|
42
|
+
* @returns {object}
|
|
43
|
+
*/
|
|
44
|
+
addData(data: object, prop: string): object;
|
|
45
|
+
/**
|
|
46
|
+
* This will unsubscribe from a source.
|
|
47
|
+
*
|
|
48
|
+
* @param {object} source
|
|
49
|
+
* @returns {object}
|
|
50
|
+
*/
|
|
51
|
+
unsubscribeSource(source: object): object;
|
|
52
|
+
/**
|
|
53
|
+
* This will be used to unsubscribe.
|
|
54
|
+
*
|
|
55
|
+
* @override
|
|
56
|
+
* @returns {object}
|
|
57
|
+
*/
|
|
58
|
+
override unsubscribe(): object;
|
|
59
|
+
}
|
|
60
|
+
import { Connection } from './connection.js';
|
|
61
|
+
import { ElementSource } from '../../sources/element-source.js';
|
|
62
|
+
import { DataSource } from '../../sources/data-source.js';
|