Files
core/packages/api-client/models/comment.ts
Innei 34d8d3f41b fix: add types in comment
Signed-off-by: Innei <i@innei.in>
2023-06-28 14:43:52 +08:00

46 lines
736 B
TypeScript

import type { BaseModel } from './base'
import type { CategoryModel } from './category'
export enum RefType {
Page = 'Page',
Post = 'Post',
Note = 'Note',
}
export interface CommentModel extends BaseModel {
refType: RefType
ref: string
state: number
commentsIndex: number
author: string
text: string
mail?: string
url?: string
ip?: string
agent?: string
key: string
pin?: boolean
avatar: string
parent?: CommentModel | string
children: CommentModel[]
isWhispers?: boolean
location?: string
source?: string
}
export interface CommentRef {
id: string
categoryId?: string
slug: string
title: string
category?: CategoryModel
}
export enum CommentState {
Unread,
Read,
Junk,
}