Optional options: KosFutureAwareOptionsConfiguration options for the decorator
A class decorator
(coming soon).
// Full mode example
interface DeviceOperationsModelImpl extends KosFutureAwareFull<OperationData> {}
kosFutureAware()
class DeviceOperationsModelImpl implements IKosDataModel {
onFutureUpdate?(future: IFutureModel<OperationData>): void {
// Handle Future updates
}
kosFuture()
async performOperation(): Promise<OperationData> {
return { result: "done" };
}
}
// Minimal mode example
interface BackgroundServiceModelImpl extends KosFutureAwareMinimal {}
kosFutureAware({ mode: 'minimal' })
class BackgroundServiceModelImpl implements IKosDataModel {
kosFuture()
async backgroundTask() {
return "done";
}
}
2.0.0
Class decorator that automatically adds Future Container capabilities to a KOS model.
This decorator eliminates the need for manual Future Container setup by:
Important: Use TypeScript interface merging to get proper type information:
Note: This decorator supports single Future operations. For models that need to manage multiple concurrent Futures, use