Skip to content

Commit

Permalink
fix: 修改 部分可选字段的类型声明
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Nov 19, 2024
1 parent 6839864 commit 5d46d07
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/interfaces/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ export type ConfigSchema<T = Config> = {
// 字段描述
description?: string
// 字段是否必填
required: IsRequired<Pick<T, K>>
required: boolean // IsRequired<Pick<T, K>>
// 字段默认值
default?: T[K]
// 字段选项,仅当字段类型为 select 时有效
options?: IsUnion<T[K]> extends true ? {
options?: {
// 选项名称
label: string
// 选项值
value: T[K] // 选项值的类型跟字段的类型一致
}[] : never
}[]
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/push/dingtalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type TempDingtalkOption = {
feedCard?: FeedCard['feedCard']

at?: Text['at']
// [key: string]: any
[key: string]: any
}

export type DingtalkOptionSchema = OptionSchema<TempDingtalkOption>
Expand Down
2 changes: 1 addition & 1 deletion src/push/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type DiscordOption = {
* 机器人头像的 Url
*/
avatar_url?: string
// [key: string]: any
[key: string]: any
}

export type DiscordOptionSchema = OptionSchema<DiscordOption>
Expand Down
2 changes: 1 addition & 1 deletion src/push/i-got.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface IGotOption {
* 主题; 订阅链接下有效;对推送内容分类,用户可选择性订阅
*/
topic?: string
// [key: string]: any
[key: string]: any
}

export type IGotOptionSchema = OptionSchema<IGotOption>
Expand Down
2 changes: 1 addition & 1 deletion src/push/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface TelegramOption {
* 可选的唯一标识符,用以向该标识符对应的话题发送消息,仅限启用了话题功能的超级群组可用
*/
message_thread_id?: string
// [key: string]: any
[key: string]: any
}

export type TelegramOptionSchema = OptionSchema<TelegramOption>
Expand Down
2 changes: 1 addition & 1 deletion src/push/wechat-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export type WechatAppOption = {
enable_duplicate_check?: 0 | 1
// 表示是否重复消息检查的时间间隔,默认1800s,最大不超过4小时
duplicate_check_interval?: number
// [key: string]: any
[key: string]: any
// 指定接收消息的成员,成员ID列表(多个接收者用‘|’分隔,最多支持1000个)。
// 特殊情况:指定为"@all",则向该企业应用的全部成员发送
touser?: string
Expand Down
2 changes: 1 addition & 1 deletion src/push/wechat-robot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const wechatRobotConfigSchema: WechatRobotConfigSchema = {

export interface WechatRobotOption {
msgtype?: WechatRobotMsgType
// [key: string]: any
[key: string]: any
}
export type WechatRobotOptionSchema = OptionSchema<WechatRobotOption>
export const wechatRobotOptionSchema: WechatRobotOptionSchema = {
Expand Down

0 comments on commit 5d46d07

Please sign in to comment.