主题预览

色调:

如果您使用的浏览器过时,不支持OKLCH颜色。颜色设置会不生效。

轻盈的鱼
幻想变成轻盈的鱼, 畅游在自由的海洋

ts-types

未分类
1653 字

ARTICLE

export interface ARTICLE {
  id: string
  title: string
  alias: string
  cover: string
  created_time: string
  date?: string
  updated_time: string
  updated?: string
  categories: Array<string>
  tags: Array<string>
  excerpt: string
  published: boolean
  content: string
  mdContent: string
  toc: string
  created_timestamp: number
  updated_timestamp: number
  url: string
  symbolsCount: number

  [key: string]: string | Array<string> | boolean | number
}

POST

import { PAGE } from './page'
import { ARTICLE } from './article'

export interface POST extends ARTICLE {}

export type LIST_POST_ITEM = Omit<POST, 'content' | 'mdContent' | 'toc'>

export type ARCHIVES_DATE_YEAR = { [date: string]: LIST_POST_ITEM[] }[]

export type ARCHIVES_DATE_YEAR_MONTH = { [date: string]: ARCHIVES_DATE_YEAR }[]

export type POST_PAGE_QUERY = {
  pageIndex: number
  pageCount: number
  prevPageIndex: number
  nextPageIndex: number
  pageSize: number
  postList: Omit<PAGE, 'content' | 'mdContent' | 'toc'>[]
}

PAGE

import { ARTICLE } from './article'

export interface PAGE extends ARTICLE {}

export type LIST_PAGE_ITEM = Omit<PAGE, 'content' | 'mdContent' | 'toc'>

CATEGORY

export interface CATEGORY {
  id: string
  title: string
  description: string
  url: string
}

export type CATEGORY_WITH_POST_NUM = CATEGORY & {
  postNum: number
}

TAG

export interface TAG {
  id: string
  title: string
  description: string
  url: string
}

export type TAG_WITH_POST_NUM = TAG & {
  postNum: number
}

POST_CATEGORY

export interface POST_CATEGORY {
  postId: string
  categoryId: string
  id: string
}

POST_TAG

export interface POST_TAG {
  postId: string
  tagId: string
  id: string
}

CONFIG

export interface CONFIG {
  [key: string]: string | number | boolean | object
}

JSON

export interface JSON_OBJ {
  [key: string]: any
}