Why do some types in Flow libdefs have a dollar sign at the beginning

Some libdefs in the repository flow-typedhave types starting with a dollar sign, for example $AxiosXHR:

enter image description here

It looks like it is declaring a globally accessible type, but I'm not sure, and I have not found any documentation about this.

+4
source share
1 answer

Right now there is no good way to write types inside bodies declare module {}that are not exported, so it’s best to put the declaration outside declare module {}and reference it.
To prevent names from matching, this is a convention to put something like $npm$ModuleName$before the name type / var.

Reference: flow-typedWRITING NOTES

+4
source

Source: https://habr.com/ru/post/1690954/


All Articles