@base-framework/base 3.0.79 → 3.0.80
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,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StateTracker
|
|
3
|
+
*
|
|
4
|
+
* This will create a state tracker that can
|
|
5
|
+
* add and remove targets, actions, and action
|
|
6
|
+
* subscriber callBack functions.
|
|
7
|
+
*
|
|
8
|
+
* @class
|
|
9
|
+
*/
|
|
10
|
+
export class StateTracker {
|
|
11
|
+
/**
|
|
12
|
+
* @member {Map} targets
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
private static targets;
|
|
16
|
+
/**
|
|
17
|
+
* This will restore a state target.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} id
|
|
20
|
+
* @param {object} target
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
23
|
+
static restore(id: string, target: object): void;
|
|
24
|
+
/**
|
|
25
|
+
* This will get the state target.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} id
|
|
28
|
+
* @returns {object}
|
|
29
|
+
*/
|
|
30
|
+
static getTarget(id: string): object;
|
|
31
|
+
/**
|
|
32
|
+
* This will get the state of an action.
|
|
33
|
+
*
|
|
34
|
+
* @protected
|
|
35
|
+
* @param {string} targetId
|
|
36
|
+
* @param {string} action
|
|
37
|
+
* @returns {*}
|
|
38
|
+
*/
|
|
39
|
+
protected static getActionState(targetId: string, action: string): any;
|
|
40
|
+
/**
|
|
41
|
+
* This will add a new target.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} targetId
|
|
44
|
+
* @param {string} [action]
|
|
45
|
+
* @param {*} [state] the primary action state
|
|
46
|
+
* @returns {object}
|
|
47
|
+
*/
|
|
48
|
+
static add(targetId: string, action?: string, state?: any): object;
|
|
49
|
+
/**
|
|
50
|
+
* This will add a new action to a target.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} targetId
|
|
53
|
+
* @param {string} action
|
|
54
|
+
* @param {string} [state]
|
|
55
|
+
* @returns {object}
|
|
56
|
+
*/
|
|
57
|
+
static addAction(targetId: string, action: string, state?: string): object;
|
|
58
|
+
/**
|
|
59
|
+
* This will remove the action from a target.
|
|
60
|
+
*
|
|
61
|
+
* @param {string} targetId
|
|
62
|
+
* @param {string} action
|
|
63
|
+
* @param {string} [token]
|
|
64
|
+
* @returns {void}
|
|
65
|
+
*/
|
|
66
|
+
static removeAction(targetId: string, action: string, token?: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* This will add a new subscriber to the action.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} targetId
|
|
71
|
+
* @param {string} action
|
|
72
|
+
* @param {function} callBack
|
|
73
|
+
* @returns {?string}
|
|
74
|
+
*/
|
|
75
|
+
static on(targetId: string, action: string, callBack: Function): string | null;
|
|
76
|
+
/**
|
|
77
|
+
* This will remove a subscriber from an action.
|
|
78
|
+
*
|
|
79
|
+
* @param {string} targetId
|
|
80
|
+
* @param {string} action
|
|
81
|
+
* @param {string} token
|
|
82
|
+
* @returns {void}
|
|
83
|
+
*/
|
|
84
|
+
static off(targetId: string, action: string, token: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* This will remove a target or action or callBack.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} targetId
|
|
89
|
+
* @param {string} [action]
|
|
90
|
+
* @param {string} [token]
|
|
91
|
+
* @returns {void}
|
|
92
|
+
*/
|
|
93
|
+
static remove(targetId: string, action?: string, token?: string): void;
|
|
94
|
+
/**
|
|
95
|
+
* This will set the action state.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} targetId
|
|
98
|
+
* @param {string} action
|
|
99
|
+
* @param {*} state
|
|
100
|
+
* @returns {void}
|
|
101
|
+
*/
|
|
102
|
+
static set(targetId: string, action: string, state: any): void;
|
|
103
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arrays
|
|
3
|
+
*
|
|
4
|
+
* This will contain methods for working with arrays.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
* @name Arrays
|
|
8
|
+
*/
|
|
9
|
+
export class Arrays {
|
|
10
|
+
/**
|
|
11
|
+
* This will convert an object or collection into an array.
|
|
12
|
+
*
|
|
13
|
+
* @param {object} list
|
|
14
|
+
* @returns {array}
|
|
15
|
+
*/
|
|
16
|
+
static toArray(list: object): any[];
|
|
17
|
+
/**
|
|
18
|
+
* This will check if a value is found in an array.
|
|
19
|
+
*
|
|
20
|
+
* @param {array} array
|
|
21
|
+
* @param {string} element
|
|
22
|
+
* @param {number} [fromIndex]
|
|
23
|
+
* @returns {number} This will return -1 if not found.
|
|
24
|
+
*/
|
|
25
|
+
static inArray(array: any[], element: string, fromIndex?: number): number;
|
|
26
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dom
|
|
3
|
+
*
|
|
4
|
+
* This will contain methods for working with the dom.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
* @name Dom
|
|
8
|
+
*/
|
|
9
|
+
export class Dom {
|
|
10
|
+
/**
|
|
11
|
+
* This will select an element by id.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} id
|
|
14
|
+
* @returns {object|boolean} The element object or false.
|
|
15
|
+
*/
|
|
16
|
+
static getById(id: string): object | boolean;
|
|
17
|
+
/**
|
|
18
|
+
* This will select elements by name.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} name
|
|
21
|
+
* @returns {object|boolean} The elements array or false.
|
|
22
|
+
*/
|
|
23
|
+
static getByName(name: string): object | boolean;
|
|
24
|
+
/**
|
|
25
|
+
* This will select by css selector.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} selector
|
|
28
|
+
* @param {boolean} single Set to true if you only want one result.
|
|
29
|
+
* @returns {*}
|
|
30
|
+
*/
|
|
31
|
+
static getBySelector(selector: string, single: boolean): any;
|
|
32
|
+
/**
|
|
33
|
+
* This will get or set the innerHTML or an element.
|
|
34
|
+
*
|
|
35
|
+
* @param {object} obj
|
|
36
|
+
* @param {string} [html] If the html is not set, the html of the
|
|
37
|
+
* element will be returned.
|
|
38
|
+
*
|
|
39
|
+
* @returns {*}
|
|
40
|
+
*/
|
|
41
|
+
static html(obj: object, html?: string): any;
|
|
42
|
+
/**
|
|
43
|
+
* This will set the css property of an element.
|
|
44
|
+
*
|
|
45
|
+
* @param {object} obj
|
|
46
|
+
* @param {string} property
|
|
47
|
+
* @param {string} value
|
|
48
|
+
* @returns {object} an instance of base.
|
|
49
|
+
*/
|
|
50
|
+
static setCss(obj: object, property: string, value: string): object;
|
|
51
|
+
/**
|
|
52
|
+
* This will get the css property of an element.
|
|
53
|
+
*
|
|
54
|
+
* @param {object} obj
|
|
55
|
+
* @param {string} property
|
|
56
|
+
* @returns {*}
|
|
57
|
+
*/
|
|
58
|
+
static getCss(obj: object, property: string): any;
|
|
59
|
+
/**
|
|
60
|
+
* This will get or set the css propety or an element.
|
|
61
|
+
*
|
|
62
|
+
* @param {object} obj
|
|
63
|
+
* @param {string} property
|
|
64
|
+
* @param {string} [value]
|
|
65
|
+
* @returns {*}
|
|
66
|
+
*/
|
|
67
|
+
static css(obj: object, property: string, value?: string): any;
|
|
68
|
+
/**
|
|
69
|
+
* This will remove an attribute from an element.
|
|
70
|
+
*
|
|
71
|
+
* @param {object} obj
|
|
72
|
+
* @param {string} property
|
|
73
|
+
* @returns {object} an instance of base.
|
|
74
|
+
*/
|
|
75
|
+
static removeAttr(obj: object, property: string): object;
|
|
76
|
+
/**
|
|
77
|
+
* This will set an attribute of an element.
|
|
78
|
+
*
|
|
79
|
+
* @param {object} obj
|
|
80
|
+
* @param {string} property
|
|
81
|
+
* @param {string} value
|
|
82
|
+
* @returns {void}
|
|
83
|
+
*/
|
|
84
|
+
static setAttr(obj: object, property: string, value: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* This will get an attribute of an element.
|
|
87
|
+
*
|
|
88
|
+
* @param {object} obj
|
|
89
|
+
* @param {string} property
|
|
90
|
+
* @returns {string}
|
|
91
|
+
*/
|
|
92
|
+
static getAttr(obj: object, property: string): string;
|
|
93
|
+
/**
|
|
94
|
+
* This will get or set an attribute from an element.
|
|
95
|
+
*
|
|
96
|
+
* @param {object} obj
|
|
97
|
+
* @param {string} property
|
|
98
|
+
* @param {string} [value]
|
|
99
|
+
* @returns {*}
|
|
100
|
+
*/
|
|
101
|
+
static attr(obj: object, property: string, value?: string): any;
|
|
102
|
+
/**
|
|
103
|
+
* This will prefix a string with "data-" if not set.
|
|
104
|
+
*
|
|
105
|
+
* @protected
|
|
106
|
+
* @param {string} prop
|
|
107
|
+
* @returns {string}
|
|
108
|
+
*/
|
|
109
|
+
protected static _checkDataPrefix(prop: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* This will remove "data-" from a string.
|
|
112
|
+
*
|
|
113
|
+
* @protected
|
|
114
|
+
* @param {string} prop
|
|
115
|
+
* @returns {string}
|
|
116
|
+
*/
|
|
117
|
+
protected static removeDataPrefix(prop: string): string;
|
|
118
|
+
/**
|
|
119
|
+
* This will set data to an element.
|
|
120
|
+
*
|
|
121
|
+
* @param {object} obj
|
|
122
|
+
* @param {string} property
|
|
123
|
+
* @param {string} value
|
|
124
|
+
*/
|
|
125
|
+
static setData(obj: object, property: string, value: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* This will get data from an element.
|
|
128
|
+
*
|
|
129
|
+
* @param {object} obj
|
|
130
|
+
* @param {string} property
|
|
131
|
+
* @returns {string}
|
|
132
|
+
*/
|
|
133
|
+
static getData(obj: object, property: string): string;
|
|
134
|
+
/**
|
|
135
|
+
* This will get or set data to an element.
|
|
136
|
+
*
|
|
137
|
+
* @param {object} obj
|
|
138
|
+
* @param {string} property
|
|
139
|
+
* @param {string} [value]
|
|
140
|
+
* @returns {*}
|
|
141
|
+
*/
|
|
142
|
+
static data(obj: object, property: string, value?: string): any;
|
|
143
|
+
/**
|
|
144
|
+
* This will find elements in an element.
|
|
145
|
+
*
|
|
146
|
+
* @param {object} obj
|
|
147
|
+
* @param {string} queryString
|
|
148
|
+
* @returns {array}
|
|
149
|
+
*/
|
|
150
|
+
static find(obj: object, queryString: string): any[];
|
|
151
|
+
/**
|
|
152
|
+
* This will display an element.
|
|
153
|
+
*
|
|
154
|
+
* @param {object} obj
|
|
155
|
+
* @returns {object} An instance of base.
|
|
156
|
+
*/
|
|
157
|
+
static show(obj: object): object;
|
|
158
|
+
/**
|
|
159
|
+
* This will hide an element.
|
|
160
|
+
*
|
|
161
|
+
* @param {object} obj
|
|
162
|
+
* @returns {object} An instance of base.
|
|
163
|
+
*/
|
|
164
|
+
static hide(obj: object): object;
|
|
165
|
+
/**
|
|
166
|
+
* This will toggle the display an element.
|
|
167
|
+
*
|
|
168
|
+
* @param {object} obj
|
|
169
|
+
* @returns {object} An instance of base.
|
|
170
|
+
*/
|
|
171
|
+
static toggle(obj: object): object;
|
|
172
|
+
/**
|
|
173
|
+
* This will get the size of an element.
|
|
174
|
+
*
|
|
175
|
+
* @param {object} obj
|
|
176
|
+
* @returns {object|boolean} A size object or false.
|
|
177
|
+
*/
|
|
178
|
+
static getSize(obj: object): object | boolean;
|
|
179
|
+
/**
|
|
180
|
+
* This will get the width of an element.
|
|
181
|
+
*
|
|
182
|
+
* @param {object} obj
|
|
183
|
+
* @returns {number|boolean} A width or false.
|
|
184
|
+
*/
|
|
185
|
+
static getWidth(obj: object): number | boolean;
|
|
186
|
+
/**
|
|
187
|
+
* This will get the height of an element.
|
|
188
|
+
*
|
|
189
|
+
* @param {object} obj
|
|
190
|
+
* @returns {number|boolean} A height or false.
|
|
191
|
+
*/
|
|
192
|
+
static getHeight(obj: object): number | boolean;
|
|
193
|
+
/**
|
|
194
|
+
* This will get the scroll position.
|
|
195
|
+
*
|
|
196
|
+
* @param {object} [obj] The element or document element if not set.
|
|
197
|
+
* @returns {object}
|
|
198
|
+
*/
|
|
199
|
+
static getScrollPosition(obj?: object): object;
|
|
200
|
+
/**
|
|
201
|
+
* This will get the scroll top position.
|
|
202
|
+
*
|
|
203
|
+
* @param {object} [obj] The element or document element if not set.
|
|
204
|
+
* @returns {object}
|
|
205
|
+
*/
|
|
206
|
+
static getScrollTop(obj?: object): object;
|
|
207
|
+
/**
|
|
208
|
+
* This will get the scroll left position.
|
|
209
|
+
*
|
|
210
|
+
* @param {object} [obj] The element or document element if not set.
|
|
211
|
+
* @returns {object}
|
|
212
|
+
*/
|
|
213
|
+
static getScrollLeft(obj?: object): object;
|
|
214
|
+
/**
|
|
215
|
+
* This will get the window size.
|
|
216
|
+
*
|
|
217
|
+
* @returns {object}
|
|
218
|
+
*/
|
|
219
|
+
static getWindowSize(): object;
|
|
220
|
+
/**
|
|
221
|
+
* This will get the document size.
|
|
222
|
+
*
|
|
223
|
+
* @returns {object}
|
|
224
|
+
*/
|
|
225
|
+
static getDocumentSize(): object;
|
|
226
|
+
/**
|
|
227
|
+
* This will get the document height.
|
|
228
|
+
*
|
|
229
|
+
* @returns {object}
|
|
230
|
+
*/
|
|
231
|
+
static getDocumentHeight(): object;
|
|
232
|
+
/**
|
|
233
|
+
* This will get the position of an element.
|
|
234
|
+
*
|
|
235
|
+
* @param {object} obj
|
|
236
|
+
* @param {number} [depth] The number of levels, default is 1, 0 is to the root.
|
|
237
|
+
* @returns {object}
|
|
238
|
+
*/
|
|
239
|
+
static position(obj: object, depth?: number): object;
|
|
240
|
+
/**
|
|
241
|
+
* This will add a class to an element.
|
|
242
|
+
*
|
|
243
|
+
* @param {object} obj
|
|
244
|
+
* @param {string} tmpClassName
|
|
245
|
+
* @returns {object}
|
|
246
|
+
*/
|
|
247
|
+
static addClass(obj: object, tmpClassName: string): object;
|
|
248
|
+
/**
|
|
249
|
+
* This will remove a class or classes from an element.
|
|
250
|
+
*
|
|
251
|
+
* @param {object} obj
|
|
252
|
+
* @param {string} [tmpClassName]
|
|
253
|
+
* @returns {object}
|
|
254
|
+
*/
|
|
255
|
+
static removeClass(obj: object, tmpClassName?: string): object;
|
|
256
|
+
/**
|
|
257
|
+
* This will check if an element has a class.
|
|
258
|
+
*
|
|
259
|
+
* @param {object} obj
|
|
260
|
+
* @param {string} tmpClassName
|
|
261
|
+
* @returns {boolean}
|
|
262
|
+
*/
|
|
263
|
+
static hasClass(obj: object, tmpClassName: string): boolean;
|
|
264
|
+
/**
|
|
265
|
+
* This will toggle a class on an element.
|
|
266
|
+
*
|
|
267
|
+
* @param {object} obj
|
|
268
|
+
* @param {string} tmpClassName
|
|
269
|
+
* @returns {object}
|
|
270
|
+
*/
|
|
271
|
+
static toggleClass(obj: object, tmpClassName: string): object;
|
|
272
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encode
|
|
3
|
+
*
|
|
4
|
+
* This will contain methods for working with encoding.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
* @name Encode
|
|
8
|
+
*/
|
|
9
|
+
export class Encode {
|
|
10
|
+
/**
|
|
11
|
+
* This will prepare a json object to be used in an
|
|
12
|
+
* xhr request. This will sanitize the object values
|
|
13
|
+
* by encoding them to not break the param string.
|
|
14
|
+
*
|
|
15
|
+
* @param {object} obj
|
|
16
|
+
* @param {boolean} [removeNewLines]
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
static prepareJsonUrl(obj: object, removeNewLines?: boolean): string;
|
|
20
|
+
/**
|
|
21
|
+
* This will encode and decode json data.
|
|
22
|
+
*
|
|
23
|
+
* @member {object} json
|
|
24
|
+
*/
|
|
25
|
+
static json: {
|
|
26
|
+
encode: typeof encode;
|
|
27
|
+
decode: typeof decode;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* This will parse xml data.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} data
|
|
33
|
+
* @returns {object}
|
|
34
|
+
*/
|
|
35
|
+
static xmlParse(data: string): object;
|
|
36
|
+
}
|
|
37
|
+
import { encode } from "./json.js";
|
|
38
|
+
import { decode } from "./json.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This will parse JSON data.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} data
|
|
5
|
+
* @returns {*}
|
|
6
|
+
*/
|
|
7
|
+
export function decode(data: string): any;
|
|
8
|
+
/**
|
|
9
|
+
* This will encode JSON data.
|
|
10
|
+
*
|
|
11
|
+
* @param {*} data
|
|
12
|
+
* @returns {?string}
|
|
13
|
+
*/
|
|
14
|
+
export function encode(data: any): string | null;
|
|
15
|
+
export function prepareUrl(data: any, removeNewLines?: boolean): string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export namespace Objects {
|
|
2
|
+
/**
|
|
3
|
+
* This will create a new object.
|
|
4
|
+
*
|
|
5
|
+
* @param {object} [object] An object to extend.
|
|
6
|
+
* @returns {object}
|
|
7
|
+
*/
|
|
8
|
+
function create(object?: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* This will extend an object to another object.
|
|
11
|
+
*
|
|
12
|
+
* @param {(function|object)} sourceObj
|
|
13
|
+
* @param {(function|object)} targetObj
|
|
14
|
+
* @returns {object}
|
|
15
|
+
*/
|
|
16
|
+
function extendObject(sourceObj: any, targetObj: any): any;
|
|
17
|
+
/**
|
|
18
|
+
* This will clone an object.
|
|
19
|
+
*
|
|
20
|
+
* @param {object} obj
|
|
21
|
+
* @returns {object}
|
|
22
|
+
*/
|
|
23
|
+
function clone(obj: any): any;
|
|
24
|
+
/**
|
|
25
|
+
* This will get the class prototype.
|
|
26
|
+
*
|
|
27
|
+
* @protected
|
|
28
|
+
* @param {function|object} object
|
|
29
|
+
* @returns {object}
|
|
30
|
+
*/
|
|
31
|
+
function getClassObject(object: any): any;
|
|
32
|
+
/**
|
|
33
|
+
* This will extend an object to another object.
|
|
34
|
+
*
|
|
35
|
+
* @param {function|object} sourceClass
|
|
36
|
+
* @param {function|object} targetClass
|
|
37
|
+
* @returns {object}
|
|
38
|
+
*/
|
|
39
|
+
function extendClass(sourceClass: any, targetClass: any): any;
|
|
40
|
+
/**
|
|
41
|
+
* This will check if an object has a property.
|
|
42
|
+
*
|
|
43
|
+
* @param {object} obj
|
|
44
|
+
* @param {string} prop
|
|
45
|
+
* @returns {boolean}
|
|
46
|
+
*/
|
|
47
|
+
function hasOwnProp(obj: any, prop: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* This will check if an object is a plain object.
|
|
50
|
+
*
|
|
51
|
+
* @param {object} obj
|
|
52
|
+
* @returns {boolean}
|
|
53
|
+
*/
|
|
54
|
+
function isPlainObject(obj: any): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* This will check if an object is empty.
|
|
57
|
+
*
|
|
58
|
+
* @param {object} obj
|
|
59
|
+
* @returns {boolean}
|
|
60
|
+
*/
|
|
61
|
+
function isEmpty(obj: any): boolean;
|
|
62
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strings
|
|
3
|
+
*
|
|
4
|
+
* This will contain methods for working with strings.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
* @name Strings
|
|
8
|
+
*/
|
|
9
|
+
export class Strings {
|
|
10
|
+
/**
|
|
11
|
+
* This will parse a query string.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} [str] The string to parse or the global
|
|
14
|
+
* location will be parsed.
|
|
15
|
+
* @param {boolean} [decode]
|
|
16
|
+
* @returns {object}
|
|
17
|
+
*/
|
|
18
|
+
static parseQueryString(str?: string, decode?: boolean): object;
|
|
19
|
+
/**
|
|
20
|
+
* This will camelCase a string.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} str
|
|
23
|
+
* @returns {string} The string or false.
|
|
24
|
+
*/
|
|
25
|
+
static camelCase(str: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* This will uncamel-case a string.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} str
|
|
30
|
+
* @param {string} delimiter
|
|
31
|
+
* @returns {string} The string.
|
|
32
|
+
*/
|
|
33
|
+
static uncamelCase(str: string, delimiter?: string): string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types
|
|
3
|
+
*
|
|
4
|
+
* This will contain methods for working with types.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
* @name Types
|
|
8
|
+
*/
|
|
9
|
+
export class Types {
|
|
10
|
+
/**
|
|
11
|
+
* This will get the type of a variable.
|
|
12
|
+
*
|
|
13
|
+
* @param {*} data
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
static getType(data: any): string;
|
|
17
|
+
/**
|
|
18
|
+
* This will check if a request is undefined.
|
|
19
|
+
*
|
|
20
|
+
* @param {*} data
|
|
21
|
+
* @returns {boolean}
|
|
22
|
+
*/
|
|
23
|
+
static isUndefined(data: any): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* This will check if the request is an object.
|
|
26
|
+
*
|
|
27
|
+
* @param {object} obj
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
static isObject(obj: object): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* This will check if the request is an object.
|
|
33
|
+
*
|
|
34
|
+
* @param {object} obj
|
|
35
|
+
* @returns {boolean}
|
|
36
|
+
*/
|
|
37
|
+
static isFunction(obj: object): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* This will check if the request is an object.
|
|
40
|
+
*
|
|
41
|
+
* @param {object} obj
|
|
42
|
+
* @returns {boolean}
|
|
43
|
+
*/
|
|
44
|
+
static isString(obj: object): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* This will check if the data is an array.
|
|
47
|
+
*
|
|
48
|
+
* @param {*} data
|
|
49
|
+
* @returns {boolean}
|
|
50
|
+
*/
|
|
51
|
+
static isArray(data: any): boolean;
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@base-framework/base",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.80",
|
|
4
4
|
"description": "This is a javascript framework.",
|
|
5
5
|
"main": "/dist/base.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "node ./esbuild.js",
|
|
7
|
+
"build": "node ./esbuild.js && tsc",
|
|
8
8
|
"prepublishOnly": "node ./esbuild.js"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [
|
|
@@ -23,8 +23,10 @@
|
|
|
23
23
|
"url": "https://github.com/chrisdurfee/base/issues"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"esbuild": "^0.15.7"
|
|
26
|
+
"esbuild": "^0.15.7",
|
|
27
|
+
"typescript": "^5.4.2"
|
|
27
28
|
},
|
|
29
|
+
"types": "dist/tyeps/base.d.ts",
|
|
28
30
|
"files": [
|
|
29
31
|
"pacakge.json",
|
|
30
32
|
"readme.md",
|