Typescript enforce function argument is instance of class

后端 未结 0 785
天涯浪人
天涯浪人 2021-02-01 00:44

What should I do to declare a function that take a class instance as argument

class Message{
    constructor(readonly text:string){}
}



function publish(message         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题