jsquery_node 1.0.0 → 1.0.2
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.d.ts +6517 -2657
- package/jsquery.ts +14 -9
- package/package.json +1 -1
package/jsquery.ts
CHANGED
|
@@ -50,7 +50,7 @@ export const { $, JSQuery } = (() => {
|
|
|
50
50
|
}
|
|
51
51
|
new() {
|
|
52
52
|
const temp = new ElementArray();
|
|
53
|
-
this.forEach((v) => temp.push(v.new()));
|
|
53
|
+
this.forEach((v) => temp.push(v.new() as any));
|
|
54
54
|
return temp;
|
|
55
55
|
}
|
|
56
56
|
//events
|
|
@@ -73,12 +73,12 @@ export const { $, JSQuery } = (() => {
|
|
|
73
73
|
}
|
|
74
74
|
this.on(e, func, s);
|
|
75
75
|
}
|
|
76
|
-
static from(elt: HTMLElement | NodeList | HTMLCollection) {
|
|
76
|
+
static from(elt: HTMLElement | NodeList | HTMLCollection): Element | ElementArray {
|
|
77
77
|
if (elt == null) {
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
80
|
if (toArray(elt)) {
|
|
81
|
-
return ElementArray.from(elt).map((v) => new this(v as HTMLElement));
|
|
81
|
+
return ElementArray.from(elt).map((v) => new this(v as HTMLElement)) as ElementArray;
|
|
82
82
|
}
|
|
83
83
|
return new this(elt);
|
|
84
84
|
}
|
|
@@ -253,16 +253,16 @@ export const { $, JSQuery } = (() => {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
function J(q: any) {
|
|
257
|
-
return Element.from(document.querySelector(q));
|
|
256
|
+
function J(q: any): Element {
|
|
257
|
+
return Element.from(document.querySelector(q)) as any;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
J.from = (elt: HTMLElement | NodeList | HTMLCollection) => {
|
|
261
261
|
return Element.from(elt);
|
|
262
262
|
};
|
|
263
263
|
|
|
264
|
-
J.all = (q: any) => {
|
|
265
|
-
return Element.from(document.querySelectorAll(q));
|
|
264
|
+
J.all = (q: any): ElementArray => {
|
|
265
|
+
return Element.from(document.querySelectorAll(q)) as any;
|
|
266
266
|
};
|
|
267
267
|
|
|
268
268
|
let head: Element;
|
|
@@ -283,8 +283,8 @@ export const { $, JSQuery } = (() => {
|
|
|
283
283
|
return doc;
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
J.create = (t: any) => {
|
|
287
|
-
return Element.from(document.createElement(t));
|
|
286
|
+
J.create = (t: any): Element => {
|
|
287
|
+
return Element.from(document.createElement(t)) as any;
|
|
288
288
|
};
|
|
289
289
|
|
|
290
290
|
const JSQuery = {
|
|
@@ -334,3 +334,8 @@ export const { $, JSQuery } = (() => {
|
|
|
334
334
|
|
|
335
335
|
return { $: J, JSQuery };
|
|
336
336
|
})();
|
|
337
|
+
|
|
338
|
+
export type ElementArray = typeof JSQuery.ElementArray;
|
|
339
|
+
export type Element = typeof JSQuery.ElementArray;
|
|
340
|
+
export type Extension = typeof JSQuery.Extension;
|
|
341
|
+
export type Plugin = typeof JSQuery.Extension;
|