ぼざクリタグ広場 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.
 
 
 
 
 
 

91 lines
2.1 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. body: string
  53. sha: string
  54. pred?: string
  55. succ?: string
  56. updatedAt?: string }
  57. export type WikiPageChange = {
  58. sha: string
  59. pred?: string
  60. succ?: string
  61. wikiPage: WikiPage
  62. user: User
  63. changeType: string
  64. timestamp: string }
  65. export type WikiPageDiff = {
  66. wikiPageId: number
  67. title: string
  68. olderSha: string
  69. newerSha: string
  70. diff: WikiPageDiffDiff[] }
  71. export type WikiPageDiffDiff = {
  72. type: 'context' | 'added' | 'removed'
  73. content: string }
  74. export type UserRole = typeof USER_ROLES[number]