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

80 lines
1.8 KiB

  1. import React from 'react'
  2. import { CATEGORIES, USER_ROLES, ViewFlagBehavior } from '@/consts'
  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. export type SubMenuItem = {
  22. component: React.ReactNode
  23. visible: boolean
  24. } | {
  25. name: string
  26. to: string
  27. visible?: boolean }
  28. export type Tag = {
  29. id: number
  30. name: string
  31. category: Category
  32. postCount: number }
  33. export type User = {
  34. id: number
  35. name: string | null
  36. inheritanceCode: string
  37. role: UserRole }
  38. export type ViewFlagBehavior = typeof ViewFlagBehavior[keyof typeof ViewFlagBehavior]
  39. export type WikiPage = {
  40. id: number
  41. title: string
  42. body: string
  43. sha: string
  44. pred?: string
  45. succ?: string
  46. updatedAt?: string }
  47. export type WikiPageChange = {
  48. sha: string
  49. pred?: string
  50. succ?: string
  51. wikiPage: WikiPage
  52. user: User
  53. changeType: string
  54. timestamp: string }
  55. export type WikiPageDiff = {
  56. wikiPageId: number
  57. title: string
  58. olderSha: string
  59. newerSha: string
  60. diff: WikiPageDiffDiff[] }
  61. export type WikiPageDiffDiff = {
  62. type: 'context' | 'added' | 'removed'
  63. content: string }
  64. export type UserRole = typeof USER_ROLES[number]