@mic-rexjs/usecases-react 2.6.0 → 2.6.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.
|
@@ -28,9 +28,11 @@ export interface EntityWatchEvent<T, TValue = unknown> {
|
|
|
28
28
|
export interface EntityWatcher<T, TValue = unknown> {
|
|
29
29
|
(event: EntityWatchEvent<T, TValue>): void;
|
|
30
30
|
}
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
31
|
+
export type PathTemplate = '1.2.3.4.5.6';
|
|
32
|
+
export type NextPathTemplate<T extends string> = T extends `${string}.${infer U}` ? U : T;
|
|
33
|
+
export type PropertyPath<T, TTemplate extends string, K extends keyof T = keyof T & string> = TTemplate extends `${string}.${string}` ? K extends infer TKey ? `${TKey & (string | number)}${'' | DotAccessorFieldPath<T[TKey & keyof T], TTemplate>}` : never : never;
|
|
34
|
+
export type DotAccessorFieldPath<T, TTemplate extends string> = TTemplate extends `${string}.${string}` ? T extends unknown[] ? '.length' | `${'' | `.${number}`}${DotAccessorFieldPath<T[number], NextPathTemplate<TTemplate>>}` : T extends object ? `.${PropertyPath<T, NextPathTemplate<TTemplate>>}` : '' : '';
|
|
35
|
+
export type FieldPath<T, TTemplate extends string = PathTemplate> = TTemplate extends `${string}.${string}` ? T extends unknown[] ? FieldPath<T[number], NextPathTemplate<TTemplate>> | 'length' : T extends object ? PropertyPath<T, TTemplate> : never : never;
|
|
34
36
|
export type ExtractPropertyType<T, TPath> = TPath extends `${infer TKey}.${infer TSubPath}` ? T extends unknown[] ? ExtractPropertyType<T[number], TKey extends `${number}` ? TSubPath : TPath> : ExtractPropertyType<T[TKey & keyof T], TSubPath> : T extends unknown[] ? TPath extends 'length' ? T[TPath] : TPath extends `${number}` ? T[number] : ExtractPropertyType<T[number], TPath> : T[TPath & keyof T];
|
|
35
37
|
export type ExtractFieldType<T, TPath> = TPath extends `${infer TKey}.${infer TSubProperty}` ? ExtractPropertyType<T[TKey & keyof T], TSubProperty> : T[TPath & keyof T];
|
|
36
38
|
export type EntityWatchMap<T> = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mic-rexjs/usecases-react",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "React-based solution for use usecases of Clean Architecture",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@commitlint/cli": "^19.0.3",
|
|
50
50
|
"@commitlint/config-angular": "^19.0.3",
|
|
51
51
|
"@jest/globals": "^29.5.0",
|
|
52
|
-
"@mic-rexjs/usecases": "^2.
|
|
52
|
+
"@mic-rexjs/usecases": "^2.11.2",
|
|
53
53
|
"@testing-library/react": "^14.0.0",
|
|
54
54
|
"@types/node": "^20.4.2",
|
|
55
55
|
"@types/react": "^18.2.14",
|