import { IFetchClient } from './IFetchClient.js';
import { IFetchOptions } from './IFetchOptions.js';
import { IFetchResponse } from './IFetchResponse.js';
import { IIdentified } from './IIdentified.js';
import { IResult } from './IResult.js';
import { IResultList } from './IResultList.js';
import { Paging } from './Paging.js';
import { Realtime } from '../realtime/index.js';
export declare abstract class Service<TData extends IIdentified> {
    protected client: IFetchClient;
    protected realtime?: Realtime;
    protected propertyName: string;
    protected abstract baseUrl: string;
    protected abstract listUrl: string;
    protected channel: string;
    private cache;
    constructor(client: IFetchClient, realtime?: Realtime);
    list(filter?: object): Promise<IResultList<TData>>;
    protected detail(entityOrId: string | number | IIdentified, filter?: object): Promise<IResult<TData>>;
    protected create(entity: Partial<TData>, params?: object): Promise<IResult<TData>>;
    protected update(entity: Partial<TData>, params?: object): Promise<IResult<TData>>;
    protected delete(entityOrId: string | number | IIdentified, params?: any): Promise<IResult<null>>;
    protected onBeforeCreate(obj: Partial<TData>): Partial<TData>;
    protected onBeforeUpdate(objWithId: Partial<TData>): Partial<TData>;
    protected changeFetchOptions(options: any, _url?: string): any;
    protected getUrl(url?: string): string;
    protected getEntityId(entityOrId: string | number | IIdentified): string;
    protected getDetailUrl(entityOrId: string | number | IIdentified): string;
    protected fetch(url: string, init?: IFetchOptions): Promise<IFetchResponse>;
    /**
     * Checks the response for errors and throws exceptions, otherwise returns the response as is.
     *
     * @param response The response from server.
     *
     * @returns If no errors are detected, it returns the same response.
     *
     * @throws If an error is detected, it throws `{ res, data }`, where `data` contains error details from server.
     */
    protected handleErrorStatusCodes(response: IFetchResponse): Promise<IFetchResponse>;
    protected mimeType(type: string): string;
    protected getIdString(reference: number | string | IIdentified): string;
    protected getPaging(json: any, filter: object): Paging<TData>;
    protected getCurrentPageFromLink(link?: string): number;
}
//# sourceMappingURL=Service.d.ts.map