@mgrcto/angular-odata-v401
Version:
Odata Library for Angular made with Angular CLI
89 lines (88 loc) • 3.56 kB
TypeScript
import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ODataConfiguration } from './angularODataConfiguration';
export declare abstract class ODataOperation<T> {
protected typeName: string;
protected config: ODataConfiguration;
protected http: HttpClient;
private _expand;
private _select;
constructor(typeName: string, config: ODataConfiguration, http: HttpClient);
Expand(expand: string | string[]): this;
/**
* Selects Entities. If String is separated by "/" the first part will be expanded and the second part will be selected in the expand.
* @param select
* @returns ODataOperation<T>
*/
Select(select: string | string[]): this;
protected getParams(aParams?: HttpParams): HttpParams;
protected handleResponse(entity: Observable<HttpResponse<T>>): Observable<T>;
protected getDefaultRequestOptions(): {
headers?: HttpHeaders;
observe: 'response';
params?: HttpParams;
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
};
protected getPostRequestOptions(): {
headers?: HttpHeaders;
observe: 'response';
params?: HttpParams;
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
};
protected abstract Exec(): Observable<any>;
protected abstract GetUrl(): string;
protected GeneratePostUrl(entitiesUri: string): string;
protected GenerateUrl(entitiesUri: string): string;
protected toStringArray(input: string | string[]): string[];
protected toCommaString(input: string | string[]): string;
private extractData;
}
export declare abstract class OperationWithKey<T> extends ODataOperation<T> {
protected _typeName: string;
protected config: ODataConfiguration;
protected http: HttpClient;
protected entityKey: any;
constructor(_typeName: string, config: ODataConfiguration, http: HttpClient, entityKey: any);
protected getEntityUri(): string;
GetUrl(): string;
}
export declare abstract class OperationWithEntity<T> extends ODataOperation<T> {
protected _typeName: string;
protected config: ODataConfiguration;
protected http: HttpClient;
protected entity: T;
constructor(_typeName: string, config: ODataConfiguration, http: HttpClient, entity: T);
protected getEntitiesUri(): string;
GetUrl(): string;
}
export declare abstract class OperationWithKeyAndEntity<T> extends OperationWithKey<T> {
protected _typeName: string;
protected config: ODataConfiguration;
protected http: HttpClient;
protected entityKey: string;
protected entity: T;
constructor(_typeName: string, config: ODataConfiguration, http: HttpClient, entityKey: string, entity: T);
protected getEntityUri(): string;
}
export declare class GetOperation<T> extends OperationWithKey<T> {
Exec(): Observable<T>;
}
export declare class PostOperation<T> extends OperationWithEntity<T> {
Exec(): Observable<T>;
GetUrl(): string;
}
export declare class PatchOperation<T> extends OperationWithKeyAndEntity<T> {
Exec(): Observable<T>;
GetUrl(): string;
}
export declare class PutOperation<T> extends OperationWithKeyAndEntity<T> {
Exec(): Observable<T>;
GetUrl(): string;
}
export declare class DeleteOperation<T> extends OperationWithKey<T> {
Exec(): Observable<T>;
}