0
我試圖覆蓋Response
類型的節點快速send
方法。 的方法是Send
類型被定義爲這樣的:使用混合接口的Typescript覆蓋快速發送功能
interface Send {
(status: number, body?: any): Response;
(body?: any): Response;
}
我的目標是增加響應的本地記錄與寄快件,但我不能讓這種類型的實現,甚至作爲一個功能就像在其他問題like this中解釋的那樣。
雖然技術上是正確的,則'=(...)=>'格式結合'this'當前類在我的設置中,使其無法使用快速發送功能。相反,我找到並使用了[express-mung](https://www.npmjs.com/package/express-mung),實現了我最初想做的事情。 – nonelse