Skip to content

Commit

Permalink
Merge pull request #117 from luca-peruzzo/master
Browse files Browse the repository at this point in the history
FIX docker build
  • Loading branch information
Romanchuk authored Dec 7, 2023
2 parents 5f296b9 + 0218f3f commit 25cc44f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions libs/angular-i18next/src/lib/I18NextService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export class I18NextService implements ITranslationService {
this.i18next = i18nextInstance ?? i18nextGlobal;
}

t(key: string | string[], options?: ITranslationOptions | undefined): i18n.DefaultTReturn<ITranslationOptions>;
t(key: string | string[] | (string | TemplateStringsArray)[], defaultValue: string, options?: ITranslationOptions | undefined): i18n.DefaultTReturn<ITranslationOptions>;
t(key: unknown, defaultValueOrOptions?: unknown, options?: unknown): i18n.DefaultTReturn<ITranslationOptions> {
t(key: string | string[], options?: ITranslationOptions | undefined): i18n.TFunctionReturn<i18n.Namespace, string | string[], ITranslationOptions>;
t(key: string | string[] | (string | TemplateStringsArray)[], defaultValue: string, options?: ITranslationOptions | undefined): i18n.TFunctionReturn<i18n.Namespace, string | string[], ITranslationOptions>;
t(key: unknown, defaultValueOrOptions?: unknown, options?: unknown): i18n.TFunctionReturn<i18n.Namespace, unknown, ITranslationOptions> {
const hasDefault = !!defaultValueOrOptions && typeof defaultValueOrOptions === 'string';

this.i18next.t.bind(this.i18next);
Expand Down
6 changes: 3 additions & 3 deletions libs/angular-i18next/src/lib/ITranslationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { $Dictionary as I18Next$Dictionary } from 'i18next/typescript/helpers';

type Modify<T, R> = Omit<T, keyof R> & R;

export type ITranslationOptions = i18n.TOptions & I18Next$Dictionary & { defaultValue?: string; };
export type ITranslationOptions = i18n.TOptions<I18Next$Dictionary> & { defaultValue?: string; };

export type ITranslationService = Modify<Partial<i18n.i18n>, {

Expand All @@ -29,12 +29,12 @@ export type ITranslationService = Modify<Partial<i18n.i18n>, {
t(
key: string | string[],
options?: ITranslationOptions,
): i18n.DefaultTReturn<ITranslationOptions>;
): i18n.TFunctionReturn<i18n.Namespace, string | string[], ITranslationOptions>;
t(
key: string | string[],
defaultValue: string,
options?: ITranslationOptions
): i18n.DefaultTReturn<ITranslationOptions>;
): i18n.TFunctionReturn<i18n.Namespace, string | string[], ITranslationOptions>;

format: i18n.FormatFunction;

Expand Down
2 changes: 1 addition & 1 deletion libs/angular-i18next/src/lib/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export type PrependPipeOptions = {
prependScope?: boolean;
prependNamespace?: boolean;
};
export type PipeOptions = i18n.TOptionsBase & I18Next$Dictionary & { defaultValue?: string; } &
export type PipeOptions = i18n.TOptions<I18Next$Dictionary> & { defaultValue?: string; } &
FormatPipeOptions &
PrependPipeOptions;
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class MockI18NextService implements ITranslationService {

t = jest.fn((key: string | string[],
optionsOrDefault?: string | i18next.TOptions,
options?: i18next.TOptions): i18next.DefaultTReturn<(i18next.TOptions & { defaultValue: string; })> => {
options?: i18next.TOptions): i18next.TFunctionReturn<i18next.Namespace, string | string[], (i18next.TOptions & { defaultValue: string; })> => {
if (key instanceof Array) {
return key.length > 0 ? key[0] : '';
}
Expand Down

0 comments on commit 25cc44f

Please sign in to comment.