hubot-command-mapper
Version:
Helps with mapping tools and commands to Hubot.
40 lines (39 loc) • 1.12 kB
text/typescript
import { IParameter } from "../../types.mjs";
/**
* Base class for a parameter.
*
* @export
* @abstract
* @class ParameterBase
* @implements {IParameter}
*/
export declare abstract class ParameterBase implements IParameter {
name: string;
defaultValue: any;
/**
* Gets the string version of the regular expression
* that will be used to map the parameter value.
*
* @readonly
* @abstract
* @type {string}
* @memberof ParameterBase
*/
abstract get regex(): string;
/**
* Indicates that this parameter is optional.
* A user does not have to provide a value
* in order for this command to be valid.
*
* @readonly
* @memberof ParameterBase
*/
get optional(): boolean;
/**
* Creates an instance of ParameterBase.
* @param {string} name The name of the parameter. Can be used to identify the parameter value as well.
* @param {any} [defaultValue=null] When a value is given, the parameter becomes optional.
* @memberof ParameterBase
*/
constructor(name: string, defaultValue?: any);
}