import { KosServiceResponse } from './kos-fetch';

/**
 * Resolves the service URL configuration.
 * @param _service - The optional service name (not used).
 * @returns An object with `isMock` and `URL` properties.
 */
export declare const resolveServiceUrl: (_service?: string) => {
    isMock: boolean;
    URL: string;
};
/**
 * Represents parameters for deleting an entity from the server.
 */
interface DeleteModelParams extends CommonParams {
    id: string;
    urlOverride?: string;
    tracker?: string;
}
/**
 * Represents common parameters shared across different service operations.
 */
type CommonParams = Partial<Orderable> & Partial<StudioRequest> & Partial<FosRequest> & Partial<RoutableRequest> & Partial<TimeoutAware>;
/**
 * Represents parameters for fetching a list of entities.
 */
interface GetAllParams extends CommonParams {
    urlOverride?: string;
    tracker?: string;
}
/**
 * Represents parameters for fetching a single entity by ID.
 */
interface GetModelByIdParams extends GetAllParams {
    id: string;
}
interface Orderable {
    ordered: boolean;
}
interface TimeoutAware {
    timeout: number;
}
interface FosRequest {
    fos: boolean;
    bridge: boolean;
}
interface StudioRequest {
    studio: boolean;
}
interface RoutableRequest {
    destinationAddress: string;
}
interface AddModelParams<Request> extends Partial<Orderable>, Partial<StudioRequest>, Partial<FosRequest>, Partial<RoutableRequest>, Partial<TimeoutAware> {
    model: Request;
    urlOverride?: string;
    tracker?: string;
}
interface ModifyModelParams<Request> extends Partial<Orderable>, Partial<StudioRequest>, Partial<FosRequest>, Partial<RoutableRequest>, Partial<TimeoutAware> {
    model?: Request;
    id: string;
    urlOverride?: string;
}
export declare class FetchError<T extends Record<string, any> | string = {
    error: string;
}> extends Error {
    payload?: T;
    constructor(message: string, payload?: T);
}
/**
 * Represents parameters for creating a service instance.
 */
interface ServiceFactoryParams {
    destinationAddress?: string;
    basePath: string;
    getAllPath?: string;
    getOnePath?: string;
    deleteModelPath?: string;
    addModelPath?: string;
    modifyModelPath?: string;
    mock?: boolean;
}
/**
 * A factory for creating service instances with common configurations.
 */
export declare const ServiceFactory: {
    /**
     * Builds a service instance with the specified configuration.
     *
     * @param params - The configuration parameters for the service instance.
     * @returns An object with service methods for interacting with the server.
     *
     * @example
     * // Create a Kos service instance for managing entities.
     * const entityService = ServiceFactory.build({
     *   basePath: "/api/entities",
     *   getAllPath: "/list",
     *   getOnePath: "/get",
     *   deleteModelPath: "/delete",
     *   addModelPath: "/add",
     *   modifyModelPath: "/modify",
     * });
     *
     * // Fetch a list of entities.
     * const entities = await entityService.getAll({ ordered: true });
     *
     * // Get details of a specific entity by ID.
     * const entityDetails = await entityService.getModelById({ id: "entity123" });
     *
     * // Add a new entity to the server.
     * const newEntity = { name: "New Entity" };
     * await entityService.addModel({ model: newEntity });
     *
     * // Modify an existing entity.
     * const updatedEntity = { id: "entity123", name: "Updated Entity" };
     * await entityService.modifyModel({ model: updatedEntity });
     */
    build: ({ destinationAddress, basePath, getAllPath, getOnePath, deleteModelPath, addModelPath, modifyModelPath, mock, }: ServiceFactoryParams) => {
        /**
         * Retrieves a list of entities managed by the KOS Server.
         *
         * @param params - The parameters for the request, including common options.
         * @returns The list of entities.
         */
        getAll: <Response>({ urlOverride, ordered, studio, fos, bridge, timeout, destinationAddress: destinationAddressOverride, }: GetAllParams) => Promise<KosServiceResponse<Response[]> | undefined>;
        /**
         * Retrieves details of a specific entity by its ID.
         *
         * @param params - The parameters for the request, including common options and the entity ID.
         * @returns Details of the requested entity.
         */
        getModelById: <Response_1>({ urlOverride, id, ordered, studio, fos, bridge, timeout, destinationAddress: destinationAddressOverride, }: GetModelByIdParams) => Promise<KosServiceResponse<Response_1> | undefined>;
        /**
         * Retrieves details of a single entity.
         *
         * @param params - The parameters for the request, including common options.
         * @returns Details of the requested entity.
         */
        getOne: <Response_2>({ urlOverride, ordered, studio, fos, bridge, tracker, timeout, destinationAddress: destinationAddressOverride, }: GetAllParams) => Promise<KosServiceResponse<Response_2> | undefined>;
        /**
         * Adds a new entity to the server.
         *
         * @param params - The parameters for the request, including common options and the new entity model.
         * @returns An empty response with status 200.
         */
        addModel: <Request>({ model, urlOverride, ordered, tracker, studio, fos, bridge, timeout, destinationAddress: destinationAddressOverride, }: AddModelParams<Request>) => Promise<KosServiceResponse<any> | undefined>;
        /**
         * Deletes an entity from the server based on its ID.
         *
         * @param params - The parameters for the request, including common options and the entity ID.
         * @returns An empty response with status 200.
         */
        deleteModel: <ResponseType = unknown>({ id, tracker, urlOverride, ordered, studio, fos, bridge, destinationAddress: destinationAddressOverride, }: DeleteModelParams) => Promise<KosServiceResponse<ResponseType> | undefined>;
        /**
         * Modifies an existing entity on the server.
         *
         * @param params - The parameters for the request, including common options and the entity model.
         * @returns An empty response with status 200.
         */
        modifyModel: <Request_1>({ model, id, urlOverride, ordered, studio, fos, bridge, timeout, destinationAddress: destinationAddressOverride, }: ModifyModelParams<Request_1>) => Promise<KosServiceResponse<any> | undefined>;
        /**
         * Modifies an existing entity on the server using the HTTP PUT method.
         *
         * @param params - The parameters for the request, including common options and the entity model.
         * @returns An empty response with status 200.
         */
        putModel: <Request_1>({ model, id, urlOverride, ordered, studio, fos, bridge, timeout, destinationAddress: destinationAddressOverride, }: ModifyModelParams<Request_1>) => Promise<KosServiceResponse<any> | undefined>;
        /**
         * Adds a new entity to the server using the HTTP POST method.
         *
         * @param params - The parameters for the request, including common options and the new entity model.
         * @returns An empty response with status 200.
         */
        postModel: <Request>({ model, urlOverride, ordered, tracker, studio, fos, bridge, timeout, destinationAddress: destinationAddressOverride, }: AddModelParams<Request>) => Promise<KosServiceResponse<any> | undefined>;
    };
};
export {};
//# sourceMappingURL=service-factory.d.ts.map