@granito/ngx-hal-client
Version:
A HAL client to be used in Angular projects
25 lines (24 loc) • 898 B
TypeScript
import { Type } from '@angular/core';
import { Observable } from 'rxjs';
import { Collection, HalBase, Resource } from './internal';
/**
* This class provides a way to execute operations on HAL resources
* without reading them first. Accessors are obtained either by following
* resource links or by getting the root entry point for the API.
*/
export declare class Accessor extends HalBase {
/**
* Read the resource identified by `self` link.
*
* @param type the resource type
* @returns an observable of the resource instance
*/
read<T extends Resource>(type: Type<T>): Observable<T>;
/**
* Read the resource collection identified by `self` link.
*
* @param type the collection element type
* @returns an observable of the collection instance
*/
readCollection<T extends Resource>(type: Type<T>): Observable<Collection<T>>;
}