@whitesev/domutils 1.5.5 → 1.5.6

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.
@@ -72,7 +72,7 @@ declare class DOMUtils extends DOMUtilsEvent {
72
72
  * DOMUtils.css("a.xx","display");
73
73
  * > "none"
74
74
  * */
75
- css(element: DOMUtilsTargetElementType, property: keyof CSSStyleDeclaration): string;
75
+ css(element: DOMUtilsTargetElementType, property: keyof Omit<CSSStyleDeclaration, "zIndex"> | "z-index"): string;
76
76
  /**
77
77
  * 获取元素的样式属性值
78
78
  * @param element 目标元素
@@ -100,7 +100,7 @@ declare class DOMUtils extends DOMUtilsEvent {
100
100
  * DOMUtils.css(document.querySelector("a.xx"),"top","10px");
101
101
  * DOMUtils.css(document.querySelector("a.xx"),"top",10);
102
102
  * */
103
- css(element: DOMUtilsTargetElementType, property: keyof CSSStyleDeclaration & string, value: string | number): string;
103
+ css(element: DOMUtilsTargetElementType, property: (keyof Omit<CSSStyleDeclaration, "zIndex"> | "z-index") & string, value: string | number): string;
104
104
  /**
105
105
  * 设置元素的样式属性
106
106
  * @param element 目标元素
@@ -116,7 +116,9 @@ declare class DOMUtils extends DOMUtilsEvent {
116
116
  * DOMUtils.css(document.querySelector("a.xx"),{ top: 10 });
117
117
  * */
118
118
  css(element: DOMUtilsTargetElementType, property: {
119
- [P in keyof CSSStyleDeclaration]?: CSSStyleDeclaration[P];
119
+ [P in keyof Omit<CSSStyleDeclaration, "zIndex">]?: CSSStyleDeclaration[P];
120
+ } | {
121
+ "z-index": string | number;
120
122
  } | {
121
123
  [key: string]: string | number;
122
124
  }): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/domutils",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "使用js重新对jQuery的部分函数进行了仿写",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/DOMUtils.ts CHANGED
@@ -155,7 +155,7 @@ class DOMUtils extends DOMUtilsEvent {
155
155
  * */
156
156
  css(
157
157
  element: DOMUtilsTargetElementType,
158
- property: keyof CSSStyleDeclaration
158
+ property: keyof Omit<CSSStyleDeclaration, "zIndex"> | "z-index"
159
159
  ): string;
160
160
  /**
161
161
  * 获取元素的样式属性值
@@ -186,7 +186,7 @@ class DOMUtils extends DOMUtilsEvent {
186
186
  * */
187
187
  css(
188
188
  element: DOMUtilsTargetElementType,
189
- property: keyof CSSStyleDeclaration & string,
189
+ property: (keyof Omit<CSSStyleDeclaration, "zIndex"> | "z-index") & string,
190
190
  value: string | number
191
191
  ): string;
192
192
  /**
@@ -207,7 +207,13 @@ class DOMUtils extends DOMUtilsEvent {
207
207
  element: DOMUtilsTargetElementType,
208
208
  property:
209
209
  | {
210
- [P in keyof CSSStyleDeclaration]?: CSSStyleDeclaration[P];
210
+ [P in keyof Omit<
211
+ CSSStyleDeclaration,
212
+ "zIndex"
213
+ >]?: CSSStyleDeclaration[P];
214
+ }
215
+ | {
216
+ "z-index": string | number;
211
217
  }
212
218
  | {
213
219
  [key: string]: string | number;
@@ -216,10 +222,10 @@ class DOMUtils extends DOMUtilsEvent {
216
222
  css(
217
223
  element: DOMUtilsTargetElementType,
218
224
  property:
219
- | keyof CSSStyleDeclaration
225
+ | keyof Omit<CSSStyleDeclaration, "zIndex">
220
226
  | string
221
227
  | {
222
- [P in keyof CSSStyleDeclaration]?:
228
+ [P in keyof Omit<CSSStyleDeclaration, "zIndex">]?:
223
229
  | string
224
230
  | number
225
231
  | CSSStyleDeclaration[P];