/** * Common options for all message decorators. */ export interface CommonDecoratorOptions { /** * If the callback is a method on a component model, determines whether to * invoke the callback even if the associated component is not currently * active in the layout. The default is `false`. */ targetInactive?: boolean; } /** * Options for the `@command` decorator. */ export interface CommandDecoratorOptions extends CommonDecoratorOptions { /** * Determines whether the callback can be invoked concurrently with other * implementations that are marked as parallel (including multiple instances * of the same component). By default, callbacks are executed sequentially * in the order they are registered in the library, and in layout order for * components. If there is a mix of sequential and parallel implementations, * the parallel ones will all be invoked concurrently after the sequential * ones. * * Parallel implementations cannot use the `next()` and `finish()` methods * of `CommandContext`. * * The default is `false`. */ parallel?: boolean; } /** * Options for the `@operation` decorator. */ export interface OperationDecoratorOptions extends CommonDecoratorOptions { } /** * Configured callbacks for a command or operation. */ export interface CommandCallbackConfig extends CommandDecoratorOptions, OperationDecoratorOptions { /** * The name of the command or operation being implemented. */ name: string; /** * The name of the method to invoke when the message is executed. */ executeMethodName: string; /** * The name of the method to invoke to see if the message can execute. */ canExecuteMethodName?: string; } /** * A method decorator that declares the method as a callback for a command. The * decorated method will be invoked with the command argument and command * context when the command is executed. * * @param name The name of the command. * @param options Object specifying additional options. */ export declare function command(name: string, options?: CommandDecoratorOptions): PropertyDecorator; /** * A method decorator that declares the method as a callback for an operation. * The decorated method will be invoked with the operation argument and * operation context when the operation is executed. The return value will be * the result of the operation (if multiple callbacks are configured for the * same operation, then the result will be passed in to the next callback in the * operation context instead if it is not the final callback). * * @param name The name of the operation. * @param options Object specifying additional options. */ export declare function operation(name: string, options?: OperationDecoratorOptions): PropertyDecorator; /** * A method decorator that declares the method as a canExecute callback for a * command or operation. The decorated method will be invoked with the message * argument to determine if the message can be executed. * * @param name The name of the command. */ export declare function canExecute(name: string): MethodDecorator; /** * Gets the registered command callbacks implemented by an object instance for a * given command or operation. These are specified via the `@command` or * `@operation` decorators on methods. * * @param implementor The object instance implementing command callbacks. * @param name The name of the command or operation. */ export declare function getCommandCallbacks(implementor: object, name: string): CommandCallbackConfig | undefined;