UNPKG

772 BTypeScriptView Raw
1import type { AbstractBaseCommand, CommandMetaData, LoadersContract } from '../types.js';
2/**
3 * Fs loader exposes the API to load commands from a directory. All files
4 * ending with ".js", ".cjs", ".mjs", ".ts" and ".mts" are considered
5 * as commands
6 */
7export declare class FsLoader<Command extends AbstractBaseCommand> implements LoadersContract<Command> {
8 #private;
9 constructor(comandsDirectory: string, filter?: (filePath: string) => boolean);
10 /**
11 * Returns the metadata of commands
12 */
13 getMetaData(): Promise<CommandMetaData[]>;
14 /**
15 * Returns the command class constructor for a given command. Null
16 * is returned when unable to lookup the command
17 */
18 getCommand(metaData: CommandMetaData): Promise<Command | null>;
19}