@tspro/ts-utils-lib 3.2.0 → 3.3.1

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,18 @@
1
1
  # Changelog
2
- ## [3.2.0] - 2026-01-12
2
+ ## [3.3.1] - 2026-01-24
3
+ ### Fixed
4
+ - README.md.
5
+
6
+ ## [3.3.0] - 2026-01-12
7
+ ### Changed
8
+ - Loosen some Utils.Dom function arguments from HTMLElement to Element.
9
+ - Utils.Dom.addClass() and removeClass() accept multiple class names using variadic arg.
10
+
11
+ ## [3.2.0] - 2026-01-??
3
12
  ## Added
4
- - Utils.Str.trimStart(str, ...chars)
5
- - Utils.Str.trimEnd(str, ...chars)
6
- - Utils.Str.trim(str, ...chars)
13
+ - Utils.Str.trimStart()
14
+ - Utils.Str.trimEnd()
15
+ - Utils.Str.trim()
7
16
 
8
17
  ## [3.1.1] - 2026-01-08
9
18
  ## Fixed
package/README.md CHANGED
@@ -4,55 +4,55 @@
4
4
  A small collection of TypeScript functions, containers, modules, etc. used
5
5
  in my personal projects.
6
6
 
7
- I do not use much AI in my work but this is exception. Lot of stuff in this
8
- lib is written by AI.
9
-
10
7
  ## Links
8
+ [Homepage](https://pahkasoft.com/ts-utils-lib) |
11
9
  [Repository](https://github.com/pahkasoft/ts-utils-lib) |
12
- [Package](https://www.npmjs.com/package/@tspro/ts-utils-lib) |
13
- [Homepage](https://pahkasoft.github.io/ts-utils-lib)
14
-
15
- Homepage contains TS Docs/API Reference.
10
+ [Package](https://www.npmjs.com/package/@tspro/ts-utils-lib)
16
11
 
17
- ## Version 3.x Info
18
- Version `3.0.0` changed `Device`.
12
+ ## Quick Start
19
13
 
20
- Version `3.1.0` added invalid `CallTracker`.
21
- Use version `3.1.1` with correct `CallTracker` instead.
14
+ ### Install
22
15
 
23
- ## Install
24
16
  `npm install @tspro/ts-utils-lib`
25
17
 
26
- ## Usage
27
- ```js
28
- // Import
29
- import { UniMap } from "@tspro/ts-utils-lib";
18
+ ### Import
30
19
 
31
- // TS example:
32
- const map = new UniMap<string, number>();
20
+ ```ts
21
+ // Import required stuff.
22
+ import { UniMap, Utils } from "@tspro/ts-utils-lib";
23
+ ```
24
+
25
+ ### Require
33
26
 
34
- // JS example:
35
- const map = new UniMap();
27
+ ```ts
28
+ // Require required stuff.
29
+ const { UniMap, Utils } = require("@tspro/ts-utils-lib");
36
30
  ```
37
31
 
38
- ## Browser Usage
32
+ ### Browser Script
33
+
39
34
  - Available in version `2.1.0`.
40
35
  - These bundles are transpiled with `ES5` target.
41
36
  - With non-polyfilled versions you can use option to your own polyfilling choise.
42
37
 
43
38
  ```html
44
- <!-- Load non-polyfilled or polyfilled bundles on unpkg cdn -->
45
- <script src="https://unpkg.com/@tspro/ts-utils-lib@2.3.0/dist/index.es5.iife.js"></script>
46
- <script src="https://unpkg.com/@tspro/ts-utils-lib@2.3.0/dist/index.es5.polyfilled.iife.js"></script>
39
+ <!-- Unpkg CDM: Load non-polyfilled or polyfilled bundles. -->
40
+ <script src="https://unpkg.com/@tspro/ts-utils-lib@3.3.1/dist/index.es5.iife.js"></script>
41
+ <script src="https://unpkg.com/@tspro/ts-utils-lib@3.3.1/dist/index.es5.polyfilled.iife.js"></script>
47
42
 
48
- <!-- Load non-polyfilled or polyfilled bundles on jsdelivr cdn -->
49
- <script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.3.0/dist/index.es5.iife.js"></script>
50
- <script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.3.0/dist/index.es5.polyfilled.iife.js"></script>
43
+ <!-- jsDelivr CDN: Load non-polyfilled or polyfilled bundles. -->
44
+ <script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@3.3.1/dist/index.es5.iife.js"></script>
45
+ <script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@3.3.1/dist/index.es5.polyfilled.iife.js"></script>
51
46
 
52
- <!-- JS example: -->
53
47
  <script>
54
48
  const { UniMap, Utils } = window.TsUtilsLib;
55
- const map = new UniMap();
56
- console.log(Utils.Str.stringify(map));
57
49
  </script>
58
50
  ```
51
+
52
+ ## Usage
53
+
54
+ ```ts
55
+ const map = new UniMap<string, number>();
56
+
57
+ console.log(Utils.Str.stringify(map));
58
+ ```
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;