angular-odata-es5
Version:
OData service for Angular (es5 version)
81 lines (80 loc) • 3.34 kB
TypeScript
import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
import { IEnumerable, IQueryable } from 'linq-collections';
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;
Select(select: string | string[]): this;
protected getParams(): 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 GenerateUrl(entitiesUri: string): string;
protected toStringArray(input: string | string[] | IEnumerable<string> | IQueryable<string>): string[];
protected toCommaString(input: string | string[] | IEnumerable<string> | IQueryable<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>;
}
export declare class PatchOperation<T> extends OperationWithKeyAndEntity<T> {
Exec(): Observable<T>;
}
export declare class PutOperation<T> extends OperationWithKeyAndEntity<T> {
Exec(): Observable<T>;
}
export declare class DeleteOperation<T> extends OperationWithKey<T> {
Exec(): Observable<T>;
}