Where is this intellisense coming from?
In VSCODE I see the following intellisense:

When exploring node_modules/sanctuary/index.js, I find a function toMaybe, but it doesn't appear the definition is coming from here because they do not match
Two questions:
The programming language TypeScript, a superset of JavaScript, allows definitions for proper types on functions and variables. TypeScript can be compiled down to JavaScript, which removes all type annotations, and a seperate type definition file (*.d.ts) can be exported during transpiliation. TypeScript type definitions are nowadays commonly provided for JS modules either directly in the module repository itself or as part of the DefinitelyTyped repository.
To get such type annotations for your own code, you can either write your code in TypeScript in the first place or write additional custom type definition files by yourself.
This is not the only way to write type definitions, but at the moment the most prominent one.
Edit: Ok, I did not really look into the package that you've mentioned earlier. But I've tried it out, and this is the IntelliSense annotation, which it gives to me.
And this seems to be coming from the TS typing:
toMaybe<A>(p: A | null | undefined): Maybe<A>;
These typings are located at https://www.npmjs.com/package/@types/sanctuary.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.