Typescript Definitions for pouchdb (v3.4.0+)
branch | build status |
---|---|
master | |
dev | |
feat |
- What this repo is: It is a dev repo; the structure of the d.ts module layout and interface naming may change significantly in the early stages of development.
- What this repo needs: Contributions and discussion.
The current DefinitelyTyped definition file for pouchdb seems to be for Pouch 0.1 (according to the version in the comments). This repo was created just as v3.4.0 was released.
To make typescript use of pouchdb:
- self-documenting through typescript intellisense;
- accessible through a single intuitive
new PouchDB(......)
call; - support both promise and callback style pouchdb calls; and
therefore to:
- type the results of callbacks and promises to allow easy discovery of the "next action";
- write documentation for each definition member;
- ensure robust multi-contributor definitions through CI; and to
- follow the DefinitelyTyped contribution guide.
Discussion, Issues and PRs encouraged.
- irc://freenode.net/#pouchdb
- https://gitter.im/AGBrown/pouchdb.d.ts.
- Issues here (regarding health warning 2 above: if there are issues then these will be retained in any repo rebuild)
The current dev methodology is to recreate the test files in the pouchdb/tests folder by building supporting defintions in pouchdb.d.ts and using the public pouchdb api docs to add "correctness" tests. Any changes to the definitions must therefore:
- Create a reliable replica of the relevant pouchdb/tests .js files †
- Include "correctness" tests in pouchdb-tests.ts
- Pass the travis build
† Currently this has to be "compared by eye": suggestions on improving this welcome
|--docs supporting documentation for this repo
|--tests replica test files of pouchdb/tests
| \--integration (example)
| |--test.basics.extra.ts (example) extra stuff required to make the test file build
| |--test.basics.ts (example) a replica test file of pouchdb/tests/integration/test.basics.js
| \--utils.d.ts (example) a replica definition file for pouchdb/tests/integration/utils.js
|--typings typings files to support tests, builds etc.
|--.travis.yml the travis CI settings file
|--license
|--package.json the npm package.json file
|--pouchdb-tests.ts The "correctness" tests for pouchdb.d.ts
\--pouchdb.d.ts The actual pouchdb definitions file
The readme-dt.md contains the final readme for the DefinitelyTyped repository