export type DecisionState = 'DECIDED'; export type TaskState = 'TODO' | 'DONE'; export type DecisionType = 'DECISION'; export type TaskType = 'TASK'; export interface ObjectKey { containerAri?: string; localId: string; objectAri: string; } export interface BaseItem extends ObjectKey { lastUpdateDate: Date; state: S; type: DecisionType | TaskType; } export type Handler = (state: TaskState | DecisionState) => void; export type RecentUpdatesId = string; export interface RecentUpdateContext { localId?: string; objectAri: string; } export interface TaskDecisionProvider { notifyRecentUpdates(updateContext: RecentUpdateContext): void; subscribe(objectKey: ObjectKey, handler: Handler, item?: BaseItem): void; toggleTask(objectKey: ObjectKey, state: TaskState): Promise; unsubscribe(objectKey: ObjectKey, handler: Handler): void; unsubscribeRecentUpdates(id: RecentUpdatesId): void; }