# Gnanesh Kunal

y² mod p = ⟮x³ +7⟯ mod p

# Using JavaScript packages that doesn't have types

I write JavaScript, your write JavaScript, everyone writes JavaScript. I write TypeScript, but you may not write TypeScript.

"Oh!! Who cares?"

"We do.

"If that's the case, use an alternate library, you know, each second, a shit JS library is born OUTTA NOWHERE."

JavaScript has too many packages that it even has two Google Maps Library(React). But only one of the library has Type Definitions. It's a pain to write your own definition file. You could dig the source code and contribute a type file or you could simply write a minimal one with functions that you use. Type file is almost all similar to a TS interface.

A basic definition file would be like:

// yourLibrary.d.ts
declare module yourLibrary {
export interface objectName {
prop: type
}
}


// someFile.ts
/// <reference path="./path/yourLibrary.d.ts" />


But I've so many packages and writing a definition file for each package is tedious. I just want an ONE VS. ALL way.

// index.d.ts
declare module "*";


// someFile.ts