[英]Why do some types in Flow libdefs have dollar sign in the begining
Some libdefs in flow-typed
respository have types, started with the dollar sign, like $AxiosXHR
: flow-typed
存储库中的一些libdef具有类型,以美元符号$AxiosXHR
,如$AxiosXHR
:
It looks like it declares globally available type, but I am not sure, and I haven't found any documentation about it. 看起来它声明了全局可用类型,但我不确定,我还没有找到任何关于它的文档。
Right now there's not a good way to write types inside declare module {}
bodies that aren't exported, so the best option is to put a declaration outside the declare module {}
and reference it. 现在,没有一种很好的方法可以在未导出的
declare module {}
体内编写类型,因此最好的选择是在declare module {}
之外放置一个声明并引用它。
To prevent clashing names, it's a convention to put something like $npm$ModuleName$
before the type/var name. 为了防止冲突名称,在类型/ var名称之前添加
$npm$ModuleName$
之类的约定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.