mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
add sybase-promised types (#37768)
* Add types for num2fraction * add sybase-promised types
This commit is contained in:
parent
986a0c966b
commit
75a3799a51
27
types/sybase-promised/index.d.ts
vendored
Normal file
27
types/sybase-promised/index.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// Type definitions for sybase-promised 1.0
|
||||
// Project: https://github.com/mscamargo/sybase-promised#readme
|
||||
// Definitions by: Sergey12313 <https://github.com/sergey12313>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace sybasepromised;
|
||||
|
||||
declare namespace SybasePromised {
|
||||
interface ConnectionOptions {
|
||||
host: string;
|
||||
port: number;
|
||||
dbname: string;
|
||||
username: string;
|
||||
password: string;
|
||||
logTiming?: boolean;
|
||||
pathToJavaBtidge?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare class SybasePromised {
|
||||
constructor(options: SybasePromised.ConnectionOptions);
|
||||
connect(): Promise<this>;
|
||||
query(sql: string): Promise<any[]>;
|
||||
disconnect(): void;
|
||||
}
|
||||
|
||||
export = SybasePromised;
|
||||
18
types/sybase-promised/sybase-promised-tests.ts
Normal file
18
types/sybase-promised/sybase-promised-tests.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import Sybase = require("sybase-promised");
|
||||
|
||||
const config: Sybase.ConnectionOptions = {
|
||||
dbname: "testDb",
|
||||
host: "127.0.0.1",
|
||||
password: "password",
|
||||
port: 3223,
|
||||
username: "user",
|
||||
};
|
||||
|
||||
const sql = "SELECT * FROM test1";
|
||||
|
||||
(async () => {
|
||||
const connection = new Sybase(config);
|
||||
await connection.connect();
|
||||
const result: string[] = await connection.query(sql);
|
||||
connection.disconnect();
|
||||
})();
|
||||
24
types/sybase-promised/tsconfig.json
Normal file
24
types/sybase-promised/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"target": "es2015",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sybase-promised-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/sybase-promised/tslint.json
Normal file
1
types/sybase-promised/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user