model.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. declare const enum ChatType {
  2. Private = 'private',
  3. Group = 'group',
  4. Temp = 'temp'
  5. }
  6. interface IPrivateChat {
  7. chatID: number,
  8. chatType: ChatType.Private,
  9. }
  10. interface IGroupChat {
  11. chatID: number,
  12. chatType: ChatType.Group,
  13. }
  14. interface ITempChat {
  15. chatID: {qq: number, group: number},
  16. chatType: ChatType.Temp,
  17. }
  18. type IChat = IPrivateChat | IGroupChat | ITempChat;
  19. interface ILock {
  20. workon: number,
  21. feed: string[],
  22. threads: {
  23. [key: string]:
  24. {
  25. /**
  26. * Offset for next timeline query.
  27. *
  28. * @description definition changes:
  29. * - -1: initial value for existing feeds after program start
  30. * - 0: initial value for new feeds right after subscription
  31. * - positive offset: starting/minimum tweet ID (exclusive) for next query
  32. * - negative offset: (inverse of) ending/maximum tweet ID (inclusive) for next query
  33. *
  34. * The type is now string to avoid losing accuracy for big integers.
  35. */
  36. offset: string,
  37. updatedAt: string,
  38. subscribers: IChat[],
  39. }
  40. }
  41. }