Interface for models using

Kos Future Aware

in full mode (default). Use TypeScript interface merging to add all Future Container properties to your model class.

Example

Add ESLint disable comment at top of file, then:

interface CopyLogsModelImpl extends KosFutureAwareFull<CopyProgress> {}

kosFutureAware() // defaults to full mode
class CopyLogsModelImpl implements IKosDataModel {
// All Future Container properties are now available automatically

onFutureUpdate?(future: IFutureModel<CopyProgress>): void {
// Access typed clientData
}
}
interface KosFutureAwareFull<T> {
    futureHandler: FutureAwareContainer<T>;
    progress: number;
    status: string;
    isRunning: boolean;
    isCancelled: boolean;
    cancelFuture(): Promise<void>;
    future?: IFutureModel<T>;
}

Type Parameters

  • T extends object = Record<string, unknown>

Hierarchy (view full)

Methods

  • Cancels the currently running Future operation. Sends cancellation request to the backend service managing the Future. No-op if no Future is currently active.

    Returns Promise<void>

    Promise that resolves when cancellation is acknowledged

    Throws

    Error if cancellation request fails

Properties

futureHandler: FutureAwareContainer<T>

Core future management container that handles Future lifecycle operations. Provides methods to add, remove, and query Future instances. Automatically injected by

Kos Future Aware

decorator.

progress: number

Current operation progress as a percentage (0-100). Returns 0 when no Future is active. Updates automatically as the Future operation progresses via WebSocket events.

status: string

Current operation status string representation. Common values: "IDLE", "IN_PROGRESS", "SUCCESS", "ERROR", "CANCELLED". Returns "IDLE" when no Future is active.

isRunning: boolean

Whether an operation is currently actively executing. True when Future exists and has not reached an end state. False when no Future exists or operation has completed/failed/cancelled.

isCancelled: boolean

Whether the current or most recent operation was cancelled. Remains true after cancellation for status tracking until a new operation starts. False if operation completed normally or failed.

future?: IFutureModel<T>

Current active Future model instance containing operation details. Undefined when no operation is active. Automatically updated when operations start, progress, complete, or fail.