chore: 統一 可選成員 寫法

This commit is contained in:
CrescentLeaf
2025-09-14 14:31:53 +08:00
parent 4cc4866db1
commit 2b54a7a13a
3 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
export default class RecentChat {
declare id: string
declare title: string
declare avatar: string | null
declare avatar?: string
declare content: string
}

View File

@@ -106,7 +106,7 @@ export default class User {
User.database.prepare(`UPDATE ${User.table_name} SET ${key} = ? WHERE count = ?`).run(value, this.bean.count)
this.bean[key] = value
}
getUserName(): string | null {
getUserName() {
return this.bean.username
}
setUserName(userName: string) {

View File

@@ -2,10 +2,10 @@ export default class UserBean {
declare count: number
declare id: string
declare password: string
declare username: string | null
declare username?: string
declare registered_time: number
declare nickname: string
declare avatar_file_hash: string | null
declare avatar_file_hash?: string
declare settings: string
[key: string]: unknown