@necord/localization
Version:
Localize your Discord bot with Necord!
20 lines (19 loc) • 968 B
TypeScript
import { CallHandler, ExecutionContext, NestInterceptor, OnModuleInit, Type } from '@nestjs/common';
import { Observable } from 'rxjs';
import { BaseLocalizationAdapter } from '../adapters';
import { LocaleResolver, TranslationFn } from '../interfaces';
import { ModuleRef } from '@nestjs/core';
export declare class LocalizationInterceptor implements NestInterceptor, OnModuleInit {
private readonly localizationAdapter;
private readonly resolvers;
private readonly moduleRef;
private static readonly LOCALIZATION_CONTEXT;
static getCurrentTranslationFn(): TranslationFn;
private cachedResolvers;
constructor(localizationAdapter: BaseLocalizationAdapter, resolvers: (LocaleResolver | Type<LocaleResolver>)[], moduleRef: ModuleRef);
onModuleInit(): Promise<void>;
intercept(context: ExecutionContext, next: CallHandler<any>): Promise<Observable<any>>;
private getLocale;
private getResolver;
private getTranslationFn;
}