import { MultipleFutureHandler } from '../../../models/models/future/future-aware';
import { IFutureModel } from '../../../models/models/future/future-types';
/**
 * @kosService core.future-aware
 * @kosApiLevel 14
 */
export interface KosMultipleFutureAwareOptions {
    /** Setup mode: 'full' includes all UI properties, 'minimal' only futureHandler. Default: 'full' */
    mode?: "full" | "minimal";
    /** Custom futureHandler property name. Default: 'futureHandler' */
    handlerProperty?: string;
}
/**
 * Interface for models using @kosMultipleFutureAware in minimal mode.
 * Use TypeScript interface merging to add the futureHandler property and named futures to your model class.
 *
 * @example
 * Add ESLint disable comment at top of file, then:
 * ```typescript
 * interface MaintenanceModelImpl extends KosMultipleFutureAwareMinimal {
 *   // Add your specific named futures manually for strong typing:
 *   calibrationFuture?: IFutureModel;
 *   cleaningFuture?: IFutureModel;
 * }
 *
 * @kosMultipleFutureAware({ mode: 'minimal' })
 * class MaintenanceModelImpl implements IKosDataModel {
 *   // futureHandler and named futures are now available via interface merging
 * }
 * ```
 *
 * @kosService core.future-aware
 * @kosApiLevel 14
 */
export interface KosMultipleFutureAwareMinimal {
    /**
     * Core multiple future management container that handles concurrent Future lifecycle operations.
     * Provides methods to add, remove, and query multiple Future instances.
     * Automatically injected by @kosMultipleFutureAware decorator.
     */
    futureHandler: MultipleFutureHandler;
    /**
     * Default future from the handler.
     * Returns the most recently added future or undefined if no futures are active.
     */
    future?: IFutureModel;
}
/**
 * Utility types to generate future property names for multiple futures (for internal use)
 */
type FutureGetters<T extends string> = {
    readonly [K in T as `${K}Future`]?: IFutureModel;
};
type ProgressGetters<T extends string> = {
    readonly [K in T as `${K}Progress`]: number;
};
type StatusGetters<T extends string> = {
    readonly [K in T as `${K}Status`]: string;
};
type IsRunningGetters<T extends string> = {
    readonly [K in T as `${K}IsRunning`]: boolean;
};
type IsCancelledGetters<T extends string> = {
    readonly [K in T as `${K}IsCancelled`]: boolean;
};
type CancelMethods<T extends string> = {
    readonly [K in T as `cancel${Capitalize<K>}`]: () => Promise<void>;
};
/**
 * @kosService core.future-aware
 */
export type MultipleFutureProperties<T extends string> = FutureGetters<T> & ProgressGetters<T> & StatusGetters<T> & IsRunningGetters<T> & IsCancelledGetters<T> & CancelMethods<T>;
/**
 * Interface for models using @kosMultipleFutureAware in full mode (default).
 * Use TypeScript interface merging to add all Future Container properties and named futures to your model class.
 *
 * @example
 * Add ESLint disable comment at top of file, then:
 * ```typescript
 * interface IceAgitatorModelImpl extends KosMultipleFutureAwareFull<"pour" | "agitate" | "gate"> {}
 *
 * @kosMultipleFutureAware() // defaults to full mode
 * class IceAgitatorModelImpl implements IKosDataModel {
 *   // All Future Container properties and named futures are now available automatically
 *   // Access: this.pourFuture, this.agitateFuture, this.gateFuture
 *
 *   onFutureUpdate?(future: IFutureModel, alias?: string): void {
 *     // Handle updates from any managed Future
 *     // Use alias to identify which future triggered the update
 *     if (alias === 'pour') {
 *       console.log(`Pour operation: ${future.progress}%`);
 *     }
 *   }
 * }
 * ```
 *
 * @kosService core.future-aware
 */
