import { Observable } from "rxjs"; import { HttpService } from "./http.service"; /** * Abstract CRUD service * Manages basic CRUD-related actions with server backend, and provides some basic helper methods for use in extensions * @param TModel Type for entity that CRUD service is associated with * @param TId Type for PK of entity that CRUD service is associated with */ export declare abstract class CrudService { protected http: HttpService; /** * Default headers to provide with each request */ protected headers: Map; protected constructor(http: HttpService); /** * Fetch a single entity by ID * @param id PK of entity to fetch */ get(id: TId): Observable; /** * Fetch all entities */ getAll(): Observable; /** * Create a single entity * @param model Model for new entity */ create(model: TModel): Observable; /** * Update an existing entity * @param id PK of entity to update * @param model Model for updated entity */ update(id: TId, model: TModel): Observable; /** * Delete/deactivate an existing entity * @param id PK of entity to delete/deactivate */ delete(id: TId): Observable; /** * Helper method for making CRUD-related HTTP GET requests * * @param paths Array of path parts * @param pks Array of key parts * @param queryParams Map of param name (key - string) to param value * @param responseType Expected response type of the server ('arraybuffer' | 'blob' | 'json' | 'text') * @param headers Map of header name (key - string) to header value * @param getResponseObject Boolean to indicate if you want the full HTTP response, not just data */ protected getMultiPk(paths: string[], pks: any[], queryParams?: Map, responseType?: string, headers?: Map, getResponseObject?: boolean): Observable; /** * Helper method for making CRUD-related HTTP PUT requests * * @param paths Array of path parts * @param pks Array of key parts * @param body Request body * @param queryParams Map of param name (key - string) to param value * @param responseType Expected response type of the server ('arraybuffer' | 'blob' | 'json' | 'text') * @param headers Map of header name (key - string) to header value * @param getResponseObject Boolean to indicate if you want the full HTTP response, not just data */ protected updateMultiPk(paths: string[], pks: any[], body?: any, queryParams?: Map, responseType?: string, headers?: Map, getResponseObject?: boolean): Observable; /** * Helper method for making CRUD-related HTTP POST requests * * @param paths Array of path parts * @param pks Array of key parts * @param body Request body * @param queryParams Map of param name (key - string) to param value * @param responseType Expected response type of the server ('arraybuffer' | 'blob' | 'json' | 'text') * @param headers Map of header name (key - string) to header value * @param getResponseObject Boolean to indicate if you want the full HTTP response, not just data */ protected createMultiPk(paths: string[], pks: any[], body?: any, queryParams?: Map, responseType?: string, headers?: Map, getResponseObject?: boolean): Observable; /** * Helper method for making CRUD-related HTTP DELETE requests * * @param paths Array of path parts * @param pks Array of key parts * @param queryParams Map of param name (key - string) to param value * @param responseType Expected response type of the server ('arraybuffer' | 'blob' | 'json' | 'text') * @param headers Map of header name (key - string) to header value * @param getResponseObject Boolean to indicate if you want the full HTTP response, not just data */ protected deleteMultiPk(paths: string[], pks: any[], queryParams?: Map, responseType?: string, headers?: Map, getResponseObject?: boolean): Observable; /** * Helper method to build URL based on chaining arrays of paths and keys together * @param pks Array of path parts * @param paths Array of key parts */ protected buildUrl(pks: any[], paths: any[]): string; }