From e02dc634d68d6087f4c3c149cbf5cc5fed03e60d Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:10:37 +0900 Subject: [PATCH] adhoc fix js-data/js-data.d.ts and js-data-http/js-data-http-tests.ts --- js-data-http/js-data-http-tests.ts | 6 +++--- js-data/js-data.d.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js-data-http/js-data-http-tests.ts b/js-data-http/js-data-http-tests.ts index d7c07d654e..00457d7142 100644 --- a/js-data-http/js-data-http-tests.ts +++ b/js-data-http/js-data-http-tests.ts @@ -28,7 +28,7 @@ ADocument.inject({ id: 5, author: 'John' }); ADocument.inject({ id: 6, author: 'John' }); // bypass the data store -adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) { +adapter.updateAll<{ id?: number; author: string; }>(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(ADocument, { author: 'Johnny' }, { author: 'John' }).then(func }); // Normally you would just go through the data store -ADocument.updateAll({ author: 'Johnny' }, { author: 'John' }).then(function (documents) { +ADocument.updateAll<{ id?: number; author: string; }>({ author: 'Johnny' }, { author: 'John' }).then(function (documents) { documents[0]; // { id: 5, author: 'Johnny' } // the updated documents have been injected into the data store @@ -164,4 +164,4 @@ ADocument.create({ author: 'John' }).then(function (document:any) { // the new document has been injected into the data store ADocument.get(document.id); // { id: 5, author: 'John' } -}); \ No newline at end of file +}); diff --git a/js-data/js-data.d.ts b/js-data/js-data.d.ts index e17c4ae0d4..604b70e6c4 100644 --- a/js-data/js-data.d.ts +++ b/js-data/js-data.d.ts @@ -153,7 +153,7 @@ declare module JSData { findAll(params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise>; loadRelations(idOrInstance:string | number | Object, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise; update(id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise; - updateAll(attrs:Object, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise>; + updateAll(attrs:Object, params?:DSFilterParams & T, options?:DSAdapterOperationConfiguration):JSDataPromise>; reap(resourceNametions?:DSConfiguration):JSDataPromise; refresh(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; save(id:string | number, options?:DSSaveConfiguration):JSDataPromise; @@ -283,7 +283,7 @@ declare module JSData { update(config:DSResourceDefinition, id:string | number, attrs:Object, options?:DSConfiguration):JSDataPromise; - updateAll(config:DSResourceDefinition, attrs:Object, params?:DSFilterParams, options?:DSConfiguration):JSDataPromise; + updateAll(config:DSResourceDefinition, attrs:Object, params?:DSFilterParams & T, options?:DSConfiguration):JSDataPromise; } } @@ -297,4 +297,4 @@ declare var JSData:{ declare module 'js-data' { export = JSData; -} \ No newline at end of file +}