UNPKG

corde

Version:

A simple library for Discord bot tests

54 lines (53 loc) 1.57 kB
import { IConfigOptions } from "../types"; /** * Default interface of JSON config */ export declare class Config implements Readonly<IConfigOptions> { private _cordeBotToken; private _botTestId; private _channelId; private _guildId; private _timeout?; private _botPrefix; private _testMatches; private _modulePathIgnorePatterns; private _project?; private _exitOnFileReadingError?; private _extensions?; private _rootDir; get cordeBotToken(): string; get botTestId(): string; get channelId(): string; get guildId(): string; get timeout(): number | undefined; get botPrefix(): string; get testMatches(): string[]; get modulePathIgnorePatterns(): string[]; get project(): string | undefined; get exitOnFileReadingError(): boolean | undefined; get extensions(): string[] | undefined; get rootDir(): string; /** * Initialize Configs with default values. */ constructor(); get<T extends keyof IConfigOptions>(configName: T): IConfigOptions[T]; /** * Set values to config options that are not **filed** yet * It means that all options that are already with a value will not lose * this value * * @example * const config = new Config(); * config.timeout = 1000; * * const newConfig: IConfigOptions = { ...timeout: 3000 }; * config.setConfigs(newConfig); * console.log(config.timeout) // print 1000; * * @param config new set of configs. */ setConfigs(config: Partial<IConfigOptions>, forceUpdate?: boolean): void; private clearArray; private getArrayWithRootReplaced; }