From 09a3e2fa0ef0cf15aecd5179da72411e80446887 Mon Sep 17 00:00:00 2001 From: clarenceh Date: Sat, 10 Jun 2017 14:37:53 +0800 Subject: [PATCH] Fix lint and test errors --- types/massive/index.d.ts | 25 +++++-------------------- types/massive/massive-tests.ts | 9 --------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/types/massive/index.d.ts b/types/massive/index.d.ts index 9f68b030ce..08a4ed6b7b 100644 --- a/types/massive/index.d.ts +++ b/types/massive/index.d.ts @@ -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 // Clarence Ho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -14,9 +15,7 @@ declare function massive( driverConfig?: object): Promise; 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): Promise; - + interface Database { + attach(ctor: any, ...sources: any[]): Promise; detach(entity: string, collection: string): void; - reload(): void; - query(query: any, params: any, options: any): Promise; - saveDoc(collection: any, doc: any): any; - createDocumentTable(path: any): Promise; - 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; - } - } diff --git a/types/massive/massive-tests.ts b/types/massive/massive-tests.ts index 30cb977596..e43755b7f3 100644 --- a/types/massive/massive-tests.ts +++ b/types/massive/massive-tests.ts @@ -2,18 +2,9 @@ import massive = require('massive'); let dbconn: massive.Database; -function findUserById(id: number): Promise { - 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`); - });