ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

95 lines
2.4 KiB

  1. import { CATEGORIES, USER_ROLES, ViewFlagBehavior } from '@/consts'
  2. import type { ReactNode } from 'react'
  3. export type Category = typeof CATEGORIES[number]
  4. export type Menu = MenuItem[]
  5. export type MenuItem = {
  6. name: string
  7. to: string
  8. base?: string
  9. subMenu: SubMenuItem[] }
  10. export type NicoTag = Tag & {
  11. category: 'nico'
  12. linkedTags: Tag[] }
  13. export type Post = {
  14. id: number
  15. url: string
  16. title: string
  17. thumbnail: string
  18. thumbnailBase: string
  19. tags: Tag[]
  20. viewed: boolean
  21. related: Post[]
  22. createdAt: string
  23. originalCreatedFrom: string | null
  24. originalCreatedBefore: string | null }
  25. export type PostTagChange = {
  26. post: Post
  27. tag: Tag
  28. user?: User
  29. changeType: 'add' | 'remove'
  30. timestamp: string }
  31. export type SubMenuItem =
  32. | { component: ReactNode
  33. visible: boolean }
  34. | { name: string
  35. to: string
  36. visible?: boolean }
  37. export type Tag = {
  38. id: number
  39. name: string
  40. category: Category
  41. postCount: number
  42. children?: Tag[] }
  43. export type User = {
  44. id: number
  45. name: string | null
  46. inheritanceCode: string
  47. role: UserRole }
  48. export type ViewFlagBehavior = typeof ViewFlagBehavior[keyof typeof ViewFlagBehavior]
  49. export type WikiPage = {
  50. id: number
  51. title: string
  52. createdUserId: number
  53. updatedUserId: number
  54. createdAt: string
  55. updatedAt: string
  56. body: string
  57. revisionId: number
  58. pred: number | null
  59. succ: number | null }
  60. export type WikiPageChange = {
  61. revisionId: number
  62. pred: number | null
  63. succ: null
  64. wikiPage: Pick<WikiPage, 'id' | 'title'>
  65. user: Pick<User, 'id' | 'name'>
  66. kind: 'content' | 'redirect'
  67. message: string | null
  68. timestamp: string }
  69. export type WikiPageDiff = {
  70. wikiPageId: number
  71. title: string
  72. olderRevisionId: number | null
  73. newerRevisionId: number
  74. diff: WikiPageDiffDiff[] }
  75. export type WikiPageDiffDiff = {
  76. type: 'context' | 'added' | 'removed'
  77. content: string }
  78. export type UserRole = typeof USER_ROLES[number]