From e684481e0cd360db62fd6213ca7248245315e8a2 Mon Sep 17 00:00:00 2001 From: Ken Howard Date: Tue, 12 Apr 2016 07:22:09 -0700 Subject: [PATCH] Return typed definition from toJSON method (#8859) * Return typed definition from toJSON method * Test toJSON returns IMyResource --- angularjs/angular-resource-tests.ts | 4 +--- angularjs/angular-resource.d.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index 5a9963b14c..89f6d25a26 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -98,9 +98,7 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { var promise : angular.IPromise; var arrayPromise : angular.IPromise; -var json: { - [index: string]: any; -}; +var json: IMyResource; promise = resource.$delete(); promise = resource.$delete({ key: 'value' }); diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index caae65ccb2..0fb9351342 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -153,9 +153,7 @@ declare namespace angular.resource { /** the promise of the original server interaction that created this instance. **/ $promise : angular.IPromise; $resolved : boolean; - toJSON: () => { - [index: string]: any; - } + toJSON(): T; } /**