custom-elements-ts 0.0.16 → 0.1.0

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.
Files changed (69) hide show
  1. package/.eslintrc.json +46 -0
  2. package/.github/workflows/ci.yml +49 -0
  3. package/.prettierrc +7 -0
  4. package/LICENSE +20 -0
  5. package/README.md +426 -168
  6. package/demos/counter/counter.element.html +1 -0
  7. package/demos/counter/counter.element.scss +234 -0
  8. package/demos/counter/counter.element.ts +68 -0
  9. package/demos/counter/index.html +205 -0
  10. package/demos/counter/index.ts +1 -0
  11. package/demos/site/code-example/code-example.element.scss +168 -0
  12. package/demos/site/code-example/code-example.element.ts +88 -0
  13. package/demos/site/event-log/event-log.element.scss +179 -0
  14. package/demos/site/event-log/event-log.element.ts +134 -0
  15. package/demos/site/favicon.svg +14 -0
  16. package/demos/site/index.html +346 -0
  17. package/demos/site/index.ts +13 -0
  18. package/demos/site/message/message.element.scss +75 -0
  19. package/demos/site/message/message.element.ts +76 -0
  20. package/demos/site/og-image.png +0 -0
  21. package/demos/site/styles/site.css +1023 -0
  22. package/demos/site/styles/tokens.css +56 -0
  23. package/demos/site/toast/toast.element.scss +110 -0
  24. package/demos/site/toast/toast.element.ts +63 -0
  25. package/demos/todo-dashboard/index.html +141 -0
  26. package/demos/todo-dashboard/index.ts +4 -0
  27. package/demos/todo-dashboard/todo-dashboard.element.scss +1145 -0
  28. package/demos/todo-dashboard/todo-dashboard.element.ts +332 -0
  29. package/demos/todo-dashboard/todo-filters.element.ts +54 -0
  30. package/demos/todo-dashboard/todo-item.element.ts +126 -0
  31. package/demos/todo-dashboard/todo-stats.element.ts +189 -0
  32. package/package.json +73 -29
  33. package/src/custom-element.ts +206 -0
  34. package/{index.d.ts → src/index.ts} +2 -0
  35. package/src/listen.ts +70 -0
  36. package/src/prop.ts +92 -0
  37. package/src/state.ts +129 -0
  38. package/src/template-runtime.ts +435 -0
  39. package/src/toggle.ts +66 -0
  40. package/src/tsconfig.json +24 -0
  41. package/src/util.ts +33 -0
  42. package/src/watch.ts +14 -0
  43. package/tests/basic.spec.ts +70 -0
  44. package/tests/custom-element.spec.ts +77 -0
  45. package/tests/dispatch.spec.ts +52 -0
  46. package/tests/init.spec.ts +94 -0
  47. package/tests/listen.spec.ts +118 -0
  48. package/tests/prop.spec.ts +118 -0
  49. package/tests/templating-runtime.spec.ts +575 -0
  50. package/tests/toggle.spec.ts +92 -0
  51. package/tests/watch.spec.ts +183 -0
  52. package/tools/build.js +119 -0
  53. package/tools/bundle.js +167 -0
  54. package/tools/rollup-config.js +70 -0
  55. package/tools/start.js +188 -0
  56. package/tsconfig.json +38 -0
  57. package/vite.config.mts +30 -0
  58. package/bundles/custom-elements-ts.umd.js +0 -315
  59. package/bundles/custom-elements-ts.umd.js.map +0 -1
  60. package/custom-element.d.ts +0 -12
  61. package/esm2015/custom-elements-ts.js +0 -260
  62. package/esm2015/custom-elements-ts.js.map +0 -1
  63. package/esm5/custom-elements-ts.js +0 -298
  64. package/esm5/custom-elements-ts.js.map +0 -1
  65. package/listen.d.ts +0 -17
  66. package/prop.d.ts +0 -2
  67. package/toggle.d.ts +0 -1
  68. package/util.d.ts +0 -4
  69. package/watch.d.ts +0 -1
