HeyPuter / kv.js

⚡️ Advanced in-memory caching for JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create Typescript typings

touhidrahman opened this issue · comments

NPM packages nowadays are developed using Typescript and type definitions are exported from the library so that methods and classes are typed. Since this library is entirely written in javascript, one of the following two can be picked to provide type definitions:

  1. Convert the library to typescript and export interfaces
  2. Submit type definitions to definitely typed repository so that consumers can add optional typings using npm install -D @types/heyputer__kvjs

Personally, and I believe most others as well, would like to see no. 1 picked and this library converted into a typescript one.

could you provide more info

could you provide more info

I have updated the description of the issue. Thank you.

Hi, I also agree that adding type definitions is a fantastic idea to support typescript out of the box. Also, at the risk of taking a slight tangent, I'd like to criticize this statement for the sake of mostly my own pedantic nature:

NPM packages nowadays are developed using Typescript and...

When I read this it seems to imply that other choices for developing npm packages are outdated or invalid. Even if this isn't what you meant to say, I'd like to dispute it anyway because I do think these statements have significant influence on the community.

Typescript is very successful and honestly fantastic in a enormous number of ways. However, just like languages that compile to assembly, java bytecode, or CIL; the frontend language you choose can be based on many factors. The popular choice is often a good choice, but not objectively the correct choice. For something like this, ES6 works great.

Closed by #9