@tspro/ts-utils-lib 3.2.0 → 3.3.0

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,9 +1,14 @@
1
1
  # Changelog
2
- ## [3.2.0] - 2026-01-12
2
+ ## [3.3.0] - 2026-01-12
3
+ ## Changed
4
+ - Loosen some Utils.Dom function arguments from HTMLElement to Element.
5
+ - Utils.Dom.addClass() and removeClass() accept multiple class names using variadic arg.
6
+
7
+ ## [3.2.0] - 2026-01-??
3
8
  ## Added
4
- - Utils.Str.trimStart(str, ...chars)
5
- - Utils.Str.trimEnd(str, ...chars)
6
- - Utils.Str.trim(str, ...chars)
9
+ - Utils.Str.trimStart()
10
+ - Utils.Str.trimEnd()
11
+ - Utils.Str.trim()
7
12
 
8
13
  ## [3.1.1] - 2026-01-08
9
14
  ## Fixed
package/dist/index.d.ts CHANGED
@@ -430,9 +430,9 @@ interface CSSProperties {
430
430
  width?: string | number;
431
431
  height?: string | number;
432
432
  }
433
- declare function hasClass(el: HTMLElement, className: string): boolean;
434
- declare function addClass(el: HTMLElement, className: string): void;
435
- declare function removeClass(el: HTMLElement, className: string): void;
433
+ declare function hasClass(el: Element, className: string): boolean;
434
+ declare function addClass(el: Element, ...className: string[]): void;
435
+ declare function removeClass(el: Element, ...className: string[]): void;
436
436
  declare function setOffset(el: HTMLElement, left: number, top: number, unit?: string): void;
437
437
  declare function getOffset(el: HTMLElement): {
438
438
  left: number;
@@ -442,12 +442,12 @@ declare function getWidth(el: HTMLElement | Window): number;
442
442
  declare function setWidth(el: HTMLElement, val: number): void;
443
443
  declare function getHeight(el: HTMLElement | Window): number;
444
444
  declare function setHeight(el: HTMLElement, val: number): void;
445
- declare function appendTo(el: HTMLElement | SVGElement, to: HTMLElement | SVGElement): void;
446
- declare function removeFromParent(el: HTMLElement | SVGElement): void;
445
+ declare function appendTo(el: Element | SVGElement, to: Element | SVGElement): void;
446
+ declare function removeFromParent(el: Element | SVGElement): void;
447
447
  declare function setVisibility(el: HTMLElement | SVGElement, visible: boolean): void;
448
448
  declare function setRect(el: HTMLElement, left: number, top: number, width: number, height: number, unit?: string): void;
449
- declare function getButton(btn: HTMLElement | string): HTMLButtonElement | undefined;
450
- declare function getCanvas(canvas: HTMLElement | string): HTMLCanvasElement | undefined;
449
+ declare function getButton(btn: Element | string): HTMLButtonElement | undefined;
450
+ declare function getCanvas(canvas: Element | string): HTMLCanvasElement | undefined;
451
451
  declare function getPadding(style?: CSSProperties): {
452
452
  top: number;
453
453
  right: number;