import { IModelConstructor, IRawModel, IType } from '@datx/core'; import { IConfigType, IRequestOptions } from '@datx/jsonapi'; import { IResourceObject } from '@datx/jsonapi-types'; import { Observable } from 'rxjs'; import { Response } from '../../Response'; import { IJsonapiCollection } from '../../interfaces/IJsonapiCollection'; import { IJsonapiModel } from '../../interfaces/IJsonapiModel'; import * as i0 from "@angular/core"; export declare abstract class CollectionService { protected abstract readonly ctor: IModelConstructor; private readonly maxPageSize; protected readonly collection: TCollection; /** * @note DO NOT REMOVE THIS, OR DATX CONFIG WILL NOT BE INITIALIZED * * This ensures that DATX_CONFIG factory is run once, whenever some specific CollectionService is used * for the first time in application runtime. * * This makes DatX configuration lazy - it will be configured only when it is needed for the first * time (by using some specific CollectionService). * For example, when there is an APP_INITIALIZER that fetches some data using some specific CollectionService, * this ensures that DatX will be configured in time. * * Even if noone actually reads datxConfig property, it sill needs to be here in order to trigger the factory. * However, if someone does want to check DatX config (for whatever reason), they could read it from here instead * of importing the mutated config object from DatX package. */ protected readonly datxConfig: IConfigType; setData(data: Array): Array; create(rawModel: IRawModel | IResourceObject): TModel; createAndSave(rawModel: IRawModel | IResourceObject): Observable; findAll(): Array; getAllModels(requestOptions?: IRequestOptions, options?: { pageSize?: number; recursive?: boolean; }): Observable>; getMany(options?: IRequestOptions): Observable>; getManyModels(options?: IRequestOptions): Observable>; getOne(id: IType, options?: IRequestOptions): Observable>; findOne(id: IType): TModel | null; getOneModel(id: IType, options?: IRequestOptions): Observable; update(model: TModel): Observable; request(url: string, method?: string, data?: object, options?: IRequestOptions): Observable>; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; }