RickStrahl / jquery-resizable

A small jQuery plug-in to make DOM components resizable
MIT License
234 stars 91 forks source link

package.json missing types: ? #46

Open matti777 opened 2 years ago

matti777 commented 2 years ago

I'm trying to use this wonderful plugin in a Typescript / Webpack project and it would appear it is not finding the Typescript definitions (eg. the resizable() function for the JQuery interface). I did a little digging and it would appear that package.json should (could) have a types: property to indicate where the TS type definitions are located (see: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html).

So something like:

"types": "./dist/jquery-resizable.d.ts",

Unless I'm mistaken. Or is there another way to do this? Still a bit fresh with typescript/webpack here.

EDIT: Can make it work by adding a reference to index.d.ts:

/// <reference types="jquery-resizable-dom/dist/jquery-resizable.js" />