@purr-core/utils.definitions 0.0.11 → 0.0.12
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/dist/index.cjs +1 -0
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +0 -0
- package/package.json +1 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A type alias for `any`. This type can represent any value.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Use this type with caution as it disables type checking for the value it is assigned to.
|
|
6
|
+
*/
|
|
7
|
+
type TAny = any;
|
|
8
|
+
/**
|
|
9
|
+
* A type representing a function that iterates over an array.
|
|
10
|
+
*
|
|
11
|
+
* @template T - The type of elements in the array.
|
|
12
|
+
* @param value - The current element being processed in the array.
|
|
13
|
+
* @param index - The index of the current element being processed in the array.
|
|
14
|
+
* @param array - The array that `TIterator` is iterating over.
|
|
15
|
+
* @returns An unknown value.
|
|
16
|
+
*/
|
|
17
|
+
type TIterator = <T>(value: T, index?: number, array?: T[]) => unknown;
|
|
18
|
+
/**
|
|
19
|
+
* Represents the boundary of an asynchronous operation, encapsulating both the result and any potential error.
|
|
20
|
+
*
|
|
21
|
+
* @template T - The type of the result.
|
|
22
|
+
* @property {unknown | null} error - The error encountered during the asynchronous operation, if any.
|
|
23
|
+
* @property {T | null} result - The result of the asynchronous operation, if successful.
|
|
24
|
+
*/
|
|
25
|
+
type TAsyncBoundary<T> = {
|
|
26
|
+
error: unknown | null;
|
|
27
|
+
result: Awaited<T> | null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Represents an extendable object where keys are strings and values can be of any type.
|
|
32
|
+
*
|
|
33
|
+
* @interface IExtendable
|
|
34
|
+
* @template TAny - The type of the values in the extendable object.
|
|
35
|
+
*/
|
|
36
|
+
interface IExtendable {
|
|
37
|
+
[key: string]: TAny;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type { IExtendable, TAny, TAsyncBoundary, TIterator };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A type alias for `any`. This type can represent any value.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Use this type with caution as it disables type checking for the value it is assigned to.
|
|
6
|
+
*/
|
|
7
|
+
type TAny = any;
|
|
8
|
+
/**
|
|
9
|
+
* A type representing a function that iterates over an array.
|
|
10
|
+
*
|
|
11
|
+
* @template T - The type of elements in the array.
|
|
12
|
+
* @param value - The current element being processed in the array.
|
|
13
|
+
* @param index - The index of the current element being processed in the array.
|
|
14
|
+
* @param array - The array that `TIterator` is iterating over.
|
|
15
|
+
* @returns An unknown value.
|
|
16
|
+
*/
|
|
17
|
+
type TIterator = <T>(value: T, index?: number, array?: T[]) => unknown;
|
|
18
|
+
/**
|
|
19
|
+
* Represents the boundary of an asynchronous operation, encapsulating both the result and any potential error.
|
|
20
|
+
*
|
|
21
|
+
* @template T - The type of the result.
|
|
22
|
+
* @property {unknown | null} error - The error encountered during the asynchronous operation, if any.
|
|
23
|
+
* @property {T | null} result - The result of the asynchronous operation, if successful.
|
|
24
|
+
*/
|
|
25
|
+
type TAsyncBoundary<T> = {
|
|
26
|
+
error: unknown | null;
|
|
27
|
+
result: Awaited<T> | null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Represents an extendable object where keys are strings and values can be of any type.
|
|
32
|
+
*
|
|
33
|
+
* @interface IExtendable
|
|
34
|
+
* @template TAny - The type of the values in the extendable object.
|
|
35
|
+
*/
|
|
36
|
+
interface IExtendable {
|
|
37
|
+
[key: string]: TAny;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type { IExtendable, TAny, TAsyncBoundary, TIterator };
|
package/dist/index.js
ADDED
|
File without changes
|