matrix-react-sdk
Version:
SDK for matrix.org using React
21 lines (20 loc) • 754 B
TypeScript
import { CommandCategories } from "./slash-commands/interface";
import { Command } from "./slash-commands/command";
export { CommandCategories, Command };
export declare const Commands: Command[];
export declare const CommandMap: Map<string, Command>;
export declare function parseCommandString(input: string): {
cmd?: string;
args?: string;
};
interface ICmd {
cmd?: Command;
args?: string;
}
/**
* Process the given text for /commands and returns a parsed command that can be used for running the operation.
* @param {string} input The raw text input by the user.
* @return {ICmd} The parsed command object.
* Returns an empty object if the input didn't match a command.
*/
export declare function getCommand(input: string): ICmd;