export type ToesEventType = 'app:create' | 'app:delete' | 'app:reload' | 'app:start' | 'app:stop'

interface BaseEvent {
  app: string
  time: number
}

export type ToesEvent =
  | BaseEvent & { type: 'app:create' }
  | BaseEvent & { type: 'app:delete' }
  | BaseEvent & { type: 'app:reload' }
  | BaseEvent & { type: 'app:start' }
  | BaseEvent & { type: 'app:stop' }

type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never

export type ToesEventInput = DistributiveOmit<ToesEvent, 'time'>
