0.0.9: Add typing to PUT/DELETE calls on GenericRestClient

This commit is contained in:
David de Regt 2016-12-19 13:10:57 -08:00
Родитель 3e1cbbc6fb
Коммит 81a9232960
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "simplerestclients",
"version": "0.0.8",
"version": "0.0.9",
"description": "A library of components for accessing RESTful services with javascript/typescript.",
"author": "David de Regt <David.de.Regt@microsoft.com>",
"scripts": {

Просмотреть файл

@ -121,17 +121,17 @@ export class GenericRestClient {
return this._performApiCall<T>(apiPath, 'PATCH', objToPatch, options);
}
performApiPut(apiPath: string, objToPut: any, options: ApiCallOptions = null): SyncTasks.Promise<void> {
return this.performApiPutDetailed(apiPath, objToPut, options).then(_.noop);
performApiPut<T>(apiPath: string, objToPut: any, options: ApiCallOptions = null): SyncTasks.Promise<T> {
return this.performApiPutDetailed<T>(apiPath, objToPut, options).then(resp => resp.body);
}
performApiPutDetailed(apiPath: string, objToPut: any, options: ApiCallOptions = null): SyncTasks.Promise<WebResponse<void>> {
return this._performApiCall<void>(apiPath, 'PUT', objToPut, options);
performApiPutDetailed<T>(apiPath: string, objToPut: any, options: ApiCallOptions = null): SyncTasks.Promise<WebResponse<T>> {
return this._performApiCall<T>(apiPath, 'PUT', objToPut, options);
}
performApiDelete(apiPath: string, objToDelete: any = null, options: ApiCallOptions = null): SyncTasks.Promise<void> {
return this.performApiDeleteDetailed(apiPath, objToDelete, options).then(_.noop);
performApiDelete<T>(apiPath: string, objToDelete: any = null, options: ApiCallOptions = null): SyncTasks.Promise<T> {
return this.performApiDeleteDetailed<T>(apiPath, objToDelete, options).then(resp => resp.body);
}
performApiDeleteDetailed(apiPath: string, objToDelete: any, options: ApiCallOptions = null): SyncTasks.Promise<WebResponse<void>> {
return this._performApiCall<void>(apiPath, 'DELETE', objToDelete, options);
performApiDeleteDetailed<T>(apiPath: string, objToDelete: any, options: ApiCallOptions = null): SyncTasks.Promise<WebResponse<T>> {
return this._performApiCall<T>(apiPath, 'DELETE', objToDelete, options);
}
}