@ardium-pl/devkit 8.3.2

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 (82) hide show
  1. package/README.md +25 -0
  2. package/fesm2022/ardium-pl-devkit.mjs +3874 -0
  3. package/fesm2022/ardium-pl-devkit.mjs.map +1 -0
  4. package/index.d.ts +5 -0
  5. package/lib/click-outside/click-outside.directive.d.ts +14 -0
  6. package/lib/click-outside/click-outside.module.d.ts +8 -0
  7. package/lib/click-outside/index.d.ts +2 -0
  8. package/lib/coercion/array.d.ts +21 -0
  9. package/lib/coercion/boolean.d.ts +6 -0
  10. package/lib/coercion/date.d.ts +5 -0
  11. package/lib/coercion/index.d.ts +4 -0
  12. package/lib/coercion/number.d.ts +20 -0
  13. package/lib/dom-boxes/dom-boxes.d.ts +7 -0
  14. package/lib/dom-boxes/index.d.ts +1 -0
  15. package/lib/escape-html/escape-html.d.ts +1 -0
  16. package/lib/escape-html/escape-html.module.d.ts +8 -0
  17. package/lib/escape-html/escape-html.pipe.d.ts +7 -0
  18. package/lib/escape-html/index.d.ts +3 -0
  19. package/lib/file-pipes/file-pipes.defaults.d.ts +8 -0
  20. package/lib/file-pipes/file-pipes.module.d.ts +10 -0
  21. package/lib/file-pipes/fileext.pipe.d.ts +39 -0
  22. package/lib/file-pipes/filename.pipe.d.ts +38 -0
  23. package/lib/file-pipes/filesize.pipe.d.ts +50 -0
  24. package/lib/file-pipes/index.d.ts +5 -0
  25. package/lib/file-system/file-system.service.d.ts +69 -0
  26. package/lib/file-system/file-system.types.d.ts +186 -0
  27. package/lib/file-system/index.d.ts +2 -0
  28. package/lib/find-functions/find-suggestion.d.ts +3 -0
  29. package/lib/find-functions/index.d.ts +1 -0
  30. package/lib/forms/index.d.ts +1 -0
  31. package/lib/forms/track-form-control/index.d.ts +1 -0
  32. package/lib/forms/track-form-control/track-form-control.d.ts +83 -0
  33. package/lib/hold/hold.defaults.d.ts +9 -0
  34. package/lib/hold/hold.directive.d.ts +24 -0
  35. package/lib/hold/hold.module.d.ts +8 -0
  36. package/lib/hold/index.d.ts +3 -0
  37. package/lib/http-service/_types.d.ts +20 -0
  38. package/lib/http-service/_utils.d.ts +1 -0
  39. package/lib/http-service/http.service.d.ts +2574 -0
  40. package/lib/http-service/index.d.ts +1 -0
  41. package/lib/infinite-scroll/index.d.ts +3 -0
  42. package/lib/infinite-scroll/infinite-scroll.defaults.d.ts +8 -0
  43. package/lib/infinite-scroll/infinite-scroll.directive.d.ts +24 -0
  44. package/lib/infinite-scroll/infinite-scroll.module.d.ts +8 -0
  45. package/lib/keyboard/index.d.ts +2 -0
  46. package/lib/keyboard/keyboard.service.d.ts +60 -0
  47. package/lib/keyboard/keyboard.types.d.ts +13 -0
  48. package/lib/keyboard/types-internal.d.ts +20 -0
  49. package/lib/keyboard/utils.d.ts +3 -0
  50. package/lib/relative-pos/index.d.ts +1 -0
  51. package/lib/relative-pos/relative-pos.d.ts +24 -0
  52. package/lib/signals/array/array-signal.d.ts +123 -0
  53. package/lib/signals/array/index.d.ts +1 -0
  54. package/lib/signals/counter/counter-signal.d.ts +67 -0
  55. package/lib/signals/counter/index.d.ts +1 -0
  56. package/lib/signals/debounced/debounced-signal.d.ts +15 -0
  57. package/lib/signals/debounced/index.d.ts +1 -0
  58. package/lib/signals/map/index.d.ts +1 -0
  59. package/lib/signals/map/map-signal.d.ts +97 -0
  60. package/lib/signals/persistent/index.d.ts +1 -0
  61. package/lib/signals/persistent/persistent-signal.d.ts +106 -0
  62. package/lib/signals/query-param/index.d.ts +1 -0
  63. package/lib/signals/query-param/query-param-signal.d.ts +35 -0
  64. package/lib/signals/queue/index.d.ts +1 -0
  65. package/lib/signals/queue/queue-signal.d.ts +77 -0
  66. package/lib/signals/set/index.d.ts +1 -0
  67. package/lib/signals/set/set-signal.d.ts +76 -0
  68. package/lib/signals/stack/index.d.ts +1 -0
  69. package/lib/signals/stack/stack-signal.d.ts +77 -0
  70. package/lib/signals/throttled/index.d.ts +1 -0
  71. package/lib/signals/throttled/throttled-signal.d.ts +15 -0
  72. package/lib/signals/tuple/index.d.ts +1 -0
  73. package/lib/signals/tuple/tuple-signal.d.ts +60 -0
  74. package/lib/validators/index.d.ts +1 -0
  75. package/lib/validators/validators.d.ts +612 -0
  76. package/lib/viewport-observer/index.d.ts +3 -0
  77. package/lib/viewport-observer/utils.d.ts +15 -0
  78. package/lib/viewport-observer/viewport-observer-ref.d.ts +47 -0
  79. package/lib/viewport-observer/viewport-observer.defaults.d.ts +7 -0
  80. package/lib/viewport-observer/viewport-observer.service.d.ts +23 -0
  81. package/package.json +30 -0
  82. package/public-api.d.ts +26 -0
