数据类型声明 #45

This commit is contained in:
728
2023-11-01 12:29:41 +08:00
parent aa4a89231a
commit 0c508fcfec
2 changed files with 57 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# 【从零开发】主义主义网站 系列视频
# 【从零开发】主义主义网站
[视频列表](https://space.bilibili.com/483417795/video)
## [系列视频](https://space.bilibili.com/483417795/video)

55
typ.ts Normal file
View File

@ -0,0 +1,55 @@
export type Id = {
_id: number,
utc: number,
nam: string,
adm1: string,
adm2: string,
msg: string,
}
export type Usr = Id & {
nbr?: string,
sms?: { code: number, utc: number },
jwt?: string,
}
export type Soc = Id & {
sec: Usr["_id"][],
agr: { msg: string, utc: number },
}
export type Agd = Id & {
soc: Soc["_id"],
}
export type Rec = {
_id: { usr: Usr["_id"], soc: Soc["_id"], utc: number },
msg: string,
amt: number,
sec?: Usr["_id"],
}
export type Cdt = Rec & {
utc: { eft: number, exp: number, agr: number },
aug?: { msg: string, amt: number, utc: number, sec: Usr["_id"] }[],
}
export type Dbt = Rec & {
rev?: { msg: string, rev: 1 | 2 | 3 | 4 | 5, utc: number },
}
export type Ern = Rec
export type Msg = {
_id: number,
nam: string,
utc: { pre: number, put: number },
usr: Usr["_id"],
msg: string,
pin?: true,
}
export type Wsl = Msg
export type Lit = Msg
export type Aut = {
_id: 1,
sup: Usr["_id"][], // super supreme 超级用户
aut: Usr["_id"][], // author 管理员
wsl: Usr["_id"][], // 编辑
lit: Usr["_id"][], // 编辑
}