From 683878924aaeac74c20f8fc2248544a8a3230315 Mon Sep 17 00:00:00 2001 From: jingyang <3161362058@qq.com> Date: Tue, 16 Jul 2024 18:44:33 +0800 Subject: [PATCH] fix i18next.d.ts --- projects/app/src/types/i18next.d.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/projects/app/src/types/i18next.d.ts b/projects/app/src/types/i18next.d.ts index 1160020d145..0ea871ccf2b 100644 --- a/projects/app/src/types/i18next.d.ts +++ b/projects/app/src/types/i18next.d.ts @@ -21,21 +21,18 @@ export interface I18nNamespaces { export type I18nNsType = (keyof I18nNamespaces)[]; -const defaultNS: I18nNsType = [ - 'common', - 'dataset', - 'app', - 'file', - 'publish', - 'workflow', - 'user', - 'chat' -]; +export type I18nCommonKey = keyof I18nNamespaces['common']; +export type I18nDataSetKey = keyof I18nNamespaces['dataset']; +export type I18nAppKey = keyof I18nNamespaces['app']; +export type I18nPublishKey = keyof I18nNamespaces['publish']; +export type I18nWorkflowKey = keyof I18nNamespaces['workflow']; +export type I18nUserKey = keyof I18nNamespaces['user']; +export type I18nChatKey = keyof I18nNamespaces['chat']; declare module 'i18next' { interface CustomTypeOptions { returnNull: false; - defaultNS: defaultNS; + defaultNS: ['common', 'dataset', 'app', 'file', 'publish', 'workflow', 'user', 'chat']; resources: I18nNamespaces; } }