react-url-query icon indicating copy to clipboard operation
react-url-query copied to clipboard

Typescript?

Open toddmedema opened this issue 7 years ago • 7 comments

Excited to use this library! Would it be possible to get a Typescript definition for it? Running into Could not find a declaration file for module 'react-url-query'

toddmedema avatar Apr 25 '17 01:04 toddmedema

Happy to merge a PR with it, I don't have much TypeScript experience.

pbeshai avatar May 11 '17 17:05 pbeshai

I've created the typings for my own project, so will try to finalise them over the coming week and submit a PR.

@pbeshai would you rather maintain the typings file as part of react-url-query or do you prefer to have it defined in https://github.com/DefinitelyTyped/DefinitelyTyped?

kujon avatar Dec 15 '17 12:12 kujon

For what it's worth, I'm a fan of projects that include typings in their repos. Much easier to keep types in step with the code, and package.json would become massive and unweildy if every packaged force you to have a mirror type package.

toddmedema avatar Dec 15 '17 14:12 toddmedema

@kujon Were you ever able to finalize your typings for a PR by chance?

u10int avatar Feb 23 '18 23:02 u10int

I'll probably get to this soon... for now I'm just doing the following in a TypeScript project:

declarations.d.ts

declare module "react-url-query";

Just getting my feet wet, but hope to have something soon!

pbeshai avatar Jun 06 '18 15:06 pbeshai

@u10int we did finalise it to the point where they are useful inside of our company but very lacking in other areas.

I'm not happy enough with it to make it part of this repo or DefinitelyTyped, but feel free to use it as a starting point.

Here's the Gist: https://gist.github.com/kujon/c84b47573af7900fd9467f2d022f2427

kujon avatar Jun 06 '18 16:06 kujon

Update here, sorry I haven't gotten around to updating this library yet to have types. I've put together a new lib using hooks that is written in TypeScript:

https://github.com/pbeshai/use-query-params

Should be able to port some of the typing I did there to this library

pbeshai avatar Mar 15 '19 17:03 pbeshai