UNPKG

923 BTypeScriptView Raw
1import { CommandHandlerMetadata } from "./metadata/automationMetadata";
2import { OnCommand } from "./onCommand";
3/**
4 * Interface for class-based command handlers.
5 * These combine the parameters with the command. A fresh
6 * instance will be created for every invocation. Prefer using the
7 * parameters object to "this" in implementations of the handle method.
8 * @param P parameters type
9 */
10export interface HandleCommand<P = any> {
11 /**
12 * OnCommand function for this command
13 */
14 handle: OnCommand<P>;
15 /**
16 * If this method is implemented, it returns a fresh parameters instance
17 * to use for this class. Otherwise will use the class itself as its parameters.
18 * @return {P} new parameters instance
19 */
20 freshParametersInstance?(): P;
21}
22export declare type SelfDescribingHandleCommand<P = any> = HandleCommand<P> & CommandHandlerMetadata;
23//# sourceMappingURL=HandleCommand.d.ts.map
\No newline at end of file