mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Added missing plain() and clone() methods to Restangular's IElement and ICollection
restangularizeCollection() [1] and restangularizeElem() [2] are used to create objects that implement IElement and ICollection respectively. Both use restangularizeBase() [3] which adds the clone() and plane() methods. Therefore both IElement and ICollection should both implement clone() and plain(). Additionally I added a generic variant of the already existing plain() method in IElement to both IElement and ICollection. [1] https://github.com/mgonto/restangular/blob/master/src/restangular.js#L982 [2] https://github.com/mgonto/restangular/blob/master/src/restangular.js#L951 [3] https://github.com/mgonto/restangular/blob/master/src/restangular.js#L764
This commit is contained in:
4
restangular/restangular.d.ts
vendored
4
restangular/restangular.d.ts
vendored
@@ -114,6 +114,7 @@ declare module restangular {
|
||||
patch(queryParams?: any, headers?: any): IPromise<any>;
|
||||
clone(): IElement;
|
||||
plain(): any;
|
||||
plain<T>(): T;
|
||||
withHttpConfig(httpConfig: IRequestConfig): IElement;
|
||||
save(queryParams?: any, headers?: any): IPromise<any>;
|
||||
getRestangularUrl(): string;
|
||||
@@ -130,6 +131,9 @@ declare module restangular {
|
||||
patch(queryParams?: any, headers?: any): IPromise<any>;
|
||||
putElement(idx: any, params: any, headers: any): IPromise<any>;
|
||||
withHttpConfig(httpConfig: IRequestConfig): ICollection;
|
||||
clone(): ICollection;
|
||||
plain(): any;
|
||||
plain<T>(): T[];
|
||||
getRestangularUrl(): string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user