@akanjs/dictionary 0.0.143 → 0.0.144
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/package.json +1 -1
- package/src/trans.d.ts +5 -4
package/package.json
CHANGED
package/src/trans.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Prettify } from "@akanjs/base";
|
|
1
2
|
import { type BaseFilterKey, type GetActionObject, type GetStateObject } from "@akanjs/constant";
|
|
2
3
|
import { DefaultSignal } from "@akanjs/signal";
|
|
3
4
|
type TranslationSingle = readonly [string, string] | readonly [string, string, string, string];
|
|
@@ -19,7 +20,7 @@ export type ExtendModelDictionary<Model, Insight = unknown, Filter = unknown> =
|
|
|
19
20
|
} & {
|
|
20
21
|
[key: string]: Translation;
|
|
21
22
|
};
|
|
22
|
-
export type ModelDictionary<Model, Insight = unknown, Filter = unknown> = {
|
|
23
|
+
export type ModelDictionary<Model, Insight = unknown, Filter = unknown> = Prettify<{
|
|
23
24
|
[K in keyof GetStateObject<Model & Insight & Filter> as K extends string ? K | `desc-${K}` : never]: Translation;
|
|
24
25
|
} & {
|
|
25
26
|
[K in keyof GetActionObject<Filter> as K extends string ? `qry-${K}` | `qrydesc-${K}` : never]: Translation;
|
|
@@ -28,17 +29,17 @@ export type ModelDictionary<Model, Insight = unknown, Filter = unknown> = {
|
|
|
28
29
|
} & {
|
|
29
30
|
modelName: Translation;
|
|
30
31
|
modelDesc: Translation;
|
|
31
|
-
}
|
|
32
|
+
}>;
|
|
32
33
|
export type SummaryDictionary<Summary> = {
|
|
33
34
|
[K in keyof GetStateObject<Summary> as K extends string ? K | `desc-${K}` : never]: Translation;
|
|
34
35
|
};
|
|
35
|
-
export type SignalDictionary<Checker, Model = unknown> = {
|
|
36
|
+
export type SignalDictionary<Checker, Model = unknown> = Prettify<{
|
|
36
37
|
[K in keyof GetActionObject<Checker> as K extends string ? K extends keyof Model ? never : Checker[K] extends (...args: any) => Promise<{
|
|
37
38
|
__Returns__: "Done";
|
|
38
39
|
}> ? never : `apidesc-${K}` | `api-${K}` : never]: Translation;
|
|
39
40
|
} & {
|
|
40
41
|
[key: string]: Translation;
|
|
41
|
-
}
|
|
42
|
+
}>;
|
|
42
43
|
export type GetKeys<O> = O extends infer U ? (U extends object ? keyof U : never) : never;
|
|
43
44
|
export type TransMessage<Locale extends Record<string, any>> = Locale extends infer U ? U extends object ? {
|
|
44
45
|
[K in keyof U]-?: `${K & string}${U[K] extends Record<string, any> ? `.${GetKeys<U[K]>}` : never}`;
|