Merge pull request #24223 from BehindTheMath/sqlite3-add-verbose-return

[sqlite3] Add return type for .verbose()
This commit is contained in:
Nathan Shively-Sanders
2018-03-27 13:49:45 -07:00
committed by GitHub
2 changed files with 16 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
// Project: https://github.com/mapbox/node-sqlite3
// Definitions by: Nick Malaguti <https://github.com/nmalaguti>
// Sumant Manne <https://github.com/dpyro>
// Behind The Math <https://github.com/BehindTheMath>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -87,4 +88,15 @@ export class Database extends events.EventEmitter {
configure(option: "busyTimeout", value: number): void;
}
export function verbose(): void;
export function verbose(): sqlite3;
export interface sqlite3 {
OPEN_READONLY: number;
OPEN_READWRITE: number;
OPEN_CREATE: number;
cached: typeof cached;
RunResult: RunResult;
Statement: typeof Statement;
Database: typeof Database;
verbose(): this;
}

View File

@@ -1,7 +1,7 @@
import sqlite3 = require('sqlite3');
sqlite3.verbose();
import * as sqlite from 'sqlite3';
const sqlite3 = sqlite.verbose();
let db: sqlite3.Database = new sqlite3.Database('chain.sqlite3', () => {});
let db: sqlite.Database = new sqlite3.Database('chain.sqlite3', () => {});
function createDb() {
console.log("createDb chain");