@@ -1,260 +0,0 @@
1
- const toKebabCase = str => {
2
- return str
3
- .replace(/([a-z])([A-Z])/g, '$1-$2')
4
- .replace(/[\s_]+/g, '-')
5
- .toLowerCase();
6
- };
7
- const toCamelCase = str => {
8
- return str
9
- .toLowerCase()
10
- .replace(/(\-\w)/g, (m) => m[1].toUpperCase());
11
- };
12
- const toDotCase = (str) => {
13
- return str.replace(/(?!^)([A-Z])/g, ' $1')
14
- .replace(/[_\s]+(?=[a-zA-Z])/g, '.')
15
- .toLowerCase();
16
- };
17
- const tryParseInt = (value) => {
18
- return (parseInt(value) == value && parseFloat(value) !== NaN) ? parseInt(value) : value;
19
- };
20
-
21
- const Listen = (eventName, selector) => {
22
- return (target, methodName) => {
23
- if (!target.constructor.listeners) {
24
- target.constructor.listeners = [];
25
- }
26
- target.constructor.listeners.push({ selector: selector, eventName: eventName, handler: target[methodName] });
27
- };
28
- };
29
- const addEventListeners = (target) => {
30
- if (target.constructor.listeners) {
31
- const targetRoot = target.shadowRoot || target;
32
- for (const listener of target.constructor.listeners) {
33
- const eventTarget = (listener.selector)
34
- ? targetRoot.querySelector(listener.selector)
35
- ? targetRoot.querySelector(listener.selector) : null
36
- : target;
37
- if (eventTarget) {
38
- eventTarget.addEventListener(listener.eventName, (e) => {
39
- listener.handler.call(target, e);
40
- });
41
- }
42
- }
43
- }
44
- };
45
- const Dispatch = (eventName) => {
46
- return (target, propertyName) => {
47
- function get() {
48
- const self = this;
49
- return {
50
- emit(options) {
51
- const evtName = (eventName) ? eventName : toDotCase(propertyName);
52
- self.dispatchEvent(new CustomEvent(evtName, options));
53
- }
54
- };
55
- }
56
- Object.defineProperty(target, propertyName, { get });
57
- };
58
- };
59
-
60
- const Prop = () => {
61
- return (target, propName) => {
62
- const attrName = toKebabCase(propName);
63
- function get() {
64
- if (this.props[propName]) {
65
- return this.props[propName];
66
- }
67
- return this.getAttribute(attrName);
68
- }
69
- function set(value) {
70
- if (this.__connected) {
71
- const oldValue = this.props[propName];
72
- this.props[propName] = tryParseInt(value);
73
- if (typeof value != 'object') {
74
- this.setAttribute(attrName, value);
75
- }
76
- else {
77
- this.onAttributeChange(attrName, oldValue, value, false);
78
- }
79
- }
80
- else {
81
- if (!this.hasAttribute(toKebabCase(propName))) {
82
- this.constructor.propsInit[propName] = value;
83
- }
84
- }
85
- }
86
- if (!target.constructor.propsInit) {
87
- target.constructor.propsInit = {};
88
- }
89
- target.constructor.propsInit[propName] = null;
90
- Object.defineProperty(target, propName, { get, set });
91
- };
92
- };
93
- const getProps = (target) => {
94
- const watchAttributes = target.constructor.watchAttributes;
95
- const plainAttributes = Object.assign({}, watchAttributes);
96
- Object.keys(plainAttributes).forEach(v => plainAttributes[v] = '');
97
- const cycleProps = Object.assign({}, plainAttributes, target.constructor.propsInit);
98
- return Object.keys(cycleProps);
99
- };
100
- const initializeProps = (target) => {
101
- const watchAttributes = target.constructor.watchAttributes;
102
- for (let prop of getProps(target)) {
103
- if (watchAttributes) {
104
- if (watchAttributes[toKebabCase(prop)] == null) {
105
- watchAttributes[toKebabCase(prop)] = '';
106
- }
107
- else {
108
- const attribValue = target.props[prop] || target.getAttribute(toKebabCase(prop));
109
- if (typeof target[watchAttributes[prop]] == 'function') {
110
- target[watchAttributes[prop]]({ new: attribValue });
111
- }
112
- }
113
- }
114
- if (target.constructor.propsInit[prop]) {
115
- if (!target.hasAttribute(toKebabCase(prop))) {
116
- target[prop] = target.constructor.propsInit[prop];
117
- }
118
- }
119
- }
120
- };
121
-
122
- const CustomElement = (args) => {
123
- return (target) => {
124
- var _a;
125
- const tag = args.tag || toKebabCase(target.prototype.constructor.name);
126
- const customElement = (_a = class extends target {
127
- constructor() {
128
- super();
129
- this.props = {};
130
- this.showShadowRoot = args.shadow == null ? true : args.shadow;
131
- if (!this.shadowRoot && this.showShadowRoot) {
132
- this.attachShadow({ mode: 'open' });
133
- }
134
- }
135
- static get observedAttributes() {
136
- return Object.keys(this.propsInit || {}).map(x => toKebabCase(x));
137
- }
138
- attributeChangedCallback(name, oldValue, newValue) {
139
- this.onAttributeChange(name, oldValue, newValue);
140
- }
141
- onAttributeChange(name, oldValue, newValue, set = true) {
142
- if (oldValue != newValue) {
143
- if (set) {
144
- this[toCamelCase(name)] = newValue;
145
- }
146
- const watchAttributes = this.constructor.watchAttributes;
147
- if (watchAttributes && watchAttributes[name]) {
148
- const methodToCall = watchAttributes[name];
149
- if (this.__connected) {
150
- if (typeof this[methodToCall] == 'function') {
151
- this[methodToCall]({ old: oldValue, new: newValue });
152
- }
153
- }
154
- }
155
- }
156
- }
157
- connectedCallback() {
158
- this.__render();
159
- super.connectedCallback && super.connectedCallback();
160
- this.__connected = true;
161
- addEventListeners(this);
162
- initializeProps(this);
163
- }
164
- __render() {
165
- if (this.__connected)
166
- return;
167
- const template = document.createElement('template');
168
- const style = `${args.style ? `<style>${args.style}</style>` : ''}`;
169
- template.innerHTML = `${style}${args.template ? args.template : ''}`;
170
- (this.showShadowRoot ? this.shadowRoot : this).appendChild(document.importNode(template.content, true));
171
- }
172
- },
173
- _a.__connected = false,
174
- _a);
175
- if (!customElements.get(tag)) {
176
- customElements.define(tag, customElement);
177
- }
178
- return customElement;
179
- };
180
- };
181
-
182
- const Watch = (attrName) => {
183
- return (target, propertyName) => {
184
- if (!target.constructor.watchAttributes) {
185
- target.constructor.watchAttributes = {};
186
- }
187
- target.constructor.watchAttributes[toKebabCase(attrName)] = propertyName;
188
- if (!target.constructor.propsInit) {
189
- target.constructor.propsInit = {};
190
- }
191
- target.constructor.propsInit[attrName] = null;
192
- };
193
- };
194
-
195
- const Toggle = () => {
196
- return (target, propName) => {
197
- function get() {
198
- const getAttribute = (propName) => {
199
- if (this.hasAttribute(propName)) {
200
- const attrValue = this.getAttribute(propName);
201
- if (/^(true|false|^$)$/.test(attrValue)) {
202
- return attrValue == 'true' || attrValue == '';
203
- }
204
- else {
205
- return false;
206
- }
207
- }
208
- return false;
209
- };
210
- return getAttribute(propName);
211
- }
212
- function set(value) {
213
- const oldValue = value;
214
- if (value != undefined) {
215
- switch (typeof value) {
216
- case 'boolean':
217
- break;
218
- case 'string':
219
- if (/^(true|false|^$)$/.test(value)) {
220
- value = oldValue == 'true' || oldValue == '';
221
- }
222
- else {
223
- console.warn(`TypeError: Cannot set boolean toggle property '${propName}' to '${value}'`);
224
- value = false;
225
- }
226
- break;
227
- default:
228
- throw (`TypeError: Cannot set boolean toggle property '${propName}' to '${value}'`);
229
- }
230
- }
231
- if (this.__connected) {
232
- this.props[propName] = value || false;
233
- if (oldValue !== '' && oldValue !== null) {
234
- this.setAttribute(propName, value);
235
- }
236
- else {
237
- if (value) {
238
- this.setAttribute(propName, '');
239
- }
240
- else {
241
- this.removeAttribute(propName);
242
- }
243
- }
244
- }
245
- else {
246
- if (!this.hasAttribute(toKebabCase(propName))) {
247
- this.constructor.propsInit[propName] = value;
248
- }
249
- }
250
- }
251
- if (!target.constructor.propsInit) {
252
- target.constructor.propsInit = {};
253
- }
254
- target.constructor.propsInit[propName] = null;
255
- Object.defineProperty(target, propName, { get, set });
256
- };
257
- };
258
-
259
- export { CustomElement, Watch, Prop, initializeProps, Toggle, Listen, addEventListeners, Dispatch };
260
- //# sourceMappingURL=custom-elements-ts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-elements-ts.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,298 +0,0 @@
1
- var extendStatics = function(d, b) {
2
- extendStatics = Object.setPrototypeOf ||
3
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
- return extendStatics(d, b);
6
- };
7
-
8
- function __extends(d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- }
13
-
14
- var __assign = function() {
15
- __assign = Object.assign || function __assign(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
19
- }
20
- return t;
21
- };
22
- return __assign.apply(this, arguments);
23
- };
24
-
25
- var toKebabCase = function (str) {
26
- return str
27
- .replace(/([a-z])([A-Z])/g, '$1-$2')
28
- .replace(/[\s_]+/g, '-')
29
- .toLowerCase();
30
- };
31
- var toCamelCase = function (str) {
32
- return str
33
- .toLowerCase()
34
- .replace(/(\-\w)/g, function (m) { return m[1].toUpperCase(); });
35
- };
36
- var toDotCase = function (str) {
37
- return str.replace(/(?!^)([A-Z])/g, ' $1')
38
- .replace(/[_\s]+(?=[a-zA-Z])/g, '.')
39
- .toLowerCase();
40
- };
41
- var tryParseInt = function (value) {
42
- return (parseInt(value) == value && parseFloat(value) !== NaN) ? parseInt(value) : value;
43
- };
44
-
45
- var Listen = function (eventName, selector) {
46
- return function (target, methodName) {
47
- if (!target.constructor.listeners) {
48
- target.constructor.listeners = [];
49
- }
50
- target.constructor.listeners.push({ selector: selector, eventName: eventName, handler: target[methodName] });
51
- };
52
- };
53
- var addEventListeners = function (target) {
54
- if (target.constructor.listeners) {
55
- var targetRoot = target.shadowRoot || target;
56
- var _loop_1 = function (listener) {
57
- var eventTarget = (listener.selector)
58
- ? targetRoot.querySelector(listener.selector)
59
- ? targetRoot.querySelector(listener.selector) : null
60
- : target;
61
- if (eventTarget) {
62
- eventTarget.addEventListener(listener.eventName, function (e) {
63
- listener.handler.call(target, e);
64
- });
65
- }
66
- };
67
- for (var _i = 0, _a = target.constructor.listeners; _i < _a.length; _i++) {
68
- var listener = _a[_i];
69
- _loop_1(listener);
70
- }
71
- }
72
- };
73
- var Dispatch = function (eventName) {
74
- return function (target, propertyName) {
75
- function get() {
76
- var self = this;
77
- return {
78
- emit: function (options) {
79
- var evtName = (eventName) ? eventName : toDotCase(propertyName);
80
- self.dispatchEvent(new CustomEvent(evtName, options));
81
- }
82
- };
83
- }
84
- Object.defineProperty(target, propertyName, { get: get });
85
- };
86
- };
87
-
88
- var Prop = function () {
89
- return function (target, propName) {
90
- var attrName = toKebabCase(propName);
91
- function get() {
92
- if (this.props[propName]) {
93
- return this.props[propName];
94
- }
95
- return this.getAttribute(attrName);
96
- }
97
- function set(value) {
98
- if (this.__connected) {
99
- var oldValue = this.props[propName];
100
- this.props[propName] = tryParseInt(value);
101
- if (typeof value != 'object') {
102
- this.setAttribute(attrName, value);
103
- }
104
- else {
105
- this.onAttributeChange(attrName, oldValue, value, false);
106
- }
107
- }
108
- else {
109
- if (!this.hasAttribute(toKebabCase(propName))) {
110
- this.constructor.propsInit[propName] = value;
111
- }
112
- }
113
- }
114
- if (!target.constructor.propsInit) {
115
- target.constructor.propsInit = {};
116
- }
117
- target.constructor.propsInit[propName] = null;
118
- Object.defineProperty(target, propName, { get: get, set: set });
119
- };
120
- };
121
- var getProps = function (target) {
122
- var watchAttributes = target.constructor.watchAttributes;
123
- var plainAttributes = __assign({}, watchAttributes);
124
- Object.keys(plainAttributes).forEach(function (v) { return plainAttributes[v] = ''; });
125
- var cycleProps = __assign({}, plainAttributes, target.constructor.propsInit);
126
- return Object.keys(cycleProps);
127
- };
128
- var initializeProps = function (target) {
129
- var watchAttributes = target.constructor.watchAttributes;
130
- for (var _i = 0, _a = getProps(target); _i < _a.length; _i++) {
131
- var prop = _a[_i];
132
- if (watchAttributes) {
133
- if (watchAttributes[toKebabCase(prop)] == null) {
134
- watchAttributes[toKebabCase(prop)] = '';
135
- }
136
- else {
137
- var attribValue = target.props[prop] || target.getAttribute(toKebabCase(prop));
138
- if (typeof target[watchAttributes[prop]] == 'function') {
139
- target[watchAttributes[prop]]({ new: attribValue });
140
- }
141
- }
142
- }
143
- if (target.constructor.propsInit[prop]) {
144
- if (!target.hasAttribute(toKebabCase(prop))) {
145
- target[prop] = target.constructor.propsInit[prop];
146
- }
147
- }
148
- }
149
- };
150
-
151
- var CustomElement = function (args) {
152
- return function (target) {
153
- var _a;
154
- var tag = args.tag || toKebabCase(target.prototype.constructor.name);
155
- var customElement = (_a = (function (_super) {
156
- __extends(class_1, _super);
157
- function class_1() {
158
- var _this = _super.call(this) || this;
159
- _this.props = {};
160
- _this.showShadowRoot = args.shadow == null ? true : args.shadow;
161
- if (!_this.shadowRoot && _this.showShadowRoot) {
162
- _this.attachShadow({ mode: 'open' });
163
- }
164
- return _this;
165
- }
166
- Object.defineProperty(class_1, "observedAttributes", {
167
- get: function () {
168
- return Object.keys(this.propsInit || {}).map(function (x) { return toKebabCase(x); });
169
- },
170
- enumerable: true,
171
- configurable: true
172
- });
173
- class_1.prototype.attributeChangedCallback = function (name, oldValue, newValue) {
174
- this.onAttributeChange(name, oldValue, newValue);
175
- };
176
- class_1.prototype.onAttributeChange = function (name, oldValue, newValue, set) {
177
- if (set === void 0) { set = true; }
178
- if (oldValue != newValue) {
179
- if (set) {
180
- this[toCamelCase(name)] = newValue;
181
- }
182
- var watchAttributes = this.constructor.watchAttributes;
183
- if (watchAttributes && watchAttributes[name]) {
184
- var methodToCall = watchAttributes[name];
185
- if (this.__connected) {
186
- if (typeof this[methodToCall] == 'function') {
187
- this[methodToCall]({ old: oldValue, new: newValue });
188
- }
189
- }
190
- }
191
- }
192
- };
193
- class_1.prototype.connectedCallback = function () {
194
- this.__render();
195
- _super.prototype.connectedCallback && _super.prototype.connectedCallback.call(this);
196
- this.__connected = true;
197
- addEventListeners(this);
198
- initializeProps(this);
199
- };
200
- class_1.prototype.__render = function () {
201
- if (this.__connected)
202
- return;
203
- var template = document.createElement('template');
204
- var style = "" + (args.style ? "<style>" + args.style + "</style>" : '');
205
- template.innerHTML = "" + style + (args.template ? args.template : '');
206
- (this.showShadowRoot ? this.shadowRoot : this).appendChild(document.importNode(template.content, true));
207
- };
208
- return class_1;
209
- }(target)),
210
- _a.__connected = false,
211
- _a);
212
- if (!customElements.get(tag)) {
213
- customElements.define(tag, customElement);
214
- }
215
- return customElement;
216
- };
217
- };
218
-
219
- var Watch = function (attrName) {
220
- return function (target, propertyName) {
221
- if (!target.constructor.watchAttributes) {
222
- target.constructor.watchAttributes = {};
223
- }
224
- target.constructor.watchAttributes[toKebabCase(attrName)] = propertyName;
225
- if (!target.constructor.propsInit) {
226
- target.constructor.propsInit = {};
227
- }
228
- target.constructor.propsInit[attrName] = null;
229
- };
230
- };
231
-
232
- var Toggle = function () {
233
- return function (target, propName) {
234
- function get() {
235
- var _this = this;
236
- var getAttribute = function (propName) {
237
- if (_this.hasAttribute(propName)) {
238
- var attrValue = _this.getAttribute(propName);
239
- if (/^(true|false|^$)$/.test(attrValue)) {
240
- return attrValue == 'true' || attrValue == '';
241
- }
242
- else {
243
- return false;
244
- }
245
- }
246
- return false;
247
- };
248
- return getAttribute(propName);
249
- }
250
- function set(value) {
251
- var oldValue = value;
252
- if (value != undefined) {
253
- switch (typeof value) {
254
- case 'boolean':
255
- break;
256
- case 'string':
257
- if (/^(true|false|^$)$/.test(value)) {
258
- value = oldValue == 'true' || oldValue == '';
259
- }
260
- else {
261
- console.warn("TypeError: Cannot set boolean toggle property '" + propName + "' to '" + value + "'");
262
- value = false;
263
- }
264
- break;
265
- default:
266
- throw ("TypeError: Cannot set boolean toggle property '" + propName + "' to '" + value + "'");
267
- }
268
- }
269
- if (this.__connected) {
270
- this.props[propName] = value || false;
271
- if (oldValue !== '' && oldValue !== null) {
272
- this.setAttribute(propName, value);
273
- }
274
- else {
275
- if (value) {
276
- this.setAttribute(propName, '');
277
- }
278
- else {
279
- this.removeAttribute(propName);
280
- }
281
- }
282
- }
283
- else {
284
- if (!this.hasAttribute(toKebabCase(propName))) {
285
- this.constructor.propsInit[propName] = value;
286
- }
287
- }
288
- }
289
- if (!target.constructor.propsInit) {
290
- target.constructor.propsInit = {};
291
- }
292
- target.constructor.propsInit[propName] = null;
293
- Object.defineProperty(target, propName, { get: get, set: set });
294
- };
295
- };
296
-
297
- export { CustomElement, Watch, Prop, initializeProps, Toggle, Listen, addEventListeners, Dispatch };
298
- //# sourceMappingURL=custom-elements-ts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-elements-ts.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/listen.d.ts DELETED
@@ -1,17 +0,0 @@
1
- interface ListenerMetadata {
2
- eventName: string;
3
- handler: Function;
4
- selector?: string;
5
- }
6
- interface CustomEventOptions {
7
- bubbles?: boolean;
8
- composed?: boolean;
9
- detail?: any;
10
- }
11
- interface DispatchEmitter {
12
- emit(options?: CustomEventOptions): void;
13
- }
14
- declare const Listen: (eventName: string, selector?: string) => (target: any, methodName: string) => void;
15
- declare const addEventListeners: (target: any) => void;
16
- declare const Dispatch: (eventName?: string) => (target: HTMLElement, propertyName: string) => void;
17
- export { Listen, addEventListeners, DispatchEmitter, Dispatch, CustomEventOptions, ListenerMetadata };
package/prop.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const Prop: () => any;
2
- export declare const initializeProps: (target: any) => void;
package/toggle.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const Toggle: () => any;
package/util.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare const toKebabCase: (str: any) => any;
2
- export declare const toCamelCase: (str: any) => any;
3
- export declare const toDotCase: (str: string) => string;
4
- export declare const tryParseInt: (value: any) => any;
package/watch.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const Watch: (attrName: string) => (target: any, propertyName: string) => void;