jsquery_node 1.0.4 → 1.0.5
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/jsquery.ts +8 -7
- package/package.json +1 -1
package/jsquery.ts
CHANGED
|
@@ -75,7 +75,9 @@ export const { $, JSQuery } = (() => {
|
|
|
75
75
|
}
|
|
76
76
|
this.on(e, func, s);
|
|
77
77
|
}
|
|
78
|
-
static from(elt: HTMLElement
|
|
78
|
+
static from(elt: HTMLElement): Element|null;
|
|
79
|
+
static from(elt: NodeList|HTMLCollection): ElementArray;
|
|
80
|
+
static from(elt: HTMLElement | NodeList | HTMLCollection): Element | ElementArray | null {
|
|
79
81
|
if (elt == null) {
|
|
80
82
|
return null;
|
|
81
83
|
}
|
|
@@ -265,13 +267,11 @@ export const { $, JSQuery } = (() => {
|
|
|
265
267
|
}
|
|
266
268
|
}
|
|
267
269
|
|
|
268
|
-
function J(q: any): Element {
|
|
270
|
+
function J(q: any): Element | null {
|
|
269
271
|
return Element.from(document.querySelector(q)) as any;
|
|
270
272
|
}
|
|
271
|
-
|
|
272
|
-
J.from =
|
|
273
|
-
return Element.from(elt);
|
|
274
|
-
};
|
|
273
|
+
|
|
274
|
+
J.from = Element.from;
|
|
275
275
|
|
|
276
276
|
J.all = (q: any): ElementArray => {
|
|
277
277
|
return Element.from(document.querySelectorAll(q)) as any;
|
|
@@ -348,6 +348,7 @@ export const { $, JSQuery } = (() => {
|
|
|
348
348
|
})();
|
|
349
349
|
|
|
350
350
|
export type ElementArray = typeof JSQuery.ElementArray;
|
|
351
|
-
export type Element = typeof JSQuery.
|
|
351
|
+
export type Element = typeof JSQuery.Element;
|
|
352
352
|
export type Extension = typeof JSQuery.Extension;
|
|
353
353
|
export type Plugin = typeof JSQuery.Extension;
|
|
354
|
+
|