@@ -0,0 +1,77 @@
1
+ import { Signal, WritableSignal } from '@angular/core';
2
+ /**
3
+ * A read-only queue signal, providing non-mutating helpers and computed properties.
4
+ * @template T The type of elements held in the queue.
5
+ */
6
+ export interface QueueSignal<T> extends Signal<T[]> {
7
+ /**
8
+ * A signal that returns `true` if the queue is empty.
9
+ */
10
+ readonly isEmpty: Signal<boolean>;
11
+ /**
12
+ * A signal that returns the current number of items in the queue.
13
+ */
14
+ readonly size: Signal<number>;
15
+ /**
16
+ * A signal that returns the front (first) item of the queue, or `undefined` if the queue is empty. Does not remove it.
17
+ */
18
+ readonly front: Signal<T | undefined>;
19
+ /**
20
+ * A signal that returns a shallow copy of the queue as an array.
21
+ */
22
+ readonly asArray: Signal<T[]>;
23
+ /**
24
+ * Returns the front item in the queue, or `undefined` if the queue is empty. Does not remove it.
25
+ * @returns The front item or `undefined`.
26
+ */
27
+ peek(): T | undefined;
28
+ }
29
+ /**
30
+ * A writable queue signal, providing mutating and non-mutating helpers.
31
+ * @template T The type of elements held in the queue.
32
+ */
33
+ export interface WritableQueueSignal<T> extends WritableSignal<T[]>, QueueSignal<T> {
34
+ /**
35
+ * Returns a read-only version of the queue signal.
36
+ * @returns A read-only {@link QueueSignal} instance.
37
+ */
38
+ asReadonly(): QueueSignal<T>;
39
+ /**
40
+ * Adds one or more items to the end of the queue.
41
+ * @param items - The elements to enqueue.
42
+ */
43
+ enqueue(...items: T[]): void;
44
+ /**
45
+ * Removes and returns the front item of the queue. If the queue is empty, returns `undefined`.
46
+ * @returns The dequeued item, or `undefined` if the queue was empty.
47
+ */
48
+ dequeue(): T | undefined;
49
+ /**
50
+ * Clears all items from the queue.
51
+ */
52
+ clear(): void;
53
+ /**
54
+ * Replaces the queue with a new array of items.
55
+ * @param value - The new array to set as the queue.
56
+ */
57
+ set(value: T[]): void;
58
+ /**
59
+ * Updates the queue using the provided update function.
60
+ * @param updateFn - Function that receives the current queue and returns a new queue.
61
+ */
62
+ update(updateFn: (current: T[]) => T[]): void;
63
+ }
64
+ /**
65
+ * Creates a writable queue signal, which is a reactive queue data structure.
66
+ *
67
+ * @template T The type of elements held in the queue.
68
+ * @param {T[]} [initialValue=[]] Optional initial items in the queue.
69
+ * @returns {WritableQueueSignal<T>} The writable queue signal instance.
70
+ *
71
+ * @example
72
+ * const queue = queueSignal<number>([1, 2, 3]);
73
+ * queue.enqueue(4); // new value: [1, 2, 3, 4]
74
+ * const value = queue.dequeue(); // 1 new value: [2, 3, 4]
75
+ * queue.clear(); // new value: []
76
+ */
77
+ export declare function queueSignal<T>(initialValue?: T[]): WritableQueueSignal<T>;
@@ -0,0 +1 @@
1
+ export * from './set-signal';
@@ -0,0 +1,76 @@
1
+ import { Signal, WritableSignal } from '@angular/core';
2
+ /**
3
+ * A read-only set signal with non-mutating methods.
4
+ */
5
+ export interface SetSignal<T> extends Signal<Set<T>> {
6
+ /**
7
+ * Computed signal that returns `true` if the set is empty.
8
+ */
9
+ readonly isEmpty: Signal<boolean>;
10
+ /**
11
+ * Computed signal for set size.
12
+ */
13
+ readonly size: Signal<number>;
14
+ /**
15
+ * Checks if a value exists in the set.
16
+ */
17
+ has(value: T): boolean;
18
+ /**
19
+ * Computed signal that returns a new array from the set.
20
+ */
21
+ readonly asArray: Signal<T[]>;
22
+ }
23
+ /**
24
+ * A writable set signal with mutating and non-mutating methods.
25
+ */
26
+ export interface WritableSetSignal<T> extends WritableSignal<Set<T>>, SetSignal<T> {
27
+ /**
28
+ * Returns a read-only version of the set signal.
29
+ */
30
+ asReadonly(): SetSignal<T>;
31
+ /**
32
+ * Adds a value to the set.
33
+ */
34
+ add(value: T): void;
35
+ /**
36
+ * Deletes a value from the set.
37
+ * Returns true if a value was removed.
38
+ */
39
+ delete(value: T): boolean;
40
+ /**
41
+ * Clears the set.
42
+ */
43
+ clear(): void;
44
+ /**
45
+ * Replaces the set with a new set.
46
+ */
47
+ set(value: Set<T>): void;
48
+ /**
49
+ * Updates the set using an update function.
50
+ */
51
+ update(updateFn: (current: Set<T>) => Set<T>): void;
52
+ }
53
+ /**
54
+ * Creates a writable, reactive Set signal with convenient, immutable Set manipulation methods.
55
+ *
56
+ * This function returns a signal that wraps a JavaScript `Set` and exposes both non-mutating and mutating helpers,
57
+ * ensuring that all operations are fully reactive and immutably safe. All mutator methods (`add`, `delete`, `clear`, etc.)
58
+ * return a new Set value for robust signal reactivity.
59
+ *
60
+ * Also provides computed signals for queries such as `isEmpty`, `size`, and `asArray`, and offers a type-safe, read-only
61
+ * view via `.asReadonly()`.
62
+ *
63
+ * @template T The type of items stored in the set.
64
+ * @param {Iterable<T>} [initialValue=[]] Optional initial values for the set (can be another Set or any iterable).
65
+ * @returns {WritableSetSignal<T>} A writable Set signal instance with both native and Set-specific helpers.
66
+ *
67
+ * @example
68
+ * const ids = setSignal<number>([1, 2, 3]);
69
+ * ids.add(4); // [1, 2, 3, 4]
70
+ * ids.delete(2); // removes 2
71
+ * ids.has(3); // true
72
+ * ids.asArray(); // [1, 3, 4]
73
+ * ids.clear(); // empty set
74
+ * ids.isEmpty(); // true
75
+ */
76
+ export declare function setSignal<T>(initialValue?: Iterable<T>): WritableSetSignal<T>;
@@ -0,0 +1 @@
1
+ export * from './stack-signal';
@@ -0,0 +1,77 @@
1
+ import { Signal, WritableSignal } from '@angular/core';
2
+ /**
3
+ * A read-only stack signal, providing non-mutating helpers and computed properties.
4
+ * @template T The type of elements held in the stack.
5
+ */
6
+ export interface StackSignal<T> extends Signal<T[]> {
7
+ /**
8
+ * A signal that returns `true` if the stack is empty.
9
+ */
10
+ readonly isEmpty: Signal<boolean>;
11
+ /**
12
+ * A signal that returns the current number of items in the stack.
13
+ */
14
+ readonly size: Signal<number>;
15
+ /**
16
+ * A signal that returns the top (last) item of the stack, or `undefined` if the stack is empty. Does not remove it.
17
+ */
18
+ readonly top: Signal<T | undefined>;
19
+ /**
20
+ * A signal that returns a shallow copy of the stack as an array.
21
+ */
22
+ readonly asArray: Signal<T[]>;
23
+ /**
24
+ * Returns the top item in the stack, or `undefined` if the stack is empty. Does not remove it.
25
+ * @returns The top item or `undefined`.
26
+ */
27
+ peek(): T | undefined;
28
+ }
29
+ /**
30
+ * A writable stack signal, providing mutating and non-mutating helpers.
31
+ * @template T The type of elements held in the stack.
32
+ */
33
+ export interface WritableStackSignal<T> extends WritableSignal<T[]>, StackSignal<T> {
34
+ /**
35
+ * Returns a read-only version of the stack signal.
36
+ * @returns A read-only {@link StackSignal} instance.
37
+ */
38
+ asReadonly(): StackSignal<T>;
39
+ /**
40
+ * Pushes one or more items onto the top of the stack.
41
+ * @param items - The elements to push onto the stack.
42
+ */
43
+ push(...items: T[]): void;
44
+ /**
45
+ * Removes and returns the top item of the stack. If the stack is empty, returns `undefined`.
46
+ * @returns The popped item, or `undefined` if the stack was empty.
47
+ */
48
+ pop(): T | undefined;
49
+ /**
50
+ * Clears all items from the stack.
51
+ */
52
+ clear(): void;
53
+ /**
54
+ * Replaces the stack with a new array of items.
55
+ * @param value - The new array to set as the stack.
56
+ */
57
+ set(value: T[]): void;
58
+ /**
59
+ * Updates the stack using the provided update function.
60
+ * @param updateFn - Function that receives the current stack and returns a new stack.
61
+ */
62
+ update(updateFn: (current: T[]) => T[]): void;
63
+ }
64
+ /**
65
+ * Creates a writable stack signal, which is a reactive stack data structure.
66
+ *
67
+ * @template T The type of elements held in the stack.
68
+ * @param {T[]} [initialValue=[]] Optional initial items in the stack.
69
+ * @returns {WritableStackSignal<T>} The writable stack signal instance.
70
+ *
71
+ * @example
72
+ * const stack = stackSignal<number>([1, 2, 3]);
73
+ * stack.push(4); // [1, 2, 3, 4]
74
+ * const value = stack.pop(); // 4 [1, 2, 3]
75
+ * stack.clear(); // []
76
+ */
77
+ export declare function stackSignal<T>(initialValue?: T[]): WritableStackSignal<T>;
@@ -0,0 +1 @@
1
+ export * from './throttled-signal';
@@ -0,0 +1,15 @@
1
+ import { WritableSignal } from '@angular/core';
2
+ /**
3
+ * A ThrottledSignal interface that extends WritableSignal<T> and includes throttling behavior.
4
+ */
5
+ export interface ThrottledSignal<T> extends WritableSignal<T> {
6
+ readonly throttleTime: number;
7
+ }
8
+ /**
9
+ * Creates a `WritableSignal` that limits how often its value can be updated, using the throttle time specified.
10
+ *
11
+ * @param initialValue - The initial value of the signal.
12
+ * @param throttleTime - The minimum delay in milliseconds between signal updates.
13
+ * @returns A `WritableSignal<T>` that throttles value updates based on the specified throttle time.
14
+ */
15
+ export declare function throttledSignal<T>(initialValue: T, throttleTime: number): ThrottledSignal<T>;
@@ -0,0 +1 @@
1
+ export * from './tuple-signal';
@@ -0,0 +1,60 @@
1
+ import { Signal, WritableSignal } from '@angular/core';
2
+ /**
3
+ * A read-only tuple signal.
4
+ */
5
+ export interface TupleSignal<T extends readonly unknown[]> extends Signal<T> {
6
+ /**
7
+ * Computed signal that returns an array of tuple entries [index, value].
8
+ */
9
+ readonly entriesArray: Signal<{
10
+ [K in keyof T]: [K, T[K]];
11
+ }[number][]>;
12
+ /**
13
+ * Returns the value at a given index.
14
+ */
15
+ getAt<I extends keyof T>(index: I): T[I];
16
+ }
17
+ /**
18
+ * A writable tuple signal.
19
+ */
20
+ export interface WritableTupleSignal<T extends readonly unknown[]> extends WritableSignal<T>, TupleSignal<T> {
21
+ /**
22
+ * Returns a read-only version of the tuple signal.
23
+ */
24
+ asReadonly(): TupleSignal<T>;
25
+ /**
26
+ * Sets the value at a given index.
27
+ */
28
+ setAt<I extends keyof T>(index: I, value: T[I]): void;
29
+ /**
30
+ * Updates the entire tuple with a function.
31
+ */
32
+ update(updateFn: (current: T) => T): void;
33
+ /**
34
+ * Updates the value at a given index with a function.
35
+ */
36
+ updateAt<I extends keyof T>(index: I, updateFn: (value: T[I]) => T[I]): void;
37
+ }
38
+ /**
39
+ * Creates a writable, reactive tuple signal of **fixed length**, with tuple-specific and array-like helpers.
40
+ *
41
+ * This function returns a signal wrapping a tuple (fixed-length array), exposing safe, type-aware mutation and update helpers
42
+ * as well as computed signals for common tuple queries.
43
+ *
44
+ * All mutating methods (`set`, `setAt`, `updateAt`, `update`) return a new tuple value,
45
+ * preserving immutability and optimal signal reactivity.
46
+ *
47
+ * Also provides `.asReadonly()` for read-only consumption and computed signals for empty/entries.
48
+ *
49
+ * @template T The tuple type (e.g. `[number, string, boolean]`).
50
+ * @param {T} initialValue The initial tuple value.
51
+ * @returns {WritableTupleSignal<T>} A writable tuple signal with all mutation, query, and computed helpers.
52
+ *
53
+ * @example
54
+ * const point = tupleSignal<[number, number]>([0, 1]);
55
+ * point.setAt(1, 99); // [0, 99]
56
+ * point.updateAt(0, x => x+10);// [10, 99]
57
+ * point(); // [10, 99]
58
+ * point.entriesArray(); // [[0, 10], [1, 99]]
59
+ */
60
+ export declare function tupleSignal<T extends readonly unknown[]>(initialValue: T): WritableTupleSignal<T>;
@@ -0,0 +1 @@
1
+ export * from './validators';