UNPKG

753 BTypeScriptView Raw
1import { Logger } from '@nestjs/common';
2import { ReplContext } from './repl-context';
3import type { ReplFnDefinition } from './repl.interfaces';
4export declare abstract class ReplFunction<ActionParams extends Array<unknown> = Array<unknown>, ActionReturn = any> {
5 protected readonly ctx: ReplContext;
6 /** Metadata that describes the built-in function itself. */
7 abstract fnDefinition: ReplFnDefinition;
8 protected readonly logger: Logger;
9 constructor(ctx: ReplContext);
10 /**
11 * Method called when the function is invoked from the REPL by the user.
12 */
13 abstract action(...args: ActionParams): ActionReturn;
14 /**
15 * @returns A message displayed by calling `<fnName>.help`
16 */
17 makeHelpMessage(): string;
18}