vona-core 5.0.75 → 5.0.76

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 { ILocaleInfos } from './type.ts';
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 ILocaleInfos;
5
- set current(value: keyof ILocaleInfos);
6
- getText<T extends keyof ILocaleInfos>(supportCustomMessage: boolean, moduleScope: string | undefined, locale: T | undefined, key: string, ...args: any[]): string;
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 ILocaleInfos>(locale: T, ...args: any[]) => string;
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 ILocaleInfos>(locale: T, text: string, ...args: any[]) => string;
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 ILocaleInfo {
15
- }
16
- export interface ILocaleInfos {
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 { ILocaleInfos } from '../bean/resource/locale/type.ts';
1
+ import type { ILocaleRecord } from '../bean/resource/locale/type.ts';
2
2
  export interface ICustomKeyRecord {
3
- 'x-vona-locale': keyof ILocaleInfos | undefined;
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 { ILocaleInfos } from '../bean/resource/locale/type.ts';
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 ILocaleInfos, ZodLocaleError>;
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, ILocaleInfos, MetadataKey } from '../../lib/index.ts';
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 ILocaleInfos;
8
- set locale(value: keyof ILocaleInfos);
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.75",
4
+ "version": "5.0.76",
5
5
  "description": "vona",
6
6
  "publishConfig": {
7
7
  "access": "public"