import { FutureEndState } from '../../services/future';
import { IKosDataModel } from '../../../core';

export interface FutureDelegate<T extends {} = Record<string, unknown>> {
    future?: IFutureModel<T>;
}
export interface FutureContainer<T extends {} = Record<string, unknown>> {
    futureHandler: FutureAwareContainer<T>;
    onFutureUpdate?: (future: IFutureModel<T>) => void;
}
export interface MultiFutureAware<T extends {} = Record<string, unknown>> {
    futureMap: Map<string, IFutureModel<T>>;
}
export interface FutureAwareContainer<T extends {} = Record<string, unknown>> extends FutureDelegate<T> {
    removeFuture(alias?: string): void;
    getFuture(alias?: string): IFutureModel<T> | undefined;
    addFuture(future: IFutureModel<T>, alias?: string): void;
    allFutures: IFutureModel<T>[];
    onFutureUpdate?: (future: IFutureModel<T>) => void;
}
export interface FutureAware {
    readonly statusFuture?: IFutureModel;
    status: string;
    progress: number;
    timeRemaining: string;
    cancel: () => Promise<void>;
}
/**
 * Additional properties that can be passed into the constructor in order
 * to set initial values
 *
 * @remarks
 * Used to identify additional data that can be set on the model during
 * instantiation.  It is expected that implementers will set these properties
 * in the constructor.  The value <strong>might</strong> be overriden by
 * subsequent lifecycle methods or updates.
 *
 * @category future
 */
export interface IFutureModelOptions<T extends {} = Record<string, unknown>> {
    id: string;
    tracker?: string;
    progress?: number;
    remainingTimeMs?: number;
    endState?: FutureEndState;
    reason?: string;
    namespace?: string;
    reasonData?: {
        name: string;
        version: string;
    } | {
        vmId: string;
        target: string;
    } | {
        vmId: string;
        target: string;
    }[];
    clientData?: T;
    note?: string;
}
/**
 * Represents the public interface of a `IFutureModel`
 *
 * @category Model
 */
export interface IFutureModel<T extends {} = Record<string, unknown>> extends IKosDataModel, Omit<IFutureModelOptions<T>, "modifyFuture"> {
    id: string;
    progress: number;
    remainingTimeMs: number;
    endState?: FutureEndState;
    reason?: string;
    reasonData?: {
        vmId: string;
        target: string;
    } | {
        vmId: string;
        target: string;
    }[];
    clientData?: T;
    note?: string;
    futureId: string;
    status: string;
    cancelFuture: () => Promise<void>;
    timeRemaining: string;
}
//# sourceMappingURL=future-types.d.ts.map