简体   繁体   English

为什么Flow libdefs中的某些类型在开头就有美元符号

[英]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$之类的约定。

Ref: flow-typed CONTRIBUTING notes 参考: flow-typed贡献说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我在JavaScript中的某些构造函数之前看到一个美元符号? - Why do I see a dollar sign before some constructors in JavaScript? 为什么ace编辑器对某些对象属性使用美元符号? - Why does ace editor use dollar sign for some object properties? 具有更深路径的库的流libdefs - Flow libdefs for libraries with deeper paths Flow 的 libdefs 中 $Export 变量的含义是什么? - What is the meaning of $Export variable in Flow's libdefs? 为什么字符串中的美元符号和括号不起作用? Javascript/npm/反应 - Why dollar sign and brackets inside string do not work? Javascript/npm/react JSON密钥中的美元符号(。$。)有什么作用? - What does a dollar sign (.$.) in a JSON key do? 插入某些脚本后,美元符号返回null - after inserting some script the dollar sign returns null 如何将包含美元符号“$”的两个值相加? 我一直试图找出方法和属性,仍然没有线索 - How do you sum two values containing the dollar sign “$”? I have been trying to figure out the methods and properties, still no clue 为什么有时在Javascript中有函​​数参数之前的美元符号($ arg)? - Why sometimes in Javascript there is the dollar sign ($arg) before function argument? 为什么美元符号不再“仅用于机械生成的代码中?” - Why is the dollar sign no longer “intended for use only in mechanically generated code?”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM