vona-core 5.0.75 → 5.0.77
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ILocaleRecord } from './type.ts';
|
|
2
2
|
import { BeanSimple } from '../../beanSimple.ts';
|
|
3
3
|
export declare class AppLocale extends BeanSimple {
|
|
4
|
-
get current(): keyof
|
|
5
|
-
set current(value: keyof
|
|
6
|
-
getText<T extends keyof
|
|
4
|
+
get current(): keyof ILocaleRecord;
|
|
5
|
+
set current(value: keyof ILocaleRecord);
|
|
6
|
+
getText<T extends keyof ILocaleRecord>(supportCustomMessage: boolean, moduleScope: string | undefined, locale: T | undefined, key: string, ...args: any[]): string;
|
|
7
7
|
}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
export declare const LocaleModuleNameSeparator = "::";
|
|
2
2
|
export interface IModuleLocale {
|
|
3
3
|
(...args: any[]): string;
|
|
4
|
-
locale: <T extends keyof
|
|
4
|
+
locale: <T extends keyof ILocaleRecord>(locale: T, ...args: any[]) => string;
|
|
5
5
|
}
|
|
6
6
|
export interface IModuleLocaleText {
|
|
7
7
|
(text: string, ...args: any[]): string;
|
|
8
|
-
locale: <T extends keyof
|
|
8
|
+
locale: <T extends keyof ILocaleRecord>(locale: T, text: string, ...args: any[]) => string;
|
|
9
9
|
}
|
|
10
10
|
export type TypeModuleLocales<T> = {
|
|
11
11
|
[prop in keyof T]: IModuleLocale;
|
|
12
12
|
};
|
|
13
13
|
export type TypeLocaleBase = 'en-us';
|
|
14
|
-
export interface
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'en-us': ILocaleInfo;
|
|
18
|
-
'zh-cn': ILocaleInfo;
|
|
14
|
+
export interface ILocaleRecord {
|
|
15
|
+
'en-us': never;
|
|
16
|
+
'zh-cn': never;
|
|
19
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ILocaleRecord } from '../bean/resource/locale/type.ts';
|
|
2
2
|
export interface ICustomKeyRecord {
|
|
3
|
-
'x-vona-locale': keyof
|
|
3
|
+
'x-vona-locale': keyof ILocaleRecord | undefined;
|
|
4
4
|
'x-vona-instance-name': string | undefined;
|
|
5
5
|
'x-vona-passport-code': string | undefined;
|
|
6
6
|
'x-vona-oauth-code': string | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type z from 'zod';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ILocaleRecord } from '../bean/resource/locale/type.ts';
|
|
3
3
|
import type { VonaApplication } from '../core/application.ts';
|
|
4
4
|
export type ZodLocaleError = () => {
|
|
5
5
|
localeError: z.core.$ZodErrorMap;
|
|
6
6
|
};
|
|
7
|
-
export type ZodLocaleErrors = Record<keyof
|
|
7
|
+
export type ZodLocaleErrors = Record<keyof ILocaleRecord, ZodLocaleError>;
|
|
8
8
|
export declare function zodEnhance(app: VonaApplication): void;
|
|
9
9
|
export declare function zodSetLocaleErrors(app: VonaApplication, localeErrors: ZodLocaleErrors, localeDefault?: string): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { BeanContainer, Constructable,
|
|
1
|
+
import type { BeanContainer, Constructable, ILocaleRecord, MetadataKey } from '../../lib/index.ts';
|
|
2
2
|
import type { VonaConfig } from '../config/config.ts';
|
|
3
3
|
import type { IInstanceRecord } from '../config/instance.ts';
|
|
4
4
|
import type { VonaContext } from './index.ts';
|
|
5
5
|
export interface ContextBase {
|
|
6
6
|
get bean(): BeanContainer;
|
|
7
|
-
get locale(): keyof
|
|
8
|
-
set locale(value: keyof
|
|
7
|
+
get locale(): keyof ILocaleRecord;
|
|
8
|
+
set locale(value: keyof ILocaleRecord);
|
|
9
9
|
get instanceName(): keyof IInstanceRecord | undefined | null;
|
|
10
10
|
set instanceName(value: keyof IInstanceRecord | undefined | null);
|
|
11
11
|
get config(): VonaConfig;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.77",
|
|
5
5
|
"description": "vona",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@cabloy/word-utils": "^2.0.1",
|
|
37
37
|
"@cabloy/zod-errors-custom": "^2.0.3",
|
|
38
38
|
"@cabloy/zod-openapi": "^1.0.3",
|
|
39
|
-
"@cabloy/zod-query": "^2.0.
|
|
39
|
+
"@cabloy/zod-query": "^2.0.3",
|
|
40
40
|
"@cabloy/zod-to-openapi": "^8.1.4",
|
|
41
41
|
"chalk": "^5.3.0",
|
|
42
42
|
"fs-extra": "^10.1.0",
|