Fixed errors from npm test

This commit is contained in:
David Fahlander
2015-04-23 22:52:51 +02:00
parent 5850b78734
commit 8acdd6fc7d
2 changed files with 8 additions and 4 deletions

View File

@@ -89,8 +89,8 @@ module AppDb {
if (id) this.id = id;
}
loadEmailsAndPhones() {
return Dexie.Promise.all(
loadEmailsAndPhones() : Dexie.Promise<Contact> {
return Dexie.Promise.all<any>(
db.emails
.where('contactId').equals(this.id)
.toArray(emails => this.emails = emails)
@@ -99,7 +99,7 @@ module AppDb {
.where('contactId').equals(this.id)
.toArray(phones => this.phones = phones)
).then(x => this);
).then(() => this);
}
save() {

6
dexie/dexie.d.ts vendored
View File

@@ -1,4 +1,8 @@

// Type definitions for Dexie v1.1
// Project: https://github.com/dfahlander/Dexie.js
// Definitions by: David Fahlander <http://github.com/dfahlander>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Thenable<R> {
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected: (error: any) => Thenable<U>): Thenable<U>;
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected?: (error: any) => U): Thenable<U>;