semantic-network
Version:
A utility library for manipulating a list of links that form a semantic interface to a network of resources.
18 lines (17 loc) • 1.28 kB
TypeScript
import { LinkedRepresentation, LinkType, RelationshipType } from 'semantic-link';
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { HttpRequestOptions } from '../interfaces/httpRequestOptions';
import { DocumentRepresentation } from '../interfaces/document';
import { LoaderJobOptions } from '../interfaces/loader';
export declare class HttpRequest {
private options;
private readonly loader;
constructor(options: Required<HttpRequestOptions>);
/**
* TODO: should probably return T | undefined
*/
load<T extends LinkedRepresentation>(link: LinkType, rel: RelationshipType, options?: HttpRequestOptions & AxiosRequestConfig & LoaderJobOptions): Promise<AxiosResponse<T>>;
update<T extends LinkedRepresentation>(resource: T, document: T | DocumentRepresentation<T>, options?: HttpRequestOptions & AxiosRequestConfig & LoaderJobOptions): Promise<AxiosResponse<void>>;
create<T extends LinkedRepresentation>(resource: T, document: T | DocumentRepresentation<T>, options?: HttpRequestOptions & AxiosRequestConfig & LoaderJobOptions): Promise<AxiosResponse<T | undefined>>;
del<T extends LinkedRepresentation>(resource: T, options?: HttpRequestOptions & AxiosRequestConfig & LoaderJobOptions): Promise<AxiosResponse<void>>;
}