import { Activity, ConversationAccount } from '@microsoft/spark.api';

interface Event<T = any> {
    readonly id: string;
    readonly type: string;
    readonly body: T;
    readonly sentAt: Date;
}
type ActivityEvent<T extends Activity = Activity> = ActivityReceivedEvent<T> | ActivitySendingEvent<T> | ActivitySentEvent<T> | ActivityErrorEvent<T>;
interface ActivityReceivedEvent<T extends Activity = Activity> extends Event<T> {
    readonly type: 'activity.received';
    readonly chat: ConversationAccount;
}
interface ActivitySendingEvent<T extends Activity = Activity> extends Event<T> {
    readonly type: 'activity.sending';
    readonly chat: ConversationAccount;
}
interface ActivitySentEvent<T extends Activity = Activity> extends Event<T> {
    readonly type: 'activity.sent';
    readonly chat: ConversationAccount;
}
interface ActivityErrorEvent<T extends Activity = Activity> extends Event<T> {
    readonly type: 'activity.error';
    readonly chat: ConversationAccount;
    readonly error?: any;
}

export type { ActivityErrorEvent, ActivityEvent, ActivityReceivedEvent, ActivitySendingEvent, ActivitySentEvent, Event };
