@tspro/ts-utils-lib 2.3.0 → 3.0.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 +4 -0
- package/README.md +5 -5
- package/dist/index.d.ts +15 -23
- package/dist/index.es5.iife.js +1 -1
- package/dist/index.es5.polyfilled.iife.js +1 -1
- package/dist/index.js +90 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -73
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ lib is written by AI.
|
|
|
15
15
|
Homepage contains TS Docs/API Reference.
|
|
16
16
|
|
|
17
17
|
## Install
|
|
18
|
-
`npm
|
|
18
|
+
`npm install @tspro/ts-utils-lib`
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
```js
|
|
@@ -36,12 +36,12 @@ const map = new UniMap();
|
|
|
36
36
|
|
|
37
37
|
```html
|
|
38
38
|
<!-- Load non-polyfilled or polyfilled bundles on unpkg cdn -->
|
|
39
|
-
<script src="https://unpkg.com/@tspro/ts-utils-lib@2.
|
|
40
|
-
<script src="https://unpkg.com/@tspro/ts-utils-lib@2.
|
|
39
|
+
<script src="https://unpkg.com/@tspro/ts-utils-lib@2.3.0/dist/index.es5.iife.js"></script>
|
|
40
|
+
<script src="https://unpkg.com/@tspro/ts-utils-lib@2.3.0/dist/index.es5.polyfilled.iife.js"></script>
|
|
41
41
|
|
|
42
42
|
<!-- Load non-polyfilled or polyfilled bundles on jsdelivr cdn -->
|
|
43
|
-
<script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.
|
|
44
|
-
<script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.
|
|
43
|
+
<script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.3.0/dist/index.es5.iife.js"></script>
|
|
44
|
+
<script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.3.0/dist/index.es5.polyfilled.iife.js"></script>
|
|
45
45
|
|
|
46
46
|
<!-- JS example: -->
|
|
47
47
|
<script>
|
package/dist/index.d.ts
CHANGED
|
@@ -186,10 +186,7 @@ declare namespace cookies {
|
|
|
186
186
|
export { cookies_accept as accept, cookies_decline as decline, cookies_erase as erase, cookies_eraseAll as eraseAll, cookies_isConsentPending as isConsentPending, cookies_read as read, cookies_readBool as readBool, cookies_readInt as readInt, cookies_save as save, cookies_setExpireDays as setExpireDays };
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
declare const DPI: number;
|
|
191
|
-
/** Devices pixels per millimeter. */
|
|
192
|
-
declare const PxPerMm: number;
|
|
189
|
+
type CssUnit = "px" | "cm" | "mm" | "in" | "pt" | "pc" | "em" | "rem" | "vw" | "vh" | "vmin" | "vmax" | "%";
|
|
193
190
|
/** Browsers scroll bar width. */
|
|
194
191
|
declare const ScrollbarWidth: number;
|
|
195
192
|
/** Browsers system font size. */
|
|
@@ -200,39 +197,34 @@ declare const IsTouchDevice: boolean;
|
|
|
200
197
|
declare const IsMobileDevice: boolean;
|
|
201
198
|
/** Host address. */
|
|
202
199
|
declare const HostAddress: string;
|
|
203
|
-
/**
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
*/
|
|
208
|
-
declare function pxToMm(px: number): number;
|
|
209
|
-
/**
|
|
210
|
-
* Convert millimeters to pixels on a device.
|
|
211
|
-
* @param mm - Millimeters.
|
|
212
|
-
* @returns - Pixels.
|
|
213
|
-
*/
|
|
214
|
-
declare function mmToPx(mm: number): number;
|
|
200
|
+
/** Device pixel ratio. */
|
|
201
|
+
declare const DevicePixelRatio: number;
|
|
202
|
+
/** Devices dots per inch. */
|
|
203
|
+
declare const DPI: number;
|
|
215
204
|
/**
|
|
216
205
|
* Convert input to pixels on a device. Input value is in html style form containing number
|
|
217
206
|
* followed by unit (e.g. "10px"). Supported units are "mm", "cm", "in", "inch", "em" and "px".
|
|
218
207
|
*
|
|
219
|
-
* @param
|
|
208
|
+
* @param valueUnit - Input value.
|
|
220
209
|
* @returns - Pixels.
|
|
221
210
|
*/
|
|
222
|
-
declare function
|
|
211
|
+
declare function unitToPx(valueUnit: string | number): number;
|
|
212
|
+
declare function pxToUnit(px: number, unit: CssUnit): number;
|
|
213
|
+
declare function pxToUnitStr(px: number, unit: CssUnit): string;
|
|
223
214
|
|
|
215
|
+
type device_CssUnit = CssUnit;
|
|
224
216
|
declare const device_DPI: typeof DPI;
|
|
217
|
+
declare const device_DevicePixelRatio: typeof DevicePixelRatio;
|
|
225
218
|
declare const device_FontSize: typeof FontSize;
|
|
226
219
|
declare const device_HostAddress: typeof HostAddress;
|
|
227
220
|
declare const device_IsMobileDevice: typeof IsMobileDevice;
|
|
228
221
|
declare const device_IsTouchDevice: typeof IsTouchDevice;
|
|
229
|
-
declare const device_PxPerMm: typeof PxPerMm;
|
|
230
222
|
declare const device_ScrollbarWidth: typeof ScrollbarWidth;
|
|
231
|
-
declare const
|
|
232
|
-
declare const
|
|
233
|
-
declare const
|
|
223
|
+
declare const device_pxToUnit: typeof pxToUnit;
|
|
224
|
+
declare const device_pxToUnitStr: typeof pxToUnitStr;
|
|
225
|
+
declare const device_unitToPx: typeof unitToPx;
|
|
234
226
|
declare namespace device {
|
|
235
|
-
export { device_DPI as DPI, device_FontSize as FontSize, device_HostAddress as HostAddress, device_IsMobileDevice as IsMobileDevice, device_IsTouchDevice as IsTouchDevice,
|
|
227
|
+
export { type device_CssUnit as CssUnit, device_DPI as DPI, device_DevicePixelRatio as DevicePixelRatio, device_FontSize as FontSize, device_HostAddress as HostAddress, device_IsMobileDevice as IsMobileDevice, device_IsTouchDevice as IsTouchDevice, device_ScrollbarWidth as ScrollbarWidth, device_pxToUnit as pxToUnit, device_pxToUnitStr as pxToUnitStr, device_unitToPx as unitToPx };
|
|
236
228
|
}
|
|
237
229
|
|
|
238
230
|
type HasProps<T extends object> = T extends Record<string, unknown> ? T : never;
|