import { FragmentOf } from 'gql.tada'
import { ActionLog } from '../fragments'
import { EventType } from './cache-typing'

declare global {
  interface WindowEventMap {
    actionLogEvent: CustomEvent<ActionLogPayload>
    // internal kill-switch, to ensure resuscitation of WS
    killWs: CustomEvent<never>
  }
}

export type ActionLogPayload = {
  actionLog: FragmentOf<typeof ActionLog>
  eventType: EventType
}

export {} //keep that for TS compiler.
