angular-odata
Version:
Client side OData typescript library for Angular
65 lines (64 loc) • 2.45 kB
TypeScript
import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
import { ODataApi } from '../api';
import { FetchPolicy, ParserOptions, QueryOption } from '../types';
import { ODataResource } from './resource';
import { ODataOptions } from './types';
export declare class ODataRequest<T> {
readonly api: ODataApi;
readonly observe: 'events' | 'response';
readonly context?: HttpContext;
readonly reportProgress?: boolean;
readonly withCredentials?: boolean;
readonly bodyQueryOptions: QueryOption[];
readonly fetchPolicy: 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
readonly resource: ODataResource<T>;
private readonly _responseType?;
private readonly _method;
private readonly _body;
private readonly _headers;
private readonly _params;
private readonly _path;
constructor(init: {
method: string;
api: ODataApi;
resource: ODataResource<T>;
body: any;
observe: 'events' | 'response';
context?: HttpContext;
etag?: string;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
reportProgress?: boolean;
params?: HttpParams | {
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
};
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text' | 'value' | 'property' | 'entity' | 'entities';
fetchPolicy?: FetchPolicy;
parserOptions?: ParserOptions;
withCredentials?: boolean;
bodyQueryOptions?: QueryOption[];
});
static factory(api: ODataApi, method: string, resource: ODataResource<any>, options: ODataOptions & {
body?: any;
etag?: string;
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text' | 'value' | 'property' | 'entity' | 'entities';
observe: 'events' | 'response';
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
}): ODataRequest<any>;
get responseType(): 'arraybuffer' | 'blob' | 'json' | 'text';
get path(): string;
get method(): string;
get body(): any;
get params(): HttpParams;
get headers(): HttpHeaders;
get pathWithParams(): string;
get url(): string;
get urlWithParams(): string;
get cacheKey(): string;
isQueryBody(): boolean;
isBatch(): boolean;
isFetch(): boolean;
isMutate(): boolean;
}