import { Observable } from "rxjs";
import { ExecutionContext } from "./execution-context";

/**
 * Represents a command that can be executed on a DataItem
 */
export declare interface Command {
    /**
    * Execution method
    * @param context The context in which the command is executed.
    */
    execute(context: ExecutionContext): Observable<any>;
}

/**
 * This interface is used to mark commands that should be executed only once in bulk operation, not multiple times for every item.
 *
 * @export
 * @interface ExecuteOnceInBulkCommand
 * @extends {Command}
 */
export declare interface ExecuteOnceInBulkCommand extends Command {
    /**
     * Flag that indicates the command is executed once and not for every item selected.
     *
     * @type {boolean}
     * @memberof ExecuteOnceInBulkCommand
     */
    executeOnceInBulk: boolean;
}

/* Result produced after execution of bulk operation.
 *
 * @export
 * @interface BulkOperationResult
 */
export interface BulkOperationResult {
   /**
    * Flag that marks the execution as successful.
    *
    * @type {boolean}
    * @memberof BulkOperationResult
    */
   success: boolean;

   /**
    * The ids of the items for which the operation failed.
    *
    * @type {Array<string>}
    * @memberof BulkOperationResult
    */
   failedItemsIds?: Array<string>;

   /**
    * The ids of the items for which the operation was successfull.
    *
    * @type {Array<string>}
    * @memberof BulkOperationResult
    */
   succeededItemsIds?: Array<string>;
}
