From 9afc7d6844edca16f65c04830614d11e35fa882b Mon Sep 17 00:00:00 2001 From: Pedro Durek Date: Sat, 12 Mar 2022 20:22:13 -0700 Subject: [PATCH] Add nsSeparator to CustomTypeOptions --- ts4.1/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ts4.1/index.d.ts b/ts4.1/index.d.ts index 88e966807..c0351c0e0 100644 --- a/ts4.1/index.d.ts +++ b/ts4.1/index.d.ts @@ -37,6 +37,7 @@ export interface Resources {} * defaultNS: 'custom'; * returnNull: false; * returnEmptyString: false; + * nsSeparator: ':'; * keySeparator: '.'; * jsonFormat: 'v4'; * resources: { @@ -57,6 +58,7 @@ type TypeOptions = MergeBy< returnNull: true; returnEmptyString: true; keySeparator: '.'; + nsSeparator: ':'; defaultNS: 'translation'; jsonFormat: 'v4'; resources: Resources; @@ -121,15 +123,16 @@ type Normalize2 = K extends keyof T type Normalize = WithOrWithoutPlural | Normalize2; // Normalize multiple namespaces +type KeyWithNSSeparator = `${N & + string}${S}${K & string}`; type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; type LastOf = UnionToIntersection T : never> extends () => infer R ? R : never; -type AppendNS = `${N & string}:${K & string}`; type NormalizeMulti> = L extends U - ? AppendNS> | NormalizeMulti> + ? KeyWithNSSeparator> | NormalizeMulti> : never; interface CustomTypeParameters {