@whitesev/utils 1.2.1 → 1.2.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/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/src/Utils.d.ts +19 -0
- package/package.json +1 -1
- package/src/Utils.ts +19 -0
package/dist/src/Utils.d.ts
CHANGED
|
@@ -1529,6 +1529,25 @@ declare class Utils {
|
|
|
1529
1529
|
* })
|
|
1530
1530
|
*/
|
|
1531
1531
|
waitNodeList<T extends HTMLElement>(nodeSelector: string): Promise<T>;
|
|
1532
|
+
/**
|
|
1533
|
+
* 等待指定元素出现
|
|
1534
|
+
* @param nodeSelectors
|
|
1535
|
+
* @returns 当nodeSelectors为数组多个时,
|
|
1536
|
+
* 返回如:[ NodeList, NodeList ],
|
|
1537
|
+
* 当nodeSelectors为单个时,
|
|
1538
|
+
* 返回如:NodeList。
|
|
1539
|
+
* NodeList元素与页面存在强绑定,当已获取该NodeList,但是页面中却删除了,该元素在NodeList中会被自动删除
|
|
1540
|
+
* @example
|
|
1541
|
+
* Utils.waitNodeList("div.xxx").then( nodeList =>{
|
|
1542
|
+
* console.log(nodeList) // div.xxx => NodeList
|
|
1543
|
+
* })
|
|
1544
|
+
* @example
|
|
1545
|
+
* Utils.waitNodeList("div.xxx","a.xxx").then( nodeListArray =>{
|
|
1546
|
+
* console.log(nodeListArray[0]) // div.xxx => NodeList
|
|
1547
|
+
* console.log(nodeListArray[1]) // a.xxx => NodeList
|
|
1548
|
+
* })
|
|
1549
|
+
*/
|
|
1550
|
+
waitNodeList<T extends HTMLElement[]>(nodeSelector: string): Promise<T>;
|
|
1532
1551
|
/**
|
|
1533
1552
|
* 等待指定元素出现,支持多个selector
|
|
1534
1553
|
* @param nodeSelectors
|
package/package.json
CHANGED
package/src/Utils.ts
CHANGED
|
@@ -4179,6 +4179,25 @@ class Utils {
|
|
|
4179
4179
|
* })
|
|
4180
4180
|
*/
|
|
4181
4181
|
waitNodeList<T extends HTMLElement>(nodeSelector: string): Promise<T>;
|
|
4182
|
+
/**
|
|
4183
|
+
* 等待指定元素出现
|
|
4184
|
+
* @param nodeSelectors
|
|
4185
|
+
* @returns 当nodeSelectors为数组多个时,
|
|
4186
|
+
* 返回如:[ NodeList, NodeList ],
|
|
4187
|
+
* 当nodeSelectors为单个时,
|
|
4188
|
+
* 返回如:NodeList。
|
|
4189
|
+
* NodeList元素与页面存在强绑定,当已获取该NodeList,但是页面中却删除了,该元素在NodeList中会被自动删除
|
|
4190
|
+
* @example
|
|
4191
|
+
* Utils.waitNodeList("div.xxx").then( nodeList =>{
|
|
4192
|
+
* console.log(nodeList) // div.xxx => NodeList
|
|
4193
|
+
* })
|
|
4194
|
+
* @example
|
|
4195
|
+
* Utils.waitNodeList("div.xxx","a.xxx").then( nodeListArray =>{
|
|
4196
|
+
* console.log(nodeListArray[0]) // div.xxx => NodeList
|
|
4197
|
+
* console.log(nodeListArray[1]) // a.xxx => NodeList
|
|
4198
|
+
* })
|
|
4199
|
+
*/
|
|
4200
|
+
waitNodeList<T extends HTMLElement[]>(nodeSelector: string): Promise<T>;
|
|
4182
4201
|
/**
|
|
4183
4202
|
* 等待指定元素出现,支持多个selector
|
|
4184
4203
|
* @param nodeSelectors
|