mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
Merge pull request #24223 from BehindTheMath/sqlite3-add-verbose-return
[sqlite3] Add return type for .verbose()
This commit is contained in:
14
types/sqlite3/index.d.ts
vendored
14
types/sqlite3/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user