types: fix translate typing
This commit is contained in:
@@ -8,7 +8,7 @@ export function useTranslate(i18n: Record<string, any>) {
|
||||
const demoName = `demo-i18n-${demoUid++}`;
|
||||
|
||||
if (i18n) {
|
||||
const locales = {};
|
||||
const locales: Record<string, any> = {};
|
||||
const camelizedName = camelize(demoName);
|
||||
|
||||
Object.keys(i18n).forEach((key) => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import locale from '../../locale';
|
||||
export function createTranslate(name: string) {
|
||||
const prefix = camelize(name) + '.';
|
||||
|
||||
return function (path: string, ...args: any[]): string {
|
||||
return function (path: string, ...args: any[]): any {
|
||||
const messages = locale.messages();
|
||||
const message = get(messages, prefix + path) || get(messages, path);
|
||||
|
||||
|
||||
@@ -9,15 +9,11 @@
|
||||
"noEmit": true,
|
||||
"noImplicitThis": true,
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node"
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@demo/*": ["docs/site/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"types/**/*",
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.spec.js",
|
||||
"node_modules"
|
||||
]
|
||||
"include": ["types/**/*", "docs/**/*", "src/**/*"],
|
||||
"exclude": ["**/*.spec.ts", "**/*.spec.js", "node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user