clide-js
    Preparing search index...

    Interface ContextParams<TOptions>

    Params for creating a new Context instance.

    interface ContextParams<TOptions extends OptionsConfig = OptionsConfig> {
        client?: Client;
        commandsDir: string;
        commandString: string;
        hooks?: HookRegistry<ClideHooks>;
        options?: TOptions;
        parseFn?: ParseCommandFn;
        plugins?: {
            description?: string;
            init: (context: Context) => MaybePromise<boolean>;
            meta?: AnyObject;
            name: string;
            version?: string;
        }[];
        resolveFn?: ResolveCommandFn;
    }

    Type Parameters

    Index

    Properties

    client?: Client

    The standard streams client

    commandsDir: string

    The path to the directory containing command modules

    commandString: string

    The command string to be executed

    The hooks emitter

    options?: TOptions

    The options config for the command

    parseFn?: ParseCommandFn

    An optional function to replace the default command parser

    plugins?: {
        description?: string;
        init: (context: Context) => MaybePromise<boolean>;
        meta?: AnyObject;
        name: string;
        version?: string;
    }[]

    A list of plugins to load

    Type declaration

    • Optionaldescription?: string
    • init: (context: Context) => MaybePromise<boolean>

      Initialize the plugin.

    • Optionalmeta?: AnyObject

      Additional metadata about the plugin that doesn't fit in the standard fields.

      Note: Plugin info on the Context object will be frozen after the plugin is initialized. However, the freeze is shallow, so the fields of this object will be mutable by default.

    • name: string
    • Optionalversion?: string
    resolveFn?: ResolveCommandFn

    An optional function to replace the default command resolver