@granito/ngx-hal-client
Version:
A HAL client to be used in Angular projects
43 lines (42 loc) • 1.3 kB
TypeScript
import { Type } from '@angular/core';
import { Observable } from 'rxjs';
import { Accessor, Resource } from './internal';
/**
* This class represents an in-memory collection of resources.
*/
export declare class Collection<T extends Resource> extends Resource {
private readonly type;
/**
* Zero-based offset of the first element of the `values` array in
* the collection.
*/
readonly start: number;
/**
* A page of values of the collection starting with `start` offset.
*/
readonly values: T[];
/**
* @param type the element resource type
* @param obj the object used to assign the properties
*/
constructor(type: Type<T>, obj: any);
/**
* Follow `next` link if it exists and can be read.
*
* @returns the accessor for the link or `undefined`
*/
next(): Accessor | undefined;
/**
* Follow `prev` link if it exists and can be read.
*
* @returns the accessor for the link or `undefined`
*/
previous(): Accessor | undefined;
/**
* Refresh the resource collection. In other words, read
* the resource collection identified by `self` link.
*
* @returns an observable of the refreshed resource collection instance
*/
read(): Observable<this>;
}