intor-translator 1.1.0 → 1.1.2
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/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -396,7 +396,7 @@ declare class CoreTranslator<M = unknown, L extends keyof M | "union" = "union">
|
|
|
396
396
|
setLoading(state: boolean): void;
|
|
397
397
|
/** Check if a key exists in the specified locale or current locale. */
|
|
398
398
|
hasKey: <K = LocalizedLeafKeys<M, L>>(key: K, targetLocale?: Locale<M>) => boolean;
|
|
399
|
-
t: <Result = string,
|
|
399
|
+
t: <Result = string, K = LocalizedLeafKeys<M, L>>(key: K, replacements?: Replacement) => Result;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
type ScopeTranslatorOptions<M> = CoreTranslatorOptions<M>;
|
|
@@ -410,4 +410,4 @@ declare class ScopeTranslator<M = unknown, L extends keyof M | "union" = "union"
|
|
|
410
410
|
scoped<PK extends LocalizedNodeKeys<M, L> | undefined = undefined>(preKey?: PK): PK extends string ? ScopeTranslatorMethods<M, L, ScopedLeafKeys<M, PK, L>> : ScopeTranslatorMethods<M, L>;
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
export { type FallbackLocalesMap, type FormatHandler, type IsLoadingRef, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocaleRef, type LocalizedLeafKeys, type LocalizedMessagesUnion, type MessagesRef, type MissingHandler, type NestedMessage, type NodeKeys, type Replacement, ScopeTranslator, type ScopeTranslatorMethods, type ScopeTranslatorOptions, type ScopedLeafKeys, type TranslateHandlerContext, type TranslateHandlers, ScopeTranslator as Translator };
|
|
413
|
+
export { type FallbackLocalesMap, type FormatHandler, type IsLoadingRef, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocaleRef, type LocalizedLeafKeys, type LocalizedMessagesUnion, type LocalizedNodeKeys, type MessagesRef, type MissingHandler, type NestedMessage, type NodeKeys, type Replacement, ScopeTranslator, type ScopeTranslatorMethods, type ScopeTranslatorOptions, type ScopedLeafKeys, type TranslateHandlerContext, type TranslateHandlers, ScopeTranslator as Translator };
|
package/dist/index.d.ts
CHANGED
|
@@ -396,7 +396,7 @@ declare class CoreTranslator<M = unknown, L extends keyof M | "union" = "union">
|
|
|
396
396
|
setLoading(state: boolean): void;
|
|
397
397
|
/** Check if a key exists in the specified locale or current locale. */
|
|
398
398
|
hasKey: <K = LocalizedLeafKeys<M, L>>(key: K, targetLocale?: Locale<M>) => boolean;
|
|
399
|
-
t: <Result = string,
|
|
399
|
+
t: <Result = string, K = LocalizedLeafKeys<M, L>>(key: K, replacements?: Replacement) => Result;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
type ScopeTranslatorOptions<M> = CoreTranslatorOptions<M>;
|
|
@@ -410,4 +410,4 @@ declare class ScopeTranslator<M = unknown, L extends keyof M | "union" = "union"
|
|
|
410
410
|
scoped<PK extends LocalizedNodeKeys<M, L> | undefined = undefined>(preKey?: PK): PK extends string ? ScopeTranslatorMethods<M, L, ScopedLeafKeys<M, PK, L>> : ScopeTranslatorMethods<M, L>;
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
export { type FallbackLocalesMap, type FormatHandler, type IsLoadingRef, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocaleRef, type LocalizedLeafKeys, type LocalizedMessagesUnion, type MessagesRef, type MissingHandler, type NestedMessage, type NodeKeys, type Replacement, ScopeTranslator, type ScopeTranslatorMethods, type ScopeTranslatorOptions, type ScopedLeafKeys, type TranslateHandlerContext, type TranslateHandlers, ScopeTranslator as Translator };
|
|
413
|
+
export { type FallbackLocalesMap, type FormatHandler, type IsLoadingRef, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocaleRef, type LocalizedLeafKeys, type LocalizedMessagesUnion, type LocalizedNodeKeys, type MessagesRef, type MissingHandler, type NestedMessage, type NodeKeys, type Replacement, ScopeTranslator, type ScopeTranslatorMethods, type ScopeTranslatorOptions, type ScopedLeafKeys, type TranslateHandlerContext, type TranslateHandlers, ScopeTranslator as Translator };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intor-translator",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "A type safe translator that knows what to say and how to handle the rest. Supports custom messages, rich replacements, and async loading.",
|
|
5
5
|
"author": "Yiming Liao",
|
|
6
6
|
"license": "MIT",
|