@base-framework/base 3.0.90 → 3.0.91

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.
@@ -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/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';
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export class OneWayConnection extends Connection {
10
10
  /**
11
- * @member {object} source
11
+ * @member {object|null} source
12
12
  */
13
13
  source: OneWaySource;
14
14
  /**
@@ -10,15 +10,16 @@ export class TwoWayConnection extends Connection {
10
10
  /**
11
11
  * This will create a two way connection.
12
12
  *
13
+ * @param {object} pubSub
13
14
  * @constructor
14
15
  */
15
- constructor(pubSub: any);
16
+ constructor(pubSub: object);
16
17
  /**
17
- * @member {object} element
18
+ * @member {object|null} element
18
19
  */
19
20
  element: ElementSource;
20
21
  /**
21
- * @member {object} data
22
+ * @member {object|null} data
22
23
  */
23
24
  data: DataSource;
24
25
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/base",
3
- "version": "3.0.90",
3
+ "version": "3.0.91",
4
4
  "description": "This is a javascript framework.",
5
5
  "main": "/dist/base.js",
6
6
  "scripts": {