quibble icon indicating copy to clipboard operation
quibble copied to clipboard

TypeScript Support

Open wellwelwel opened this issue 11 months ago • 1 comments

First of all, thank you for this project!

It's amazing, I could easily create a mock for both ESM and CJS with the same code, by just changing from quibble() to quibble.esm()

Also, it's really great that we can use quibble with the native Node.js CLI (node ./my-file.js) 🚀


About Typings

I would like to ask if a PR introducing typings (an index.d.ts, for example) would be welcome 🙋🏻‍♂️


Why

To use quibble in a TypeScript project, first I need to create an any for it by creating a quibble.d.ts in the same level as the src, for example:

declare module 'quibble' {
  const quibble: any;
  export default quibble;
}

wellwelwel avatar Feb 28 '24 08:02 wellwelwel

Thanks for the note. I don't use typescript, but if someone was willing to take on the task of doing it well I'd appreciate it. I'd probably point them to testdouble.js, where the community has provided a typing file that's been iterated on over time, as a starting point

searls avatar Feb 28 '24 11:02 searls