@@ -6,7 +6,11 @@ import {
66 Signal ,
77 untracked ,
88} from '@angular/core' ;
9- import { CompiledTranslation , inferCompiledTranslationMap } from './compile' ;
9+ import {
10+ CompiledTranslation ,
11+ inferCompiledTranslationMap ,
12+ inferCompiledTranslationNamespace ,
13+ } from './compile' ;
1014import { replaceWithDelim } from './delim' ;
1115import { UnknownStringKeyObject } from './string-key-object.type' ;
1216import { TranslationStore } from './translation-store' ;
@@ -102,10 +106,18 @@ export function createT<TMap extends AnyStringRecord>(
102106
103107export function registerNamespace <
104108 TDefault extends CompiledTranslation < UnknownStringKeyObject , string > ,
105- TOther extends CompiledTranslation < UnknownStringKeyObject , string > ,
106109> (
107110 defaultTranslation : ( ) => Promise < TDefault > ,
108- other : Record < string , ( ) => Promise < TOther > > ,
111+ other : Record <
112+ string ,
113+ ( ) => Promise <
114+ CompiledTranslation <
115+ UnknownStringKeyObject ,
116+ inferCompiledTranslationNamespace < TDefault > ,
117+ string
118+ >
119+ >
120+ > ,
109121) {
110122 type $Map = inferCompiledTranslationMap < TDefault > ;
111123 type $BaseTFN = TFunction < $Map > ;
@@ -121,7 +133,7 @@ export function registerNamespace<
121133 const resolver = async ( ) => {
122134 const store = inject ( TranslationStore ) ;
123135 const locale = untracked ( store . locale ) ;
124- const tPromise = other [ locale ] as ( ( ) => Promise < TOther > ) | undefined ;
136+ const tPromise = other [ locale ] as ( typeof other ) [ string ] | undefined ;
125137
126138 const promise = tPromise ?? defaultTranslation ;
127139 if ( ! promise && isDevMode ( ) ) {
0 commit comments