@3dsource/utils 1.0.9 → 1.0.10

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.
Files changed (140) hide show
  1. package/eslint.config.js +37 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +4 -14
  4. package/{lib/color/CMYKtoRGB.d.ts → src/lib/color/CMYKtoRGB.ts} +11 -1
  5. package/src/lib/color/HEXtoRGB.ts +9 -0
  6. package/src/lib/color/HSVtoRGB.ts +82 -0
  7. package/{lib/color/RGBtoCMYK.d.ts → src/lib/color/RGBtoCMYK.ts} +31 -1
  8. package/src/lib/color/RGBtoHEX.ts +17 -0
  9. package/src/lib/color/RGBtoHSV.ts +53 -0
  10. package/src/lib/color/hsv.ts +14 -0
  11. package/src/lib/color/max.ts +18 -0
  12. package/src/lib/color/min.ts +18 -0
  13. package/src/lib/color/overlay.ts +25 -0
  14. package/{lib/color/rgb.d.ts → src/lib/color/rgb.ts} +3 -1
  15. package/src/lib/color/sub.ts +18 -0
  16. package/src/lib/color/subtract.ts +27 -0
  17. package/src/lib/color/sum.ts +19 -0
  18. package/{lib/color/toRGB.d.ts → src/lib/color/toRGB.ts} +7 -1
  19. package/src/lib/color/toRGBA.ts +8 -0
  20. package/src/lib/constants/color-codes.constant.ts +9 -0
  21. package/src/lib/csv/CSV2Array.ts +66 -0
  22. package/src/lib/csv/CSV2Records.ts +56 -0
  23. package/src/lib/csv/ObjectToCSV.ts +21 -0
  24. package/src/lib/dev/dev3d.ts +1 -0
  25. package/src/lib/dev/logger.ts +94 -0
  26. package/src/lib/dev/timeToString.ts +16 -0
  27. package/src/lib/filenaming/cleanupFileName.ts +18 -0
  28. package/src/lib/filenaming/makePath.ts +5 -0
  29. package/src/lib/filenaming/normalizePath.ts +9 -0
  30. package/src/lib/geom/expandOverRectangle.ts +17 -0
  31. package/src/lib/geom/fitIntoRectangle.ts +43 -0
  32. package/{lib/geom/interfaces/area.interface.d.ts → src/lib/geom/interfaces/area.interface.ts} +2 -1
  33. package/{lib/geom/interfaces/rect.interface.d.ts → src/lib/geom/interfaces/rect.interface.ts} +2 -2
  34. package/src/lib/geom/interfaces/size.interface.ts +4 -0
  35. package/src/lib/geom/interfaces//321/201oords.interface.ts +4 -0
  36. package/src/lib/helpers/BatchLoader.ts +243 -0
  37. package/src/lib/helpers/KeyboardNumericCode.ts +118 -0
  38. package/src/lib/helpers/debounce.ts +10 -0
  39. package/src/lib/helpers/generate-uuid.ts +5 -0
  40. package/{lib/helpers/index.d.ts → src/lib/helpers/index.ts} +1 -0
  41. package/src/lib/helpers/save-to-local-drive.ts +31 -0
  42. package/src/lib/helpers/serialize.ts +11 -0
  43. package/src/lib/helpers/short-hash.ts +20 -0
  44. package/src/lib/helpers/signal.ts +46 -0
  45. package/src/lib/helpers/sleep.ts +3 -0
  46. package/src/lib/helpers/trimLastSlashFromUrl.ts +9 -0
  47. package/src/lib/image/SaveImage.ts +65 -0
  48. package/src/lib/image/getCanvasCached.ts +16 -0
  49. package/src/lib/image/getSnapshot.ts +99 -0
  50. package/src/lib/image/loadImage.ts +13 -0
  51. package/src/lib/interfaces/image-output.ts +8 -0
  52. package/{lib/interfaces/load-args-tmp.interface.d.ts → src/lib/interfaces/load-args-tmp.interface.ts} +2 -1
  53. package/src/lib/interfaces/load-args.interface.ts +15 -0
  54. package/{lib/math/baseSortedIndex.d.ts → src/lib/math/baseSortedIndex.ts} +19 -1
  55. package/{lib/math/calculateMedian.d.ts → src/lib/math/calculateMedian.ts} +17 -1
  56. package/{lib/math/circularIndex.d.ts → src/lib/math/circularIndex.ts} +5 -1
  57. package/src/lib/math/clampf.ts +14 -0
  58. package/src/lib/math/degrees.ts +7 -0
  59. package/{lib/math/floatCompare.d.ts → src/lib/math/floatCompare.ts} +30 -3
  60. package/{lib/math/inverseLerp.d.ts → src/lib/math/inverseLerp.ts} +22 -1
  61. package/src/lib/math/lerp.ts +12 -0
  62. package/{lib/mutex/Mutex.d.ts → src/lib/mutex/Mutex.ts} +15 -8
  63. package/{lib/mutex/Semaphore.d.ts → src/lib/mutex/Semaphore.ts} +27 -7
  64. package/src/lib/mutex/TaskRunner.ts +26 -0
  65. package/src/lib/predicates/operators.ts +75 -0
  66. package/{lib/predicates/textForSearch.d.ts → src/lib/predicates/textForSearch.ts} +17 -1
  67. package/{lib/predicates/where.d.ts → src/lib/predicates/where.ts} +32 -2
  68. package/src/lib/rxjs/leadingTrailingDebounceTime.ts +86 -0
  69. package/{lib/rxjs/smoothTransition.d.ts → src/lib/rxjs/smoothTransition.ts} +19 -1
  70. package/src/lib/rxjs/tapLog.ts +13 -0
  71. package/src/lib/strings/pad.ts +18 -0
  72. package/tsconfig.lib.json +13 -0
  73. package/tsconfig.lib.prod.json +11 -0
  74. package/fesm2022/3dsource-utils.mjs +0 -1886
  75. package/fesm2022/3dsource-utils.mjs.map +0 -1
  76. package/index.d.ts +0 -5
  77. package/lib/color/HEXtoRGB.d.ts +0 -5
  78. package/lib/color/HSVtoRGB.d.ts +0 -21
  79. package/lib/color/RGBtoHEX.d.ts +0 -1
  80. package/lib/color/RGBtoHSV.d.ts +0 -19
  81. package/lib/color/hsv.d.ts +0 -1
  82. package/lib/color/max.d.ts +0 -1
  83. package/lib/color/min.d.ts +0 -1
  84. package/lib/color/overlay.d.ts +0 -1
  85. package/lib/color/sub.d.ts +0 -1
  86. package/lib/color/subtract.d.ts +0 -1
  87. package/lib/color/sum.d.ts +0 -1
  88. package/lib/color/toRGBA.d.ts +0 -1
  89. package/lib/constants/color-codes.constant.d.ts +0 -9
  90. package/lib/csv/CSV2Array.d.ts +0 -1
  91. package/lib/csv/CSV2Records.d.ts +0 -1
  92. package/lib/csv/ObjectToCSV.d.ts +0 -1
  93. package/lib/dev/dev3d.d.ts +0 -1
  94. package/lib/dev/logger.d.ts +0 -11
  95. package/lib/dev/timeToString.d.ts +0 -5
  96. package/lib/filenaming/cleanupFileName.d.ts +0 -1
  97. package/lib/filenaming/makePath.d.ts +0 -1
  98. package/lib/filenaming/normalizePath.d.ts +0 -1
  99. package/lib/geom/expandOverRectangle.d.ts +0 -2
  100. package/lib/geom/fitIntoRectangle.d.ts +0 -2
  101. package/lib/geom/interfaces/size.interface.d.ts +0 -4
  102. package/lib/geom/interfaces//321/201oords.interface.d.ts +0 -4
  103. package/lib/helpers/BatchLoader.d.ts +0 -47
  104. package/lib/helpers/KeyboardNumericCode.d.ts +0 -103
  105. package/lib/helpers/debounce.d.ts +0 -1
  106. package/lib/helpers/generate-uuid.d.ts +0 -1
  107. package/lib/helpers/save-to-local-drive.d.ts +0 -1
  108. package/lib/helpers/serialize.d.ts +0 -1
  109. package/lib/helpers/signal.d.ts +0 -23
  110. package/lib/helpers/sleep.d.ts +0 -1
  111. package/lib/helpers/trimLastSlashFromUrl.d.ts +0 -1
  112. package/lib/image/SaveImage.d.ts +0 -18
  113. package/lib/image/getCanvasCached.d.ts +0 -4
  114. package/lib/image/getSnapshot.d.ts +0 -2
  115. package/lib/image/loadImage.d.ts +0 -1
  116. package/lib/interfaces/image-output.d.ts +0 -7
  117. package/lib/interfaces/load-args.interface.d.ts +0 -15
  118. package/lib/math/clampf.d.ts +0 -8
  119. package/lib/math/degrees.d.ts +0 -2
  120. package/lib/math/lerp.d.ts +0 -7
  121. package/lib/mutex/TaskRunner.d.ts +0 -5
  122. package/lib/predicates/operators.d.ts +0 -32
  123. package/lib/rxjs/leadingTrailingDebounceTime.d.ts +0 -15
  124. package/lib/rxjs/tapLog.d.ts +0 -2
  125. package/lib/strings/pad.d.ts +0 -8
  126. /package/{lib/color/index.d.ts → src/lib/color/index.ts} +0 -0
  127. /package/{lib/constants/index.d.ts → src/lib/constants/index.ts} +0 -0
  128. /package/{lib/csv/index.d.ts → src/lib/csv/index.ts} +0 -0
  129. /package/{lib/dev/index.d.ts → src/lib/dev/index.ts} +0 -0
  130. /package/{lib/filenaming/index.d.ts → src/lib/filenaming/index.ts} +0 -0
  131. /package/{lib/geom/index.d.ts → src/lib/geom/index.ts} +0 -0
  132. /package/{lib/geom/interfaces/index.d.ts → src/lib/geom/interfaces/index.ts} +0 -0
  133. /package/{lib/image/index.d.ts → src/lib/image/index.ts} +0 -0
  134. /package/{lib/interfaces/index.d.ts → src/lib/interfaces/index.ts} +0 -0
  135. /package/{lib/math/index.d.ts → src/lib/math/index.ts} +0 -0
  136. /package/{lib/mutex/index.d.ts → src/lib/mutex/index.ts} +0 -0
  137. /package/{lib/predicates/index.d.ts → src/lib/predicates/index.ts} +0 -0
  138. /package/{lib/rxjs/index.d.ts → src/lib/rxjs/index.ts} +0 -0
  139. /package/{lib/strings/index.d.ts → src/lib/strings/index.ts} +0 -0
  140. /package/{public-api.d.ts → src/public-api.ts} +0 -0
