websocket.ts 480 B

123456789101112
  1. export const SocketEventName = {
  2. UpdateDescCount: 'UpdateDsecCount',
  3. } as const;
  4. export type SocketEventName = typeof SocketEventName[keyof typeof SocketEventName];
  5. type PageId = string;
  6. type DescendantCount = number;
  7. /**
  8. * Data of updateDescCount when used through socket.io. Convert to UpdateDescCountData type when use with swr cache.
  9. */
  10. export type UpdateDescCountRawData = Record<PageId, DescendantCount>;
  11. export type UpdateDescCountData = Map<PageId, DescendantCount>;