Closed haiwen-shaw closed 5 years ago
I have just added a pull request to DefinitelyTyped/DefinitelyTyped#7697 to add oracle.d.ts []s
@Bigous Nice one!
Pull was merged... I think we could close this one.
Now, where should this be documented?!
DefinetlyTyped is a facilitator only. It holds files .d.ts that original projects do not release or maintain. I think that if it's gonna be there, we could only mention it on README.md. Something like:
Instalation:
$ npm install -g tsd
$ tsd init
$ tsd query oracledb --resolve --action install --save
If we choose to bring it to oracledb itself on next release, we should add an index.d.ts at the root of package with the content of oracledb.d.ts. Then I think we should mention it on o README.md and improve it with the content of API.md (complete the code documentation). In this case, no other installation is necessary... just the npm install oracledb
. But I don't know about the dependency (it uses node.d.ts
because our Lob object inherits stream.Duplex... with tsd
the --resolve
gets the dependency and installs it together).
Found out (angular2 project is an example) that we can have a typings directory inside our repo and install tsd dependencies on it, like node.d.ts, and have it all packaged here... @cjbj If you'd like, I could move the definitions to this repo ... it occurred with angular2 too... definitions until version alfa-something is on tsd and after that is on main angular2 repo... So, we could have the definitions for version 1.5 at tsd, and after that, here. What do you think?
@Bigous I don't see a problem with adding it to node-oracledb. Submit a PR?
Overall, we need to find a way to machine-generate API doc. I know @dmcghan was enthused today by http://documentation.js.org/
Yes, @jed let me know about it today! I like that it covers the C/C++ and JavaScript (ES6).
@sagiegurari what do you think? You use JSDoc to Markdown, right? documentationjs seems to use the same syntax...
@cjbj mentioned having both reference docs and user guides. This could help automate the reference docs.
definitions for oracledb module on DefinitelyTyped are for version 1.5, though the actual module version is 1.10 (supporting promises etc). Will the actual typescript definitions be mantained by oracle?
@wallride I'd be happy for someone in the community to look after typescript definitions
Hi @wallride,
The actual one I've submitted. But it clearly needs an update. This week I'm with my agenda full, if you can, you could update it, but i'll try to update it next week.
[]'s
Sorry about the delay, but today I've submitted an updated pull request to definitely typed repo.
As soon as it is accepted, version 1.10.x is now supported.
Added to typings registry too. TSD is deprecated in favor of typings so, typings is the recommended way to install .d.ts The pull (typings/registry#561) was already accepted, so it's available. To use it:
typings install oracledb --save
typings install env~node --save --global
[]'s
Updated typescript definitions on typings registry to v1.11.0
Thanks @Bigous
All right, now that Typescript 2.0 was released, they have standardized the npm registry as the main source of typescript definitions. One should make a PR to the types-2.0 branch of DefinitelyTyped and it automagically goes to npm @types/XXXXX . I'll keep my repository to update the definitions Bigous/typed-oracledb, but you can publish updates directly to DefinitelyTyped (at branch types-2.0). So, I've published the last version to DefinitelyTyped and it is now available at npm here. If you want to use it, just do
npm install @types/oracledb
and you are ready to go.
[]'s
@Bigous I guess I should make PR to the master branch now. According to https://github.com/DefinitelyTyped/DefinitelyTyped#what-exactly-is-the-relationship-between-this-repository-and-the-types-packages-on-npm
The master branch is automatically published to the @types scope on NPM thanks to types-publisher. This usually happens within an hour of changes being merged.
A link from @connorjayfitzgerald via the Slack channel: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/35127
And the typescript update for node-oracledb 3.1 was published and is available https://www.npmjs.com/package/@types/oracledb Thanks @connorjayfitzgerald !
No problem 👍🏻
I will close this old issue. @connorjayfitzgerald has been doing a great job of maintaining the typescript definitions. See https://github.com/oracle/node-oracledb/issues/1136
I think using javascript is not good for a complex project, and the typescript seems pretty awesome for handling it. but it need .d.ts file to call node-oracledb. will oracle provide typescript type definition file (.d.ts) ? thanks!