2024年6月11日

Typescript参数类型约束

摘要: 场景需求: 最近在写库的时候,遇到了这么一个需求,我想限制调用者参数输入,首先有这么一个方法,接收两个参数,第二个参数根据第一参数来变化。 先看代码 class Subscription{ type:string; topic: string; constructor(type: string, t 阅读全文

posted @ 2024-06-11 23:16 luyifo 阅读(23) 评论(0) 推荐(0)

导航