diff --git a/client-protocol/bean/BaseChatSettingsBean.ts b/client-protocol/bean/BaseChatSettingsBean.ts new file mode 100644 index 0000000..074b789 --- /dev/null +++ b/client-protocol/bean/BaseChatSettingsBean.ts @@ -0,0 +1,5 @@ +interface BaseChatSettings { + [key: string]: unknown +} + +export default BaseChatSettings diff --git a/client-protocol/bean/ChatBean.ts b/client-protocol/bean/ChatBean.ts index 4b1de08..eabae02 100644 --- a/client-protocol/bean/ChatBean.ts +++ b/client-protocol/bean/ChatBean.ts @@ -1,3 +1,4 @@ +import BaseChatSettingsBean from "./BaseChatSettingsBean.ts" import ChatType from "./ChatType.ts" export default class ChatBean { @@ -5,7 +6,7 @@ export default class ChatBean { declare id: string declare title: string declare avatar_file_hash?: string - declare settings?: { [key: string]: unknown } + declare settings?: BaseChatSettingsBean declare is_member: boolean declare is_admin: boolean diff --git a/client-protocol/bean/GroupSettingsBean.ts b/client-protocol/bean/GroupSettingsBean.ts index 3adface..5ae3f0e 100644 --- a/client-protocol/bean/GroupSettingsBean.ts +++ b/client-protocol/bean/GroupSettingsBean.ts @@ -1,4 +1,6 @@ -interface GroupSettingsBean { +import BaseChatSettings from "./BaseChatSettingsBean.ts" + +interface GroupSettingsBean extends BaseChatSettings { allow_new_member_join?: boolean allow_new_member_from_invitation?: boolean new_member_join_method?: 'disabled' | 'allowed_by_admin' | 'answered_and_allowed_by_admin' @@ -7,8 +9,6 @@ interface GroupSettingsBean { // 下面两个比较特殊, 由服务端给予 group_title: string group_name: string - - [key: string]: unknown } export default GroupSettingsBean