UNPKG

sheweny

Version:

The powerful framework for create discord bots

31 lines (30 loc) 1.16 kB
import { Collection } from 'discord.js'; import type { ShewenyClient } from '../client/Client.js'; import type { BaseStructure } from '../structures/index.js'; import type { Class, Manager, Structure } from '../typescript/index.js'; declare type WithMainProperty<K extends string, V> = { [P in K]: V; }; declare type StructureType<MKN extends string, MKV> = BaseStructure & WithMainProperty<MKN, MKV>; interface LoaderOptions { instance: Class<Structure>; manager: Manager; asyncRead?: boolean; } export declare class Loader<MKN extends string, MKV, V extends StructureType<MKN, MKV>> { readonly client: ShewenyClient; readonly collection: Collection<MKV, V[]>; readonly mainKey: MKN; readonly mainPath: string; readonly paths: Array<string>; readonly manager: Manager; readonly asyncRead: boolean; readonly instance: Class<Structure>; constructor(client: ShewenyClient, path: string, mainKey: MKN, options: LoaderOptions); load(dir?: string): Promise<Collection<MKV, V[]>>; private absolutePath; private readDirectory; private loadFileStructures; private loadStructure; } export {};