import { Client, Snowflake } from "discord.js"; import { EventEmitter } from "events"; import { BaseConfig } from "./config/configTypes"; import { AfterUnloadPluginData, AnyPluginData, BasePluginData, BeforeLoadPluginData } from "./plugins/PluginData"; import { PluginPublicInterface } from "./plugins/pluginUtils"; import { AnyContext, GlobalContext, GlobalPluginMap, GuildContext, GuildPluginMap, KnubArgs, KnubOptions, LogFn } from "./types"; import { AnyPluginBlueprint, PluginBlueprintPublicInterface, ResolvedPluginBlueprintPublicInterface } from "./plugins/PluginBlueprint"; import { EventRelay } from "./events/EventRelay"; import { Queue } from "./Queue"; import { Profiler } from "./Profiler"; export declare class Knub extends EventEmitter { protected client: Client; protected eventRelay: EventRelay; protected guildPlugins: GuildPluginMap; protected globalPlugins: GlobalPluginMap; protected loadedGuilds: Map; protected guildLoadQueues: Map; protected globalContext: GlobalContext; protected globalContextLoaded: boolean; protected options: KnubOptions; protected log: LogFn; profiler: Profiler; constructor(client: Client, userArgs: Partial); initialize(): void; stop(): Promise; getAvailablePlugins(): GuildPluginMap; getGlobalPlugins(): GlobalPluginMap; getGlobalConfig(): BaseConfig; /** * Create the partial PluginData that's passed to beforeLoad() */ protected getBeforeLoadPluginData(ctx: AnyContext, plugin: AnyPluginBlueprint, loadedAsDependency: boolean): Promise>>; /** * Convert the partial PluginData from getBeforeLoadPluginData() to a full PluginData object */ protected withFinalPluginDataProperties>(ctx: AnyContext, beforeLoadPluginData: BeforeLoadPluginData): TPluginData; /** * Convert a full PluginData object to the partial object that's passed to afterUnload() functions */ protected getAfterUnloadPluginData>(pluginData: TPluginData): AfterUnloadPluginData; protected resolveDependencies(plugin: AnyPluginBlueprint, resolvedDependencies?: Set): Promise>; protected ctxHasPlugin(ctx: AnyContext, plugin: AnyPluginBlueprint): boolean; protected resolvePluginBlueprintPublicInterface(blueprint: T, pluginData: AnyPluginData): TPublic extends PluginBlueprintPublicInterface ? ResolvedPluginBlueprintPublicInterface : null; protected getPluginPublicInterface(ctx: AnyContext, plugin: T): PluginPublicInterface; protected loadAllAvailableGuilds(): Promise; loadGuild(guildId: Snowflake): Promise; reloadGuild(guildId: Snowflake): Promise; unloadGuild(guildId: Snowflake): Promise; protected unloadAllGuilds(): Promise; protected getGuildLoadQueue(guildId: Snowflake): Queue; getLoadedGuild(guildId: Snowflake): GuildContext | undefined; getLoadedGuilds(): Array; protected loadGuildConfig(ctx: GuildContext): Promise; protected loadGuildPlugins(ctx: GuildContext): Promise; /** * The global context analogue to loadGuild() */ loadGlobalContext(): Promise; reloadGlobalContext(): Promise; unloadGlobalContext(): Promise; protected loadGlobalPlugins(ctx: GlobalContext): Promise; protected registerSlashCommands(): Promise; }