angular-odata
Version:
Client side OData typescript library for Angular
109 lines (108 loc) • 5.06 kB
TypeScript
import { Observable } from 'rxjs';
import { ODataApi } from '../../api';
import { ODataCollection } from '../../models/collection';
import { ODataModel } from '../../models/model';
import { ODataPathSegments } from '../path';
import { ODataResource } from '../resource';
import { ODataEntitiesOptions, ODataEntityOptions, ODataOptions, ODataPropertyOptions } from './options';
import { ODataEntities, ODataEntity, ODataProperty } from '../response';
export declare class ODataFunctionResource<P, R> extends ODataResource<R> {
static factory<P, R>(api: ODataApi, { path, outgoingType, incomingType, bindingType, segments, }: {
path: string;
outgoingType?: string;
incomingType?: string;
bindingType?: string;
segments?: ODataPathSegments;
}): ODataFunctionResource<P, R>;
static fromResource<P, R>(resource: ODataResource<any>, path: string): ODataFunctionResource<P, R>;
clone(): ODataFunctionResource<P, R>;
parameters(params: P | null, { alias }?: {
alias?: boolean;
}): ODataFunctionResource<P, R>;
protected get(options?: ODataEntityOptions & ODataEntitiesOptions & ODataPropertyOptions): Observable<any>;
/**
* Execute the function
* @param params Parameters to be sent to the function
* @param alias If true, the parameters will be send using aliases
* @param options Options for the request
*/
call(params: P | null, options?: {
alias?: boolean;
} & ODataEntityOptions): Observable<ODataEntity<R>>;
call(params: P | null, options?: {
alias?: boolean;
} & ODataEntitiesOptions): Observable<ODataEntities<R>>;
call(params: P | null, options?: {
alias?: boolean;
} & ODataPropertyOptions): Observable<ODataProperty<R>>;
call(params: P | null, options?: {
alias?: boolean;
responseType?: 'blob';
} & ODataOptions): Observable<Blob>;
call(params: P | null, options?: {
alias?: boolean;
responseType?: 'arraybuffer';
} & ODataOptions): Observable<ArrayBuffer>;
call(params: P | null, options?: {
alias?: boolean;
responseType?: 'none';
} & ODataOptions): Observable<null>;
/**
* Execute the function with the given parameters and return the result as a property
* @param params Parameters to be sent to the function
* @param alias If true, the parameters will be send using aliases
* @param options Options for the request
* @returns Observable of the result of the function
*/
callProperty(params: P | null, { alias, ...options }?: {
alias?: boolean;
} & ODataOptions): Observable<R | null>;
/**
* Execute the function with the given parameters and return the result as a entity
* @param params Parameters to be sent to the function
* @param alias If true, the parameters will be send using aliases
* @param options Options for the request
* @returns Observable of the result of the function
*/
callEntity(params: P | null, { alias, ...options }?: {
alias?: boolean;
} & ODataOptions): Observable<R | null>;
/**
* Execute the function with the given parameters and return the result as a model
* @param params Parameters to be sent to the function
* @param alias If true, the parameters will be send using aliases
* @param options Options for the request
* @returns Observable of the result of the function
*/
callModel(params: P | null, { alias, ModelType, ...options }?: ODataOptions & {
alias?: boolean;
ModelType?: typeof ODataModel;
}): Observable<(ODataModel<R> & import("angular-odata").ModelInterface<R>) | null>;
/**
* Execute the function with the given parameters and return the result as a entities
* @param params Parameters to be sent to the function
* @param alias If true, the parameters will be send using aliases
* @param options Options for the request
* @returns Observable of the result of the function
*/
callEntities(params: P | null, { alias, ...options }?: {
alias?: boolean;
} & ODataOptions): Observable<R[] | null>;
/**
* Execute the function with the given parameters and return the result as a collection
* @param params Parameters to be sent to the function
* @param alias If true, the parameters will be send using aliases
* @param options Options for the request
* @returns Observable of the result of the function
*/
callCollection(params: P | null, { alias, CollectionType, ...options }?: {
alias?: boolean;
CollectionType?: typeof ODataCollection;
} & ODataOptions): Observable<ODataCollection<R, ODataModel<R> & import("angular-odata").ModelInterface<R>> | null>;
callArraybuffer(params: P | null, { alias, ...options }?: {
alias?: boolean;
} & ODataOptions): Observable<ArrayBuffer>;
callBlob(params: P | null, { alias, ...options }?: {
alias?: boolean;
} & ODataOptions): Observable<Blob>;
}