mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
backported usage of new typescript features to legacy typings, fixed errors in typings and tests
This commit is contained in:
@@ -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
|
||||
|
||||
Vendored
+6
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user