Skip to content

Commit adaaa3b

Browse files
committed
Updates the Typescript types from @DefinitelyTyped and adds them to this package.
I elected to create the Typescript types by creating ordinary .ts files and compiling them. My reasoning is that more TS developers are familiar with regular .ts rather than the extra syntax in .d.ts files. I also updated the API documentation to fix some wording and typos, update the API signatures, and create a table of contents organized by object name. I also updated the examples to use more modern JS and variable names based on the class names. Signed-off-by: Andre Asselin <andre.asselin@primerica.com>
1 parent 09141fc commit adaaa3b

20 files changed

+1739
-516
lines changed

APIDocumentation.md

+512-505
Large diffs are not rendered by default.

build.zip

-6.16 MB
Binary file not shown.

package-lock.json

+44-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "IBM DB2 and IBM Informix bindings for node",
44
"version": "3.3.0",
55
"main": "lib/odbc.js",
6+
"types": "typescript/dist/index.d.ts",
67
"homepage": "https://github.com/ibmdb/node-ibm_db/",
78
"repository": {
89
"type": "git",
@@ -23,7 +24,8 @@
2324
},
2425
"scripts": {
2526
"install": "node installer/driverInstall.js",
26-
"test": "cd test && node run-tests.js"
27+
"test": "cd test && node run-tests.js",
28+
"build:types": "tsc -p typescript/tsconfig.json"
2729
},
2830
"dependencies": {
2931
"adm-zip": "^0.5.16",
@@ -45,9 +47,10 @@
4547
"author": "IBM",
4648
"license": "MIT",
4749
"devDependencies": {
48-
"@types/node": "^22.13.4",
50+
"@types/node": "^22.13.10",
4951
"async": "^3.2.4",
5052
"bluebird": "^3.7.2",
51-
"moment": "^2.29.4"
53+
"moment": "^2.29.4",
54+
"typescript": "^5.8.2"
5255
}
5356
}

typescript/ConnStr.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export interface ConnStr {
2+
DATABASE: string;
3+
HOSTNAME: string;
4+
PORT: number | string;
5+
PROTOCOL: string;
6+
UID: string;
7+
PWD: string;
8+
}

typescript/DB2Error.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export interface DB2Error extends Error {
2+
sqlcode: number;
3+
sqlstate: string;
4+
resultset?: Array<null | number | Buffer | string>;
5+
}

0 commit comments

Comments
 (0)