函数 validateKuaishouParams
validateKuaishouParams< T extends | "comments" | "liveRoomInfo" | "emojiList" | "userProfile" | "videoWork" | "userWorkList",>( methodType: T, params: unknown,): output< { videoWork: ZodType< { methodType: "videoWork"; photoId: string }, unknown, $ZodTypeInternals<{ methodType: "videoWork"; photoId: string }, unknown>, >; comments: ZodType< { methodType: "comments"; photoId: string }, unknown, $ZodTypeInternals<{ methodType: "comments"; photoId: string }, unknown>, >; userProfile: ZodType< { methodType: "userProfile"; principalId: string }, unknown, $ZodTypeInternals< { methodType: "userProfile"; principalId: string }, unknown, >, >; userWorkList: ZodType< { methodType: "userWorkList"; principalId: string; pcursor?: string; count?: number; }, unknown, $ZodTypeInternals< { methodType: "userWorkList"; principalId: string; pcursor?: string; count?: number; }, unknown, >, >; liveRoomInfo: ZodType< { methodType: "liveRoomInfo"; principalId: string }, unknown, $ZodTypeInternals< { methodType: "liveRoomInfo"; principalId: string }, unknown, >, >; emojiList: ZodType< { methodType: "emojiList" }, unknown, $ZodTypeInternals<{ methodType: "emojiList" }, unknown>, >; }[T],> 类型参数
- T extends
| "comments"
| "liveRoomInfo"
| "emojiList"
| "userProfile"
| "videoWork"
| "userWorkList"
参数
- methodType: T
- params: unknown
返回 output<
{
videoWork: ZodType<
{ methodType: "videoWork"; photoId: string },
unknown,
$ZodTypeInternals<{ methodType: "videoWork"; photoId: string }, unknown>,
>;
comments: ZodType<
{ methodType: "comments"; photoId: string },
unknown,
$ZodTypeInternals<{ methodType: "comments"; photoId: string }, unknown>,
>;
userProfile: ZodType<
{ methodType: "userProfile"; principalId: string },
unknown,
$ZodTypeInternals<
{ methodType: "userProfile"; principalId: string },
unknown,
>,
>;
userWorkList: ZodType<
{
methodType: "userWorkList";
principalId: string;
pcursor?: string;
count?: number;
},
unknown,
$ZodTypeInternals<
{
methodType: "userWorkList";
principalId: string;
pcursor?: string;
count?: number;
},
unknown,
>,
>;
liveRoomInfo: ZodType<
{ methodType: "liveRoomInfo"; principalId: string },
unknown,
$ZodTypeInternals<
{ methodType: "liveRoomInfo"; principalId: string },
unknown,
>,
>;
emojiList: ZodType<
{ methodType: "emojiList" },
unknown,
$ZodTypeInternals<{ methodType: "emojiList" }, unknown>,
>;
}[T],
>
验证后的参数,符合原始API期望的类型
验证快手参数