fix function signatures (#11261)

Documentation: https://github.com/mgonto/restangular#restangular-methods

According to the documentation and source code, `all` and `allUrl` return collections, not elements.
Additionally, the `post` signature without `subElement` is only available on collections, not elements.
This commit is contained in:
Nick Graef
2016-09-19 01:16:16 -05:00
committed by Masahiro Wakame
parent c0ce167c10
commit 50155318b2

View File

@@ -84,8 +84,8 @@ declare namespace restangular {
one(route: string, id?: number): IElement;
one(route: string, id?: string): IElement;
oneUrl(route: string, url: string): IElement;
all(route: string): IElement;
allUrl(route: string, url: string): IElement;
all(route: string): ICollection;
allUrl(route: string, url: string): ICollection;
copy(fromElement: any): IElement;
withConfig(configurer: (RestangularProvider: IProvider) => any): IService;
restangularizeElement(parent: any, element: any, route: string, collection?: any, reqParams?: any): IElement;
@@ -104,8 +104,6 @@ declare namespace restangular {
put(queryParams?: any, headers?: any): IPromise<any>;
post(subElement: any, elementToPost: any, queryParams?: any, headers?: any): IPromise<any>;
post<T>(subElement: any, elementToPost: T, queryParams?: any, headers?: any): IPromise<T>;
post(elementToPost: any, queryParams?: any, headers?: any): IPromise<any>;
post<T>(elementToPost: T, queryParams?: any, headers?: any): IPromise<T>;
remove(queryParams?: any, headers?: any): IPromise<any>;
head(queryParams?: any, headers?: any): IPromise<any>;
trace(queryParams?: any, headers?: any): IPromise<any>;