import { HandleCommand } from "./HandleCommand"; import { HandlerContext } from "./HandlerContext"; import { HandlerResult } from "./HandlerResult"; import { CommandHandlerMetadata } from "./metadata/automationMetadata"; import { Maker } from "./util/constructionUtils"; export declare enum QuestionStyle { Dialog = "dialog", Threaded = "threaded", Unthreaded = "unthreaded", DialogAction = "dialog_action" } /** * Handle the given command. Parameters will have been set on a fresh * parameters instance before invocation * @param {HandlerContext} ctx context from which GraphQL client can be obtained, * messages can be sent etc. * @return a Promise of a HandlerResult, containing a status code, or anything else representing * success. */ export declare type OnCommand

= (ctx: HandlerContext, parameters: P) => Promise | Promise; /** * Given a regex used for an intent, add anchors to it if missing. Additionally, wraps the new anchors in match groups along with the original * intent for access later. */ export declare function addRegExIntentAnchors(intent: RegExp): string; /** * Parse command handler intent. If the incoming intent is a RegExp convert it to a string pattern. Otherwise, pass existing intent through. */ export declare function parseRegExIntent(intent: string | string[] | RegExp): string | string[]; /** * Create a HandleCommand instance with the appropriate metadata wrapping * the given function */ export declare function commandHandlerFrom

(h: OnCommand

, factory: Maker

, name?: string, description?: string, intent?: string | string[] | RegExp, tags?: string | string[], autoSubmit?: boolean, question?: QuestionStyle): HandleCommand

& CommandHandlerMetadata; //# sourceMappingURL=onCommand.d.ts.map