angular-odata
Version:
Client side OData typescript library for Angular
80 lines (79 loc) • 3.41 kB
TypeScript
import { Observable } from 'rxjs';
import { ODataApi } from '../../api';
import type { ModelInterface, ODataCollection, ODataModel } from '../../models';
import { QueryOption, StructuredTypeFieldConfig } from '../../types';
import { ApplyExpression, ApplyExpressionBuilder, ODataQueryOptions } from '../query';
import { ODataResource } from '../resource';
import { ODataActionResource } from './action';
import { ODataCountResource } from './count';
import { ODataEntityResource } from './entity';
import { ODataFunctionResource } from './function';
import { ODataOptions } from './options';
import { ODataEntities, ODataEntity } from '../response';
export declare class ODataEntitySetResource<T> extends ODataResource<T> {
static factory<E>(api: ODataApi, { path, type, query, }: {
path: string;
type?: string;
query?: ODataQueryOptions<E>;
}): ODataEntitySetResource<E>;
clone(): ODataEntitySetResource<T>;
transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
type?: string;
fields?: {
[name: string]: StructuredTypeFieldConfig;
};
}): ODataEntitySetResource<R>;
entity(key?: any): ODataEntityResource<T>;
action<P, R>(path: string): ODataActionResource<P, R>;
function<P, R>(path: string): ODataFunctionResource<P, R>;
count(): ODataCountResource<T>;
cast<C>(type: string): ODataEntitySetResource<C>;
protected post(attrs: Partial<T>, options?: ODataOptions): Observable<any>;
protected get(options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
}): Observable<any>;
create(attrs: Partial<T>, options?: ODataOptions): Observable<ODataEntity<T>>;
fetch(options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
}): Observable<ODataEntities<T>>;
fetchAll(options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
}): Observable<{
entities: any[];
annots: import("angular-odata").ODataEntitiesAnnotations<any>;
}>;
fetchMany(top: number, options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
}): Observable<{
entities: T[];
annots: import("angular-odata").ODataEntitiesAnnotations<T>;
} | {
entities: T[];
annots: import("angular-odata").ODataEntitiesAnnotations<any>;
}>;
fetchOne(options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
}): Observable<{
entity: T | null;
annots: import("angular-odata").ODataEntitiesAnnotations<T>;
}>;
fetchEntities(options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
}): Observable<T[] | null>;
fetchCollection(options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
CollectionType?: typeof ODataCollection;
}): Observable<ODataCollection<T, ODataModel<T> & ModelInterface<T>> | null>;
fetchCollection<M extends ODataModel<T>, C extends ODataCollection<T, M>>(options?: ODataOptions & {
withCount?: boolean;
bodyQueryOptions?: QueryOption[];
CollectionType?: typeof ODataCollection;
}): Observable<C | null>;
}