UNPKG

nakedobjects.spa

Version:

Single Page Application client for a Naked Objects application.

38 lines (37 loc) 2.1 kB
/// <reference types="lodash" /> import { RequestOptions } from '@angular/http'; import * as Models from './models'; import * as Ro from './ro-interfaces'; import { ConfigService } from './config.service'; import { Observable } from 'rxjs'; import { AuthHttp } from 'angular2-jwt'; import 'rxjs/add/operator/toPromise'; import { Dictionary } from 'lodash'; export declare class RepLoaderService { private readonly http; private readonly configService; constructor(http: AuthHttp, configService: ConfigService); private loadingCount; private loadingCountSource; loadingCount$: Observable<number>; private cache; private addIfMatchHeader(config, digest?); private handleInvalidResponse(rc); private isObjectUrl(url); private handleError(response, originalUrl); private httpValidate(config); private handleRedirectedObject(response, data); private isValidResponse(data); private httpPopulate(config, ignoreCache, response); populate: <T extends Models.IHateoasModel>(model: Models.IHateoasModel, ignoreCache?: boolean | undefined) => Promise<T>; setConfigFromMap(map: Models.IHateoasModel, digest?: string | null): RequestOptions; retrieve: <T extends Models.IHateoasModel>(map: Models.IHateoasModel, rc: new () => Models.IHateoasModel, digest?: string | null | undefined) => Promise<T>; validate: (map: Models.IHateoasModel, digest?: string | undefined) => Promise<boolean>; retrieveFromLink: <T extends Models.IHateoasModel>(link: Models.Link | null, parms?: Dictionary<Object> | undefined) => Promise<T>; invoke: (action: Models.ActionRepresentation | Models.InvokableActionMember, parms: Dictionary<Models.Value>, urlParms: Dictionary<Object>) => Promise<Models.ActionResultRepresentation>; clearCache: (url: string) => void; addToCache: (url: string, m: Ro.IResourceRepresentation) => void; getFile: (url: string, mt: string, ignoreCache: boolean) => Promise<Blob>; uploadFile: (url: string, mt: string, file: Blob) => Promise<boolean>; private logoff(); }