@trunkjs/browser-utils 1.0.22 → 1.0.24

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.0.24 (2025-12-23)
2
+
3
+ This was a version bump only for browser-utils to align it with other projects, there were no code changes.
4
+
5
+ ## 1.0.23 (2025-12-23)
6
+
7
+ This was a version bump only for browser-utils to align it with other projects, there were no code changes.
8
+
1
9
  ## 1.0.22 (2025-12-11)
2
10
 
3
11
  This was a version bump only for browser-utils to align it with other projects, there were no code changes.
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
- var x = Object.defineProperty;
2
- var L = (e) => {
3
- throw TypeError(e);
1
+ var A = Object.defineProperty;
2
+ var p = (t) => {
3
+ throw TypeError(t);
4
4
  };
5
- var A = (e, t, n) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var u = (e, t, n) => A(e, typeof t != "symbol" ? t + "" : t, n), w = (e, t, n) => t.has(e) || L("Cannot " + n);
7
- var a = (e, t, n) => (w(e, t, "read from private field"), n ? n.call(e) : t.get(e)), c = (e, t, n) => t.has(e) ? L("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), m = (e, t, n, i) => (w(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), p = (e, t, n) => (w(e, t, "access private method"), n);
5
+ var C = (t, e, n) => e in t ? A(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
+ var d = (t, e, n) => C(t, typeof e != "symbol" ? e + "" : e, n), w = (t, e, n) => e.has(t) || p("Cannot " + n);
7
+ var a = (t, e, n) => (w(t, e, "read from private field"), n ? n.call(t) : e.get(t)), m = (t, e, n) => e.has(t) ? p("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), c = (t, e, n, i) => (w(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n), L = (t, e, n) => (w(t, e, "access private method"), n);
8
8
  const f = [
9
9
  { name: "xs", minWidth: 0 },
10
10
  { name: "sm", minWidth: 576 },
@@ -12,108 +12,128 @@ const f = [
12
12
  { name: "lg", minWidth: 992 },
13
13
  { name: "xl", minWidth: 1200 },
14
14
  { name: "xxl", minWidth: 1400 }
15
- ], v = f.reduce(
16
- (e, t) => (e[t.name] = t.minWidth, e),
15
+ ], y = f.reduce(
16
+ (t, e) => (t[e.name] = e.minWidth, t),
17
17
  {}
18
18
  );
19
- function y(e) {
20
- if (!(e in v))
21
- throw new Error(`Unknown breakpoint: ${e}`);
22
- return v[e];
19
+ function v(t) {
20
+ if (!(t in y))
21
+ throw new Error(`Unknown breakpoint: ${t}`);
22
+ return y[t];
23
23
  }
24
- function C(e) {
25
- e === void 0 && (e = window.innerWidth);
26
- for (let t = f.length - 1; t >= 0; t--)
27
- if (e >= f[t].minWidth)
28
- return f[t].name;
24
+ function D(t) {
25
+ t === void 0 && (t = window.innerWidth);
26
+ for (let e = f.length - 1; e >= 0; e--)
27
+ if (t >= f[e].minWidth)
28
+ return f[e].name;
29
29
  return "xs";
30
30
  }
31
- function S(e, t = {}, n = []) {
31
+ function S(t, e = {}, n = []) {
32
32
  Array.isArray(n) || (n = [n]);
33
- const i = document.createElement(e);
34
- for (const r in t)
35
- t[r] !== null && t[r] !== void 0 && i.setAttribute(r, t[r] !== !0 ? t[r] : "");
33
+ const i = document.createElement(t);
34
+ for (const r in e)
35
+ e[r] !== null && e[r] !== void 0 && i.setAttribute(r, e[r] !== !0 ? e[r] : "");
36
36
  for (const r of n)
37
37
  i.append(typeof r == "string" ? document.createTextNode(r) : r);
38
38
  return i;
39
39
  }
40
- class $ {
40
+ class T {
41
41
  /**
42
42
  *
43
43
  * @param delay Debounce delay in milliseconds
44
44
  * @param max_delay Maximum delay in milliseconds, if false then no maximum delay is applied
45
45
  */
46
- constructor(t, n = !1) {
47
- u(this, "timeout", null);
48
- u(this, "startTimeWithMs", 0);
49
- this.delay = t, this.max_delay = n;
46
+ constructor(e, n = !1) {
47
+ d(this, "timeout", null);
48
+ d(this, "startTimeWithMs", 0);
49
+ d(this, "maxTimeout", null);
50
+ this.delay = e, this.max_delay = n;
50
51
  }
51
52
  async wait() {
52
- return this.startTimeWithMs === 0 && (this.startTimeWithMs = Date.now()), this.timeout && (this.max_delay === !1 || this.startTimeWithMs + this.max_delay > Date.now()) && clearTimeout(this.timeout), new Promise((t) => {
53
+ return this.startTimeWithMs === 0 && (this.startTimeWithMs = Date.now()), this.timeout && (this.max_delay === !1 || this.startTimeWithMs + this.max_delay > Date.now()) && clearTimeout(this.timeout), new Promise((e) => {
53
54
  this.timeout = setTimeout(() => {
54
- this.startTimeWithMs = 0, t(!0);
55
+ this.startTimeWithMs = 0, e(!0);
55
56
  }, this.delay);
56
57
  });
57
58
  }
58
- debounce(t) {
59
- this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(() => {
60
- t();
61
- }, this.delay);
59
+ debounce(e) {
60
+ const n = Date.now();
61
+ this.startTimeWithMs === 0 && (this.startTimeWithMs = n);
62
+ const i = () => {
63
+ this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.maxTimeout && (clearTimeout(this.maxTimeout), this.maxTimeout = null), this.startTimeWithMs = 0, e();
64
+ };
65
+ if (this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(i, this.delay), this.max_delay !== !1 && !this.maxTimeout) {
66
+ const r = n - this.startTimeWithMs, o = Math.max(0, this.max_delay - r);
67
+ this.maxTimeout = setTimeout(i, o);
68
+ }
62
69
  }
63
70
  }
64
- function U(e) {
65
- if (typeof e.lineNumber == "number")
71
+ function U(t, e = !1) {
72
+ const n = /* @__PURE__ */ new WeakMap();
73
+ return function(i, r) {
74
+ if (r.kind !== "method") return i;
75
+ const o = r.name;
76
+ return function(...l) {
77
+ let s = n.get(this);
78
+ s || (s = /* @__PURE__ */ new Map(), n.set(this, s));
79
+ let u = s.get(o);
80
+ u || (u = new T(t, e), s.set(o, u)), u.debounce(() => i.apply(this, l));
81
+ };
82
+ };
83
+ }
84
+ function F(t) {
85
+ if (typeof t.lineNumber == "number")
66
86
  return {
67
- file: e.fileName || e.sourceURL,
68
- line: e.lineNumber,
69
- column: e.columnNumber ?? void 0
87
+ file: t.fileName || t.sourceURL,
88
+ line: t.lineNumber,
89
+ column: t.columnNumber ?? void 0
70
90
  };
71
- if (typeof e.line == "number")
91
+ if (typeof t.line == "number")
72
92
  return {
73
- file: e.sourceURL,
74
- line: e.line,
75
- column: e.column
93
+ file: t.sourceURL,
94
+ line: t.line,
95
+ column: t.column
76
96
  };
77
- const n = String(e.stack || e.message || "").split(`
97
+ const n = String(t.stack || t.message || "").split(`
78
98
  `), i = /(.*?)(?:\(|@)?(.*?):(\d+):(\d+)\)?$/;
79
99
  for (const r of n) {
80
- const s = r.match(i);
81
- if (s)
82
- return { file: s[2], line: +s[3], column: +s[4] };
100
+ const o = r.match(i);
101
+ if (o)
102
+ return { file: o[2], line: +o[3], column: +o[4] };
83
103
  }
84
- return { file: e.fileName || e.sourceURL };
104
+ return { file: t.fileName || t.sourceURL };
85
105
  }
86
- class D {
87
- constructor(t, n, i = "main") {
88
- this._debug = t, this.myElementId = n, this.instanceId = i;
106
+ class $ {
107
+ constructor(e, n, i = "main") {
108
+ this._debug = e, this.myElementId = n, this.instanceId = i;
89
109
  }
90
- log(...t) {
91
- this._debug && console.log(`[LOG][ID:${this.myElementId}:${this.instanceId}]`, ...t);
110
+ log(...e) {
111
+ this._debug && console.log(`[LOG][ID:${this.myElementId}:${this.instanceId}]`, ...e);
92
112
  }
93
- warn(...t) {
94
- console.warn(`[WARN][ID:${this.myElementId}:${this.instanceId}]`, ...t);
113
+ warn(...e) {
114
+ console.warn(`[WARN][ID:${this.myElementId}:${this.instanceId}]`, ...e);
95
115
  }
96
- error(...t) {
97
- console.error(`[ERROR][ID:${this.myElementId}:${this.instanceId}]`, ...t);
116
+ error(...e) {
117
+ console.error(`[ERROR][ID:${this.myElementId}:${this.instanceId}]`, ...e);
98
118
  }
99
- throwError(...t) {
100
- const n = `[ERROR][ID:${this.myElementId}:${this.instanceId}] ${t.join(" ")}`;
101
- throw this.error(...t), new Error(n);
119
+ throwError(...e) {
120
+ const n = `[ERROR][ID:${this.myElementId}:${this.instanceId}] ${e.join(" ")}`;
121
+ throw this.error(...e), new Error(n);
102
122
  }
103
123
  }
104
- class F {
105
- constructor(t, n = !0) {
106
- u(this, "label");
107
- u(this, "last");
108
- u(this, "startTime");
109
- u(this, "running", !1);
110
- u(this, "enabled");
111
- this.label = t, this.enabled = n, this.startTime = this.last = performance.now(), this.running = !0;
124
+ class H {
125
+ constructor(e, n = !0) {
126
+ d(this, "label");
127
+ d(this, "last");
128
+ d(this, "startTime");
129
+ d(this, "running", !1);
130
+ d(this, "enabled");
131
+ this.label = e, this.enabled = n, this.startTime = this.last = performance.now(), this.running = !0;
112
132
  }
113
- lap(t = "") {
133
+ lap(e = "") {
114
134
  if (!this.enabled) return;
115
135
  const n = performance.now(), i = (n - this.last) / 1e3;
116
- this.last = n, console.debug(`[${this.label}] ${t} +${i.toFixed(3)}s`);
136
+ this.last = n, console.debug(`[${this.label}] ${e} +${i.toFixed(3)}s`);
117
137
  }
118
138
  elapsed() {
119
139
  return performance.now() - this.startTime;
@@ -131,49 +151,49 @@ class F {
131
151
  return this.running;
132
152
  }
133
153
  }
134
- function H(e, t, n) {
154
+ function O(t, e, n) {
135
155
  return new Promise((i, r) => {
136
- const s = (l) => {
137
- e.removeEventListener(t, s, n), i(l);
156
+ const o = (l) => {
157
+ t.removeEventListener(e, o, n), i(l);
138
158
  };
139
- e.addEventListener(t, s, n);
159
+ t.addEventListener(e, o, n);
140
160
  });
141
161
  }
142
162
  function B() {
143
- return document.readyState === "loading" ? new Promise((e) => {
144
- document.addEventListener("DOMContentLoaded", () => e());
163
+ return document.readyState === "loading" ? new Promise((t) => {
164
+ document.addEventListener("DOMContentLoaded", () => t());
145
165
  }) : Promise.resolve();
146
166
  }
147
- function O(e = window) {
148
- return e || (e = window), e === window ? document.readyState === "complete" ? Promise.resolve() : new Promise((t) => window.addEventListener("load", () => t(), { once: !0 })) : e instanceof HTMLImageElement ? e.complete && e.naturalWidth !== 0 ? Promise.resolve() : new Promise((t, n) => {
149
- e.addEventListener("load", () => t(), { once: !0 }), e.addEventListener("error", () => n(new Error("image error")), { once: !0 });
150
- }) : e instanceof HTMLMediaElement ? e.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA ? Promise.resolve() : new Promise((t) => e.addEventListener("loadeddata", () => t(), { once: !0 })) : new Promise((t) => e.addEventListener("load", () => t(), { once: !0 }));
167
+ function V(t = window) {
168
+ return t || (t = window), t === window ? document.readyState === "complete" ? Promise.resolve() : new Promise((e) => window.addEventListener("load", () => e(), { once: !0 })) : t instanceof HTMLImageElement ? t.complete && t.naturalWidth !== 0 ? Promise.resolve() : new Promise((e, n) => {
169
+ t.addEventListener("load", () => e(), { once: !0 }), t.addEventListener("error", () => n(new Error("image error")), { once: !0 });
170
+ }) : t instanceof HTMLMediaElement ? t.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA ? Promise.resolve() : new Promise((e) => t.addEventListener("loadeddata", () => e(), { once: !0 })) : new Promise((e) => t.addEventListener("load", () => e(), { once: !0 }));
151
171
  }
152
- function V(e) {
153
- return new Promise((t) => setTimeout(t, e));
172
+ function z(t) {
173
+ return new Promise((e) => setTimeout(e, t));
154
174
  }
155
- function z(e) {
156
- return new Promise((t) => {
175
+ function G(t) {
176
+ return new Promise((e) => {
157
177
  const n = (i) => {
158
- e.removeEventListener("animationend", n), t(i);
178
+ t.removeEventListener("animationend", n), e(i);
159
179
  };
160
- e.addEventListener("animationend", n);
180
+ t.addEventListener("animationend", n);
161
181
  });
162
182
  }
163
- function G(e) {
183
+ function j(t) {
164
184
  var i;
165
- const t = new $(200, 5e3);
166
- class n extends e {
185
+ const e = new T(200, 5e3);
186
+ class n extends t {
167
187
  constructor() {
168
188
  super(...arguments);
169
- u(this, "currentBreakPoint", null);
170
- c(this, i, async () => {
171
- await t.wait(), await B();
189
+ d(this, "currentBreakPoint", null);
190
+ m(this, i, async () => {
191
+ await e.wait(), await B();
172
192
  const l = window.innerWidth;
173
- let o = getComputedStyle(this).getPropertyValue("--breakpoint");
174
- o || (this.style.setProperty("--breakpoint", "md"), o = getComputedStyle(this).getPropertyValue("--breakpoint"));
175
- const d = C(l);
176
- this.currentBreakPoint !== d && (y(o) < y(d) ? this.setAttribute("mode", "desktop") : this.setAttribute("mode", "mobile"));
193
+ let s = getComputedStyle(this).getPropertyValue("--breakpoint");
194
+ s || (this.style.setProperty("--breakpoint", "md"), s = getComputedStyle(this).getPropertyValue("--breakpoint"));
195
+ const u = D(l);
196
+ this.currentBreakPoint !== u && (v(s) < v(u) ? this.setAttribute("mode", "desktop") : this.setAttribute("mode", "mobile"));
177
197
  });
178
198
  }
179
199
  connectedCallback() {
@@ -186,112 +206,113 @@ function G(e) {
186
206
  return i = new WeakMap(), n;
187
207
  }
188
208
  const g = Symbol("listenerDefs"), k = Symbol("withEventBindings");
189
- function j(e, t) {
190
- const n = Array.isArray(e) ? e : [e];
209
+ function q(t, e) {
210
+ const n = Array.isArray(t) ? t : [t];
191
211
  return function(i, r) {
192
212
  if (r.kind !== "method") throw new Error("@Listen nur für Methoden");
193
213
  return r.addInitializer(function() {
194
- const s = this.constructor;
195
- (s[g] || (s[g] = [])).push({
214
+ const o = this.constructor;
215
+ (o[g] || (o[g] = [])).push({
196
216
  method: r.name,
197
217
  events: n,
198
- opts: t
218
+ opts: e
199
219
  });
200
- }), function(...s) {
220
+ }), function(...o) {
201
221
  if (!this[k])
202
222
  throw new Error("[EventBindings] @Listen - decorator requires EventBindingMixin.");
203
- return i.apply(this, s);
223
+ return i.apply(this, o);
204
224
  };
205
225
  };
206
226
  }
207
- function R(e, t) {
227
+ function R(t, e) {
208
228
  var n;
209
- return !t || t === "host" ? e : t === "document" ? e.ownerDocument ?? document : t === "window" ? ((n = e.ownerDocument) == null ? void 0 : n.defaultView) ?? window : t === "shadowRoot" ? e.shadowRoot ?? e : typeof t == "function" ? t(e) : t;
229
+ return !e || e === "host" ? t : e === "document" ? t.ownerDocument ?? document : e === "window" ? ((n = t.ownerDocument) == null ? void 0 : n.defaultView) ?? window : e === "shadowRoot" ? t.shadowRoot ?? t : typeof e == "function" ? e(t) : e;
210
230
  }
211
- function q(e) {
212
- var n, i, P;
213
- class t extends e {
214
- constructor(...o) {
215
- super(...o);
216
- c(this, i);
217
- c(this, n);
231
+ function X(t) {
232
+ var n, i, M;
233
+ class e extends t {
234
+ constructor(...s) {
235
+ super(...s);
236
+ m(this, i);
237
+ m(this, n);
218
238
  this[k] = !0;
219
239
  }
220
240
  connectedCallback() {
221
- var o;
222
- (o = super.connectedCallback) == null || o.call(this), p(this, i, P).call(this);
241
+ var s;
242
+ (s = super.connectedCallback) == null || s.call(this), L(this, i, M).call(this);
223
243
  }
224
244
  disconnectedCallback() {
225
- var o, d;
226
- (o = a(this, n)) == null || o.abort(), (d = super.disconnectedCallback) == null || d.call(this);
245
+ var s, u;
246
+ (s = a(this, n)) == null || s.abort(), (u = super.disconnectedCallback) == null || u.call(this);
227
247
  }
228
248
  }
229
- return n = new WeakMap(), i = new WeakSet(), P = function() {
230
- var d, b, E;
231
- (d = a(this, n)) == null || d.abort(), m(this, n, new AbortController());
232
- const o = this.constructor[g] || [];
233
- for (const h of o) {
234
- const I = R(this, (b = h.opts) == null ? void 0 : b.target), M = ((E = h.opts) == null ? void 0 : E.options) ?? {}, T = this[h.method].bind(this);
235
- for (const W of h.events)
236
- I.addEventListener(W, T, { ...M, signal: a(this, n).signal });
249
+ return n = new WeakMap(), i = new WeakSet(), M = function() {
250
+ var u, b, E;
251
+ (u = a(this, n)) == null || u.abort(), c(this, n, new AbortController());
252
+ const s = this.constructor[g] || [];
253
+ for (const h of s) {
254
+ const x = R(this, (b = h.opts) == null ? void 0 : b.target), W = ((E = h.opts) == null ? void 0 : E.options) ?? {}, P = this[h.method].bind(this);
255
+ for (const I of h.events)
256
+ x.addEventListener(I, P, { ...W, signal: a(this, n).signal });
237
257
  }
238
- }, t;
258
+ }, e;
239
259
  }
240
260
  let _ = 1;
241
- function X(e) {
261
+ function J(t) {
242
262
  var n, i, r;
243
- class t extends e {
263
+ class e extends t {
244
264
  constructor() {
245
265
  super(...arguments);
246
- c(this, n, null);
247
- c(this, i, _++);
248
- c(this, r, null);
266
+ m(this, n, null);
267
+ m(this, i, _++);
268
+ m(this, r, null);
249
269
  }
250
270
  /**
251
271
  * Clears the cached debug flag so the attribute will be checked again
252
272
  * on the next log/warn/error call.
253
273
  */
254
274
  invalidateDebugCache() {
255
- m(this, n, null);
275
+ c(this, n, null);
256
276
  }
257
277
  get _debug() {
258
- return a(this, n) !== null ? a(this, n) : (this instanceof HTMLElement && m(this, n, this.hasAttribute("debug") && !["false", "0", "off", "no"].includes(this.getAttribute("debug") || "")), a(this, n) === !0 && console.log(`[DEBUG][ID:${a(this, i)}] LoggingMixin: Debug mode is enabled for <${this.tagName}>`, this), a(this, n) ?? !1);
278
+ return a(this, n) !== null ? a(this, n) : (this instanceof HTMLElement && c(this, n, this.hasAttribute("debug") && !["false", "0", "off", "no"].includes(this.getAttribute("debug") || "")), a(this, n) === !0 && console.log(`[DEBUG][ID:${a(this, i)}] LoggingMixin: Debug mode is enabled for <${this.tagName}>`, this), a(this, n) ?? !1);
259
279
  }
260
- getLogger(o = "main") {
261
- return a(this, r) || m(this, r, new D(this._debug, `${a(this, i)}`, o)), a(this, r);
280
+ getLogger(s = "main") {
281
+ return a(this, r) || c(this, r, new $(this._debug, `${a(this, i)}`, s)), a(this, r);
262
282
  }
263
- log(...o) {
264
- this.getLogger().log(...o);
283
+ log(...s) {
284
+ this.getLogger().log(...s);
265
285
  }
266
- warn(...o) {
267
- this.getLogger().warn(...o);
286
+ warn(...s) {
287
+ this.getLogger().warn(...s);
268
288
  }
269
- error(...o) {
270
- this.getLogger().error(...o);
289
+ error(...s) {
290
+ this.getLogger().error(...s);
271
291
  }
272
- throwError(...o) {
273
- return this.getLogger().throwError(...o);
292
+ throwError(...s) {
293
+ return this.getLogger().throwError(...s);
274
294
  }
275
295
  }
276
- return n = new WeakMap(), i = new WeakMap(), r = new WeakMap(), t;
296
+ return n = new WeakMap(), i = new WeakMap(), r = new WeakMap(), e;
277
297
  }
278
298
  export {
279
- G as BreakPointMixin,
280
- $ as Debouncer,
281
- q as EventBindingsMixin,
282
- j as Listen,
283
- D as Logger,
284
- X as LoggingMixin,
285
- F as Stopwatch,
286
- v as breakpointMap,
299
+ j as BreakPointMixin,
300
+ T as Debouncer,
301
+ X as EventBindingsMixin,
302
+ q as Listen,
303
+ $ as Logger,
304
+ J as LoggingMixin,
305
+ H as Stopwatch,
306
+ y as breakpointMap,
287
307
  f as breakpoints,
288
308
  S as create_element,
289
- y as getBreakpointMinWidth,
290
- C as getCurrentBreakpoint,
291
- U as getErrorLocation,
292
- V as sleep,
293
- H as waitFor,
294
- z as waitForAnimationEnd,
309
+ U as debounce,
310
+ v as getBreakpointMinWidth,
311
+ D as getCurrentBreakpoint,
312
+ F as getErrorLocation,
313
+ z as sleep,
314
+ O as waitFor,
315
+ G as waitForAnimationEnd,
295
316
  B as waitForDomContentLoaded,
296
- O as waitForLoad
317
+ V as waitForLoad
297
318
  };
@@ -3,6 +3,7 @@ export declare class Debouncer {
3
3
  private max_delay;
4
4
  private timeout;
5
5
  private startTimeWithMs;
6
+ private maxTimeout;
6
7
  /**
7
8
  *
8
9
  * @param delay Debounce delay in milliseconds
@@ -12,3 +13,22 @@ export declare class Debouncer {
12
13
  wait(): Promise<unknown>;
13
14
  debounce(callback: () => void): void;
14
15
  }
16
+ type MethodCtx = {
17
+ kind: 'method';
18
+ name: string | symbol;
19
+ };
20
+ /**
21
+ * Decorator to debounce method calls
22
+ *
23
+ * <example>
24
+ * @debounce(200, 1000)
25
+ * onResize() {
26
+ * // This method will be debounced with a delay of 200ms and a maximum delay of 1000ms
27
+ * }
28
+ * </example>
29
+ *
30
+ * @param delay
31
+ * @param maxDelay
32
+ */
33
+ export declare function debounce(delay: number, maxDelay?: number | false): <This, Args extends any[], Ret>(value: (this: This, ...args: Args) => Ret, context: MethodCtx) => (this: This, ...args: Args) => Ret;
34
+ export {};
@@ -1,7 +1,7 @@
1
1
  type Constructor<T = object> = abstract new (...args: any[]) => T;
2
2
  export declare function BreakPointMixin<TBase extends Constructor<HTMLElement>>(Base: TBase): (abstract new (...args: any[]) => {
3
3
  currentBreakPoint: string | null;
4
- "__#2659@#updateBreakPoint": () => Promise<void>;
4
+ "__#2763@#updateBreakPoint": () => Promise<void>;
5
5
  connectedCallback(): void;
6
6
  disconnectedCallback(): void;
7
7
  accessKey: string;
@@ -9,9 +9,9 @@ type OneOrMany<N extends EventName> = N | readonly N[];
9
9
  type EventFromInput<I extends OneOrMany<EventName>> = I extends readonly (infer K)[] ? K extends EventName ? DocumentEventMap[K] : never : I extends EventName ? DocumentEventMap[I] : never;
10
10
  export declare function Listen<I extends OneOrMany<EventName>>(type: I, opts?: ListenOpts): <This, Fn extends (this: This, ev: EventFromInput<I>, ...args: any[]) => any>(value: Fn, context: ClassMethodDecoratorContext<This, Fn>) => Fn;
11
11
  export declare function EventBindingsMixin<TBase extends Ctor<object>>(Base: TBase): (abstract new (...a: any[]) => {
12
- "__#2660@#ac"?: AbortController;
12
+ "__#2764@#ac"?: AbortController;
13
13
  connectedCallback(): void;
14
14
  disconnectedCallback(): void;
15
- "__#2660@#bindEventListeners"(): void;
15
+ "__#2764@#bindEventListeners"(): void;
16
16
  }) & TBase;
17
17
  export {};
@@ -26,14 +26,14 @@ type Constructor<T = object> = abstract new (...args: any[]) => T;
26
26
  * <my-element debug></my-element> // enables debug logging
27
27
  */
28
28
  export declare function LoggingMixin<TBase extends Constructor<object>>(Base: TBase): (abstract new (...args: any[]) => {
29
- "__#2661@#debugCached": boolean | null;
30
- "__#2661@#myElementId": number;
29
+ "__#2765@#debugCached": boolean | null;
30
+ "__#2765@#myElementId": number;
31
31
  /**
32
32
  * Clears the cached debug flag so the attribute will be checked again
33
33
  * on the next log/warn/error call.
34
34
  */
35
35
  invalidateDebugCache(): void;
36
- "__#2661@#myLoggerInstance": Logger | null;
36
+ "__#2765@#myLoggerInstance": Logger | null;
37
37
  readonly _debug: boolean;
38
38
  getLogger(instanceId?: string): Logger;
39
39
  log(...args: any[]): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trunkjs/browser-utils",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "main": "./index.js",
5
5
  "dependencies": {},
6
6
  "type": "module",