export interface IResourceParamsBase { url ? : string ; pathPrefix ? : string ; path ? : string ; headers ? : any ; body ? : any ; params ? : any ; query ? : any ; } export interface IResourceParams extends IResourceParamsBase { rootNode ? : string ; removeTrailingSlash ? : boolean ; addTimestamp ? : boolean | string ; withCredentials ? : boolean ; lean ? : boolean ; mutateBody ? : boolean ; asPromise ? : boolean ; keepEmptyBody ? : boolean ; requestBodyType ? : ResourceRequestBodyType ; responseBodyType ? : ResourceResponseBodyType ; queryMappingMethod ? : ResourceQueryMappingMethod ; asResourceResponse ? : boolean ; [ prop ] : any ; } export interface IResourceAction extends IResourceParams { method ? : ResourceRequestMethod ; expectJsonArray ? : boolean ; resultFactory ? : IResourceResultFactory ; map ? : IResourceResponseMap ; filter ? : IResourceResponseFilter ; } export interface IResourceResponseMap { ( item , options ) : any ; } export interface IResourceResponseFilter { ( item , options ) : boolean ; } export interface IResourceResultFactory { ( item , options ) : any ; } export interface IResourceActionAttributes { body : any ; query : any ; params : any ; onSuccess ( data ) : any ; onError ( data ) : any ; } export interface IResourceActionInner { actionAttributes ? : IResourceActionAttributes ; actionOptions ? : IResourceAction ; resolvedOptions ? : IResourceParamsBase ; queryMappingMethod ? : ResourceQueryMappingMethod ; usedInPath ? : { [ key ] : boolean ; } ; mainPromise ? : Promise < any > ; isModel ? : boolean ; requestOptions ? : IResourceRequest ; returnData ? : any ; } export interface IResourceRequest { method ? : ResourceRequestMethod ; headers ? : any ; url ? : string ; withCredentials ? : boolean ; body ? : any ; query ? : { [ prop ] : string ; } ; responseBodyType ? : ResourceResponseBodyType ; requestBodyType ? : ResourceRequestBodyType ; } export interface IResourceHandlerResponse { promise : Promise < IResourceResponse > ; abort ? ( ) : void ; } export interface IResourceResponse < B = any > { status : number ; headers ? : any ; body ? : B ; } export interface IResourceMethodStrictBase < IB , IQ , IP , O , R > { ( body , query , params , onSuccess ? , onError ? ) : R ; ( body , query , onSuccess ? , onError ? ) : R ; ( body , onSuccess ? , onError ? ) : R ; ( onSuccess ? , onError ? ) : R ; } export interface IResourceMethodBase < IB , O , R > extends IResourceMethodStrictBase < IB , any , any , O , R > { } export interface IResourceMethodStrict < IB , IQ , IP , O > extends IResourceMethodStrictBase < IB , IQ , IP , O , Promise < O > > { } export interface IResourceMethod < IB , O > extends IResourceMethodBase < IB , O , Promise < O > > { } export interface IResourceMethodResultStrict < IB , IQ , IP , O > extends IResourceMethodStrictBase < IB , IQ , IP , O , ResourceResult < O > > { } export interface IResourceMethodResult < IB , O > extends IResourceMethodBase < IB , O , ResourceResult < O > > { } export interface IResourceMethodStrictFull < IB , IQ , IP , O > extends IResourceMethodStrictBase < IB , IQ , IP , O , Promise < IResourceResponse < O > > > { } export interface IResourceMethodFull < IB , O > extends IResourceMethodBase < IB , O , Promise < IResourceResponse < O > > > { } export interface IResourceMethodResultStrictFull < IB , IQ , IP , O > extends IResourceMethodStrictBase < IB , IQ , IP , O , ResourceResult < IResourceResponse < O > > > { } export interface IResourceMethodResultFull < IB , O > extends IResourceMethodBase < IB , O , ResourceResult < IResourceResponse < O > > > { } export type ResourceResult < R extends { } > = R & { $resolved ? : boolean ; $promise ? : Promise < R > ; $abort ? ( ) : void ; } ; export enum ResourceRequestBodyType { NONE = 0 , JSON = 1 , FORM = 2 , FORM_DATA = 3 , TEXT = 4 , BLOB = 5 , ARRAY_BUFFER = 6 } export enum ResourceResponseBodyType { Text = 1 , Json = 2 , ArrayBuffer = 3 , Blob = 4 } export enum ResourceRequestMethod { Get = 1 , Post = 2 , Put = 3 , Delete = 4 , Options = 5 , Head = 6 , Patch = 7 } export enum ResourceQueryMappingMethod { Plain = 1 , Bracket = 2 , JQueryParamsBracket = 3 , None = 99 }