![](/img/trans.png)
[英]JSDOC: How to override/redefine type of a property from an existing type?
[英]How to redefine type for an existing function in Typescript
此处的解决方案https://www.albertgao.xyz/2016/08/11/how-to-declare-a-function-type-variable-in-typescript/需要定义一个表达式,这不是我想要的。 我想要的是将现有的 function 声明为任何类似的东西,除了语法无效:
function f() {} as any;
f.someProperty = "I want to do this without squizzle in vscode";
目标是避免 VScode 中的 squizzle。
这对你有用吗?
const f = function () {} as any;
f.someProperty;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.