|
- import { CATEGORIES,
- FETCH_POSTS_ORDER_FIELDS,
- USER_ROLES,
- ViewFlagBehavior } from '@/consts'
-
- import type { ReactNode } from 'react'
-
- export type Category = typeof CATEGORIES[number]
-
- export type FetchPostsOrder = `${ FetchPostsOrderField }:${ 'asc' | 'desc' }`
-
- export type FetchPostsOrderField = typeof FETCH_POSTS_ORDER_FIELDS[number]
-
- export type FetchPostsParams = {
- url: string
- title: string
- tags: string
- match: 'all' | 'any'
- originalCreatedFrom: string
- originalCreatedTo: string
- createdFrom: string
- createdTo: string
- updatedFrom: string
- updatedTo: string
- page: number
- limit: number
- order: FetchPostsOrder }
-
- export type FetchTagsOrder = `${ FetchTagsOrderField }:${ 'asc' | 'desc' }`
-
- export type FetchTagsOrderField =
- | 'name'
- | 'category'
- | 'post_count'
- | 'created_at'
- | 'updated_at'
-
- export type FetchTagsParams = {
- post: number | null
- name: string
- category: Category | null
- postCountGTE: number
- postCountLTE: number | null
- createdFrom: string
- createdTo: string
- updatedFrom: string
- updatedTo: string
- page: number
- limit: number
- order: FetchTagsOrder }
-
- export type Menu = MenuItem[]
-
- export type MenuItem = {
- name: string
- to: string
- base?: string
- subMenu: SubMenuItem[] }
-
- export type NicoTag = Tag & {
- category: 'nico'
- linkedTags: Tag[] }
-
- export type NiconicoMetadata = {
- currentTime: number
- duration: number
- isVideoMetaDataLoaded: boolean
- maximumBuffered: number
- muted: boolean
- showComment: boolean
- volume: number }
-
- export type NiconicoVideoInfo = {
- title: string
- videoId: string
- lengthInSeconds: number
- thumbnailUrl: string
- description: string
- viewCount: number
- commentCount: number
- mylistCount: number
- postedAt: string
- watchId: number }
-
- export type NiconicoViewerHandle = {
- play: () => void
- pause: () => void
- seek: (time: number) => void
- mute: () => void
- unmute: () => void
- setVolume: (volume: number) => void
- showComments: () => void
- hideComments: () => void }
-
- export type Post = {
- id: number
- url: string
- title: string
- thumbnail: string
- thumbnailBase: string
- tags: Tag[]
- viewed: boolean
- related: Post[]
- originalCreatedFrom: string | null
- originalCreatedBefore: string | null
- createdAt: string
- updatedAt: string
- uploadedUser: { id: number; name: string } | null }
-
- export type PostTagChange = {
- post: Post
- tag: Tag | null
- user: User | null
- changeType: 'add' | 'remove'
- timestamp: string }
-
- export type SubMenuItem =
- | { component: ReactNode
- visible: boolean }
- | { name: string
- to: string
- visible?: boolean }
-
- export type Tag = {
- id: number
- name: string
- category: Category
- postCount: number
- createdAt: string
- updatedAt: string
- hasWiki: boolean
- children?: Tag[]
- matchedAlias?: string | null }
-
- export type Theatre = {
- id: number
- name: string | null
- opensAt: string
- closesAt: string | null
- createdByUser: { id: number; name: string }
- createdAt: string
- updatedAt: string }
-
- export type User = {
- id: number
- name: string | null
- inheritanceCode: string
- role: UserRole }
-
- export type ViewFlagBehavior = typeof ViewFlagBehavior[keyof typeof ViewFlagBehavior]
-
- export type WikiPage = {
- id: number
- title: string
- createdUserId: number
- updatedUserId: number
- createdAt: string
- updatedAt: string
- body: string
- revisionId: number
- pred: number | null
- succ: number | null }
-
- export type WikiPageChange = {
- revisionId: number
- pred: number | null
- succ: null
- wikiPage: Pick<WikiPage, 'id' | 'title'>
- user: Pick<User, 'id' | 'name'>
- kind: 'content' | 'redirect'
- message: string | null
- timestamp: string }
-
- export type WikiPageDiff = {
- wikiPageId: number
- title: string
- olderRevisionId: number | null
- newerRevisionId: number
- diff: WikiPageDiffDiff[] }
-
- export type WikiPageDiffDiff = {
- type: 'context' | 'added' | 'removed'
- content: string }
-
- export type UserRole = typeof USER_ROLES[number]
|