export type KosMultipleFutureAwareFull<T extends string = string> = KosMultipleFutureAwareMinimal & MultipleFutureProperties<T> & {
    /**
     * Current operation progress as a percentage (0-100) for the default future.
     * Returns 0 when no default Future is active. Updates automatically as the
     * Future operation progresses via WebSocket events.
     */
    progress: number;
    /**
     * Current operation status string representation for the default future.
     * Common values: "IDLE", "IN_PROGRESS", "SUCCESS", "ERROR", "CANCELLED".
     * Returns "IDLE" when no default Future is active.
     */
    status: string;
    /**
     * Whether the default operation is currently actively executing.
     * True when default Future exists and has not reached an end state.
     * False when no Future exists or operation has completed/failed/cancelled.
     */
    isRunning: boolean;
    /**
     * Whether the current or most recent default operation was cancelled.
     * Remains true after cancellation for status tracking until a new
     * operation starts. False if operation completed normally or failed.
     */
    isCancelled: boolean;
    /**
     * Cancels the currently running default Future operation.
     * Sends cancellation request to the backend service managing the Future.
     * No-op if no default Future is currently active.
     * @returns Promise that resolves when cancellation is acknowledged
     * @throws Error if cancellation request fails
     */
    cancelFuture(): Promise<void>;
};
/**
 * Class decorator that automatically adds Multiple Future Container capabilities to a KOS model.
 *
 * This decorator eliminates the need for manual MultipleFutureHandler setup by:
 * - Adding a futureHandler property for managing multiple concurrent Future operations
 * - Adding reactive getters for default future, progress, status, isRunning, isCancelled (in full mode)
 * - Adding dynamic named future getters based on @kosFuture aliases
 * - Adding cancelFuture method for canceling the default operation (in full mode)
 *
 * **Important**: Use TypeScript interface merging to get proper type information:
 *
 * ```typescript
 * // Add ESLint disable comment at top of file, then:
 * interface MyModelImpl extends KosMultipleFutureAwareFull<"operation1" | "operation2"> {}
 *
 * @kosMultipleFutureAware()
 * class MyModelImpl implements IKosDataModel {
 *   // All Future properties and named futures are now available with full type safety
 * }
 * ```
 *
 * Note: This decorator supports multiple concurrent Future operations. For models that only need
 * single Future support, use @kosFutureAware instead.
 *
 * @param options Configuration options for the decorator
 * @returns A class decorator
 *
 * @example
 * ```typescript
 * // Full mode example with multiple futures
 * interface IceAgitatorModelImpl extends KosMultipleFutureAwareFull<"pour" | "agitate" | "gate"> {}
 *
 * @kosMultipleFutureAware()
 * class IceAgitatorModelImpl implements IKosDataModel {
 *   get isPouring() {
 *     return !!(this.pourFuture && !this.pourFuture?.endState);
 *   }
 *
 *   onFutureUpdate?(future: IFutureModel, alias?: string): void {
 *     // Handle Future updates from any operation
 *     // Use alias to discriminate between different future types
 *     if (alias === 'pour') {
 *       console.log(`Pouring ice: ${future.progress}%`);
 *     } else if (alias === 'agitate') {
 *       console.log(`Agitating: ${future.progress}%`);
 *     }
 *   }
 *
 *   @kosFuture({ alias: "pour" })
 *   async pourIce(): Promise<void> {
 *     // Pour operation
 *   }
 *
 *   @kosFuture({ alias: "agitate" })
 *   async testAgitate(): Promise<void> {
 *     // Agitation operation
 *   }
 * }
 *
 * // Minimal mode example
 * interface BackgroundServiceModelImpl extends KosMultipleFutureAwareMinimal<"task1" | "task2"> {}
 *
 * @kosMultipleFutureAware({ mode: 'minimal' })
 * class BackgroundServiceModelImpl implements IKosDataModel {
 *   @kosFuture({ alias: "task1" })
 *   async backgroundTask1() {
 *     return "done";
 *   }
 *
 *   @kosFuture({ alias: "task2" })
 *   async backgroundTask2() {
 *     return "done";
 *   }
 * }
 * ```
 *
 * @category KOS Model Decorator
 * @since 2.0.0
 * @kosService core.future-aware
 * @kosApiLevel 14
 */
export declare function kosMultipleFutureAware(options?: KosMultipleFutureAwareOptions): ClassDecorator;
export {};
//# sourceMappingURL=kos-multiple-future-aware.d.ts.map