angular4-hal
Version:
This Angular module offers a HAL/JSON http-client to easily interact with a Spring Data Rest API or any API that implements the Spring Data Rest resource model
37 lines (36 loc) • 1.76 kB
TypeScript
import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
import { Resource } from './resource';
import { ResourceArray } from './resource-array';
import { HalOptions, HalParam } from './rest.service';
import { SubTypeBuilder } from './subtype-builder';
export declare type ResourceExpire<T extends Resource> = {
entity: any;
expire: number;
};
export declare class ResourceHelper {
private static _headers;
private static proxy_uri;
private static root_uri;
private static http;
static headers: HttpHeaders;
static optionParams(params: HttpParams, options?: HalOptions): HttpParams;
static params(httpParams: HttpParams, params?: HalParam[]): HttpParams;
static resolveRelations(resource: Resource): Object;
static createEmptyResult<T extends Resource>(_embedded: string): ResourceArray<T>;
static getClassName(obj: any): string;
static className(objProto: any): string[];
static instantiateResourceCollection<T extends Resource>(type: {
new (): T;
}, response: HttpResponse<any>, result: ResourceArray<T>, builder?: SubTypeBuilder): ResourceArray<T>;
static searchSubtypes<T extends Resource>(builder: SubTypeBuilder, embeddedClassName: string, instance: T): T;
static instantiateResourceFromResponse<T extends Resource>(entity: T, response: HttpResponse<any>): T;
static instantiateResource<T extends Resource>(entity: T, payload: any): T;
static setProxyUri(proxy_uri: string): void;
static setRootUri(root_uri: string): void;
static getURL(): string;
private static addSlash;
static getProxy(url: string): string;
static setHttp(http: HttpClient): void;
static getHttp(): HttpClient;
static getRootUri(): string;
}