UNPKG

ngx-http-annotations

Version:

This is a library to angular to use http request via decorator/annotations

45 lines (44 loc) 1.76 kB
import { HttpClient } from '@angular/common/http'; import { Injector } from '@angular/core'; export declare function observe(annotations: any): (...args: any[]) => void; export declare function path(annotations: any): (...args: any[]) => void; export declare function body(annotations: any): (...args: any[]) => void; export declare function response(annotations: any): (...args: any[]) => void; export declare function query(annotations: any): (...args: any[]) => void; export declare function headers(annotations: any): (...args: any[]) => void; export declare function produces(annotations: 'arraybuffer' | 'blob' | 'json' | 'text'): (...args: any[]) => void; export declare enum RequestMethodParams { get = "Get", post = "Post", put = "Put", delete = "Delete", options = "Options", head = "Head", patch = "Patch" } export declare class HttpRestUtils { static http: HttpClient; static appInjector: Injector; static decorate(decoratorName: string, annotations: any, ...args: any[]): void; /** * Set up metadata * @param entityType * @param value Value of metadata * @param target Prototype of current object * @param metaName Decorator name * @param entityData Entity extra data */ private static constructMetadata; static requestMethod(requestMethodName: RequestMethodParams): any; private static getRequest; private static ifUseMock; private static processIfUseMock; private static getDelay; private static getHttpClientObserve; private static produce; private static collectUrl; private static collectBodyContent; private static collectResponseIndex; private static collectQueryParams; private static collectHttpHeaders; }