简体   繁体   中英

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 :

在此输入图像描述

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.
To prevent clashing names, it's a convention to put something like $npm$ModuleName$ before the type/var name.

Ref: flow-typed CONTRIBUTING notes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM