add sybase-promised types (#37768)

* Add  types for num2fraction

* add sybase-promised types
This commit is contained in:
sergey12313 2019-08-21 00:21:58 +03:00 committed by Sheetal Nandi
parent 986a0c966b
commit 75a3799a51
4 changed files with 70 additions and 0 deletions

27
types/sybase-promised/index.d.ts vendored Normal file
View 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;

View 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();
})();

View 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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }