hubot-command-mapper
Version:
Helps with mapping tools and commands to Hubot.
35 lines (34 loc) • 1.42 kB
text/typescript
import { ITool, ICommand, IParameter } from "../index.mjs";
/**
* Converts the specified tool into a regular expression
* that can be used by the bot.
*/
export declare function convertToolIntoRegexString<A>(robotName: string, robotAlias: string, tool: ITool): string;
export declare function convertBotNameIntoRegexString(robotName: string, robotAlias: string): string;
/**
* Converts the specified command into a regular expression
* that can be used by the bot.
*
* @param robotName The name of the robot.
* @param tool The tool.
* @param cmd The command.
* @param {boolean} [useNaming=false] If the value is true, named groups will be used for each parameter.
*/
export declare function convertCommandIntoRegexString(robotName: string, robotAlias: string | null, tool: ITool, cmd: ICommand, useNaming?: boolean): string;
/**
* Escapes the given string for usage in a regular expression.
*
* @export
* @param {any} str The string.
* @returns The escaped regular expression.
*/
export declare function escapeRegExp(str: string): string;
/**
* Converts the given parameters to a regular expression string.
*
* @export
* @param {IParameter[]} parameters The parameters.
* @param {boolean} [useNaming=false] If the value is true, named groups will be used for each parameter.
* @returns
*/
export declare function convertParametersToRegex(parameters: IParameter[], useNaming?: boolean): string;