mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Fix lint and test errors
This commit is contained in:
Vendored
+5
-20
@@ -1,8 +1,9 @@
|
||||
// Type definitions for massive 3.0.0-rc1
|
||||
// Type definitions for massive 3.0
|
||||
// Project: https://github.com/dmfay/massive-js.git
|
||||
// Definitions by: Pascal Birchler <https://github.com/swissspidy>
|
||||
// Clarence Ho <https://github.com/clarenceh>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@@ -14,9 +15,7 @@ declare function massive(
|
||||
driverConfig?: object): Promise<massive.Database>;
|
||||
|
||||
declare namespace massive {
|
||||
|
||||
export interface ConnectionInfo {
|
||||
|
||||
interface ConnectionInfo {
|
||||
user?: string;
|
||||
database?: string;
|
||||
password?: string | null;
|
||||
@@ -25,33 +24,19 @@ declare namespace massive {
|
||||
ssl?: boolean;
|
||||
application_name?: string;
|
||||
fallback_application_name?: boolean;
|
||||
|
||||
}
|
||||
|
||||
export interface Database {
|
||||
|
||||
attach(ctor: any, ...sources: Array<any>): Promise<any>;
|
||||
|
||||
interface Database {
|
||||
attach(ctor: any, ...sources: any[]): Promise<any>;
|
||||
detach(entity: string, collection: string): void;
|
||||
|
||||
reload(): void;
|
||||
|
||||
query(query: any, params: any, options: any): Promise<any>;
|
||||
|
||||
saveDoc(collection: any, doc: any): any;
|
||||
|
||||
createDocumentTable(path: any): Promise<any>;
|
||||
|
||||
getObject(path: any, collection: any): object;
|
||||
|
||||
dropTable(table: string, options: any): void;
|
||||
|
||||
createSchema(schemaName: string): void;
|
||||
|
||||
dropSchema(schemaName: string, options: any): void;
|
||||
|
||||
[name: string]: any;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,18 +2,9 @@ import massive = require('massive');
|
||||
|
||||
let dbconn: massive.Database;
|
||||
|
||||
function findUserById(id: number): Promise<any> {
|
||||
return dbconn.users.findOne({id: id});
|
||||
}
|
||||
|
||||
massive('postgres://app:password@localhost:5432/app').then( db => {
|
||||
|
||||
console.log(`DB connected successfully`);
|
||||
|
||||
dbconn = db;
|
||||
|
||||
}).catch(err => {
|
||||
|
||||
console.error(`Error connecting DB`);
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user