函数 validateKuaishouParams
validateKuaishouParams<T extends "单个视频作品数据" | "评论数据" | "Emoji数据">( methodType: T, params: unknown,): | { methodType: "单个视频作品数据"; photoId: string } | { methodType: "评论数据"; photoId: string } | { methodType: "Emoji数据" } 类型参数
- T extends "单个视频作品数据" | "评论数据" | "Emoji数据"
参数
- methodType: T
- params: unknown
返回
| { methodType: "单个视频作品数据"; photoId: string }
| { methodType: "评论数据"; photoId: string }
| { methodType: "Emoji数据" }
验证后的参数,符合原始API期望的类型
- { methodType: "单个视频作品数据"; photoId: string }
methodType: "单个视频作品数据"
photoId: string
- { methodType: "评论数据"; photoId: string }
methodType: "评论数据"
photoId: string
- { methodType: "Emoji数据" }
验证快手参数