UNPKG

@fingerprintsoft/angular-spring-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

49 lines (48 loc) 2.23 kB
import { Observable } from 'rxjs'; import { HalOptions } from '../services/rest.service'; import { SubTypeBuilder } from './subtype-builder'; import * as i0 from "@angular/core"; export declare type Link = { href: string; templated?: boolean; }; export declare type Links = { [key: string]: Link; }; export declare abstract class Resource { proxyUrl: string; rootUrl: string; _links: any; _subtypes: Map<string, any>; get subtypes(): Map<string, any>; set subtypes(_subtypes: Map<string, any>); constructor(); uri(): string; relURI(rel: string): string; getRelation<T extends Resource>(type: { new (): T; }, relation: string, builder?: SubTypeBuilder, expireMs?: number, isCacheActive?: boolean): Observable<T>; addRelations<T extends Resource>(relation: string, resources: T[]): Observable<any>; replaceRelations<T extends Resource>(relation: string, resources: T[]): Observable<any>; getRelationArray<T extends Resource>(type: { new (): T; }, relation: string, _embedded?: string, options?: HalOptions, builder?: SubTypeBuilder, expireMs?: number, isCacheActive?: boolean): Observable<T[]>; getProjection<T extends Resource>(type: { new (): T; }, resource: string, id: string, projectionName: string, expireMs?: number, isCacheActive?: boolean): Observable<T>; getProjectionArray<T extends Resource>(type: { new (): T; }, resource: string, projectionName: string, expireMs?: number, isCacheActive?: boolean): Observable<T[]>; private getResourceUrl; private getRelationLinkHref; private existRelationLink; addRelation<T extends Resource>(relation: string, resource: T): Observable<any>; postRelation<T extends Resource>(relation: string, type: { new (): T; }, resource?: T): Observable<T>; updateRelation<T extends Resource>(relation: string, resource: T): Observable<any>; substituteRelation<T extends Resource>(relation: string, resource: T): Observable<any>; deleteRelation<T extends Resource>(relation: string, resource: T): Observable<any>; static ɵfac: i0.ɵɵFactoryDeclaration<Resource, never>; static ɵprov: i0.ɵɵInjectableDeclaration<Resource>; }