backported usage of new typescript features to legacy typings, fixed errors in typings and tests

This commit is contained in:
Stefan Steinhart
2015-11-15 13:05:43 +01:00
parent 97322f1ead
commit ab3f93861f
8 changed files with 126 additions and 132 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ ADocument.inject({ id: 5, author: 'John' });
ADocument.inject({ id: 6, author: 'John' });
// bypass the data store
adapter.updateAll<{ id?: number; author: string; }>(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) {
adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) {
documents[0]; // { id: 5, author: 'Johnny' }
// The updated documents have NOT been injected into the data store because we bypassed the data store
@@ -37,7 +37,7 @@ adapter.updateAll<{ id?: number; author: string; }>(ADocument, { author: 'Johnny
});
// Normally you would just go through the data store
ADocument.updateAll<{ id?: number; author: string; }>({ author: 'Johnny' }, { author: 'John' }).then(function (documents) {
ADocument.updateAll({ author: 'Johnny' }, { author: 'John' }).then(function (documents) {
documents[0]; // { id: 5, author: 'Johnny' }
// the updated documents have been injected into the data store
+6 -2
View File
@@ -6,7 +6,7 @@
/// <reference path="../js-data/js-data.d.ts" />
declare module JSData {
interface DSHttpAdapterOptions {
serialize?: (resourceName:string, data:any)=>any;
deserialize?: (resourceName:string, data:any)=>any;
@@ -37,4 +37,8 @@ declare module JSData {
}
}
declare var DSHttpAdapter:JSData.DSHttpAdapter;
declare var DSHttpAdapter:JSData.DSHttpAdapter;
declare module 'js-data-http' {
export = DSHttpAdapter;
}