seyfert
Version:
The most advanced framework for discord bots
30 lines (29 loc) • 1.11 kB
TypeScript
import type { FileLoaded } from '../commands/handler';
import { BaseHandler } from '../common';
import type { LocaleString } from '../types';
export declare class LangsHandler extends BaseHandler {
values: Partial<Record<string, any>>;
private __paths;
filter: (path: string) => boolean;
defaultLang?: string;
aliases: [string, LocaleString[]][];
getLocale(locale: string): string;
getKey(lang: string, message: string): string | undefined;
get(userLocale: string): import("./router").__InternalParseLocale<import("..").DefaultLocale> & {
get(locale?: string): import("..").DefaultLocale;
};
load(dir: string): Promise<void>;
parse(file: LangInstance): void;
set(instances: LangInstance[]): void;
reload(lang: string): Promise<Record<string, any> | null>;
reloadAll(stopIfFail?: boolean): Promise<void>;
onFile(locale: string, { file }: LangInstance): {
file: Record<string, any>;
locale: string;
} | false;
}
export type LangInstance = {
name: string;
file: FileLoaded<Record<string, any>>;
path: string;
};