pouchdb / upsert

PouchDB plugin for upsert() and putIfNotExists() functions
Apache License 2.0
149 stars 25 forks source link

[feat] Typescript definition #24

Closed keithdmoore closed 7 years ago

keithdmoore commented 7 years ago

I realize Typescript definitions belong in the DefinitelyTyped library. I am new to both Typescript and PouchDB. I would like to use this upsert library and I wouldn't mind adding the Typings to DefinitelyTyped library for it but I am not really sure how to do it.

nolanlawson commented 7 years ago

I belive you just open a PR on DefinitelyTyped, yes? https://github.com/definitelytyped/definitelytyped

Looks like they have one directory per npm package, so you'd just create a directory called pouchdb-upsert and put the typings in there.

keithdmoore commented 7 years ago

I understand the process. I am not sure how to define the Typings for the plugin. I dont see any good examples for what I am trying to do there. It's not an adapter, there are plenty of those there.

nolanlawson commented 7 years ago

Sorry, I'd help, but I don't know much about TypeScript...

keithdmoore commented 7 years ago

Thanks nolan, no worries. I am going to take a stab at it. By the way, thanks for writing pouchdb!

keithdmoore commented 7 years ago

PR submitted in https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10596

keithdmoore commented 7 years ago

PR approved. You can now access the typings via $ typings search pouchdb-upsert