@@ -1 +0,0 @@
1
- export declare function sleep(time: number): Promise<unknown>;
@@ -1 +0,0 @@
1
- export declare function trimLastSlashFromUrl(baseUrl: string): string | null | undefined;
@@ -1,18 +0,0 @@
1
- import type { ImageOutputValues } from '../interfaces';
2
- /**
3
- * USE DownloadImage instead!
4
- * @deprecated use DownloadImage instead!
5
- * @param imageSource
6
- * @param name
7
- * @param width
8
- * @param format
9
- */
10
- declare function SaveImage(imageSource: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | string, name: string, width?: number, format?: string | ImageOutputValues): any;
11
- /**
12
- * @param imageSource
13
- * @param string name
14
- * @param number width
15
- * @param string format
16
- */
17
- declare const DownloadImage: typeof SaveImage;
18
- export { SaveImage, DownloadImage };
@@ -1,4 +0,0 @@
1
- export declare function getCanvasCached(id: string): {
2
- canvas: HTMLCanvasElement;
3
- ctx: CanvasRenderingContext2D;
4
- };
@@ -1,2 +0,0 @@
1
- import type { ImageOutputValues } from '../interfaces';
2
- export declare function getSnapshot(imageElement: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, maxWidth?: number, output?: ImageOutputValues, quality?: number): HTMLCanvasElement | string;
@@ -1 +0,0 @@
1
- export declare function loadImage(url: string): Promise<HTMLImageElement>;
@@ -1,7 +0,0 @@
1
- export declare const ImageOutput: {
2
- readonly CANVAS: "canvas";
3
- readonly PNG: "image/png";
4
- readonly WEBP: "image/webp";
5
- readonly JPG: "image/jpeg";
6
- };
7
- export type ImageOutputValues = (typeof ImageOutput)[keyof typeof ImageOutput];
@@ -1,15 +0,0 @@
1
- export interface LoadArgs {
2
- order: number;
3
- extra: any;
4
- item?: HTMLImageElement;
5
- useXhr?: boolean;
6
- path: string;
7
- onLoadEnd: (data: LoadArgs) => void;
8
- onLoadStart: (data: ProgressEvent) => void;
9
- onProgress: (data: ProgressEvent) => void;
10
- id?: string;
11
- img?: HTMLImageElement;
12
- error?: boolean;
13
- fallBack?: string;
14
- resolutionId: number | string | null;
15
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Clamps value between min and max;
3
- * @param min minValue
4
- * @param max maxValue
5
- * @param value inputValue
6
- * @returns number
7
- */
8
- export declare function clampf(min: number, max: number, value: number): number;
@@ -1,2 +0,0 @@
1
- export declare function degreesToRadians(degrees: number): number;
2
- export declare function radiansToDegrees(radians: number): number;
@@ -1,7 +0,0 @@
1
- /**
2
- * @param min minimums
3
- * @param max maximums
4
- * @param value current float value in 0-1 range
5
- * @returns clamped value
6
- */
7
- export declare function lerp(min: number, max: number, value: number): number;
@@ -1,5 +0,0 @@
1
- import type { Observable } from 'rxjs';
2
- export declare class TaskRunner {
3
- private mutex;
4
- runTask(name: string, task: () => Observable<string | null>): Observable<string | null>;
5
- }
@@ -1,32 +0,0 @@
1
- type TruthyTypesOf<T> = T extends false | '' | 0 | null | undefined ? never : T;
2
- type FalsyTypesOf<T> = T extends false | '' | 0 | null | undefined ? T : never;
3
- type EmptyTypesOf<T> = T extends undefined | null | object | '' ? T : never;
4
- type NonEmptyTypesOf<T> = T extends undefined | null | object | '' ? never : T;
5
- /**
6
- * The Boolean object represents a truth value: true or false.
7
- * @param value
8
- * @constructor
9
- * Returns:boolean
10
- */
11
- export declare const Truthy: <T>(value: T) => value is TruthyTypesOf<T>;
12
- /**
13
- * The Boolean object represents an INVERSE truth value: true or false.
14
- * @param value
15
- * @constructor
16
- * Returns:boolean
17
- */
18
- export declare const Falsy: <T>(value: T) => value is FalsyTypesOf<T>;
19
- /**
20
- * Checks if a value is empty.
21
- *
22
- * @param {any} value - The value to check.
23
- * @return {boolean} Returns true if the value is empty, otherwise false.
24
- */
25
- export declare const IsEmpty: <T>(value: T) => value is EmptyTypesOf<T>;
26
- export declare const NotEmpty: <T>(value: T) => value is NonEmptyTypesOf<T>;
27
- export declare const isDefined: <T>(arg: T | null | undefined) => arg is T;
28
- export declare const isNotDefined: <T>(arg: T | null | undefined) => arg is null | undefined;
29
- export declare const isJSON: (str: string) => boolean;
30
- export declare const isEmpty: (value: any) => boolean;
31
- export declare function isAllValuesTruthy<T extends string, K>(value: Record<T, K>): boolean;
32
- export {};
@@ -1,15 +0,0 @@
1
- import type { SchedulerLike } from 'rxjs';
2
- import { Observable } from 'rxjs';
3
- /**
4
- * Emits the most recent value emitted by the source Observable after a
5
- * specified time span has passed without another source emission.
6
- *
7
- * This is a combination of `debounceTime` and `auditTime` operators.
8
- *
9
- * The leading value is emitted immediately, and trailing values are debounced.
10
- *
11
- * @param dueTime The time to wait before emitting the last value.
12
- * @param scheduler The scheduler to use for the timeout.
13
- * @returns A function that returns an Observable that mirrors the source Observable, but applies the specified debouncing.
14
- */
15
- export declare function leadingTrailingDebounceTime<T>(dueTime: number, scheduler?: SchedulerLike): (source: Observable<T>) => Observable<T>;
@@ -1,2 +0,0 @@
1
- import type { Observable } from 'rxjs';
2
- export declare const tapLog: <T>(text: string, ...args: any) => ((source: Observable<T>) => Observable<T>);
@@ -1,8 +0,0 @@
1
- /**
2
- * Adds required number of symbols before input
3
- * @param input input string
4
- * @param size amount of total symbols
5
- * @param symbol filler
6
- * @returns string
7
- */
8
- export declare function pad(input: number | string, size: number, symbol?: string): string;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes