@experteam-mx/ngx-services
Version:
Angular common services for Experteam apps
56 lines (55 loc) • 2.5 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Environment } from '../ngx-services.models';
import { Observable } from 'rxjs';
import { QueryParams } from './models/api.models';
import { SuppliesOut, SupplyIn, SupplyOut, SupplyTypesOut } from './models/api-supplies.types';
import * as i0 from "@angular/core";
export declare class ApiSuppliesService {
private environments;
private http;
constructor(environments: Environment, http: HttpClient);
/**
* Retrieves the URL for the API supplies endpoint.
*
* @return {string} The API supplies URL or an empty string if not defined.
*/
get url(): string;
/**
* Fetches a list of supplies based on the provided query parameters.
*
* @param {QueryParams} params - The query parameters to filter the supplies.
* @return {Observable<SuppliesOut>} An observable containing the list of supplies.
*/
getSupplies(params: QueryParams): Observable<SuppliesOut>;
/**
* Retrieves the supply details for a given supply ID.
*
* @param {number} id - The unique identifier of the supply to retrieve.
* @return {Observable<SupplyOut>} An observable containing the supply details.
*/
getSupply(id: number): Observable<SupplyOut>;
/**
* Sends a supply object to the server and returns the created or updated supply information.
*
* @param {SupplyIn} body - The supply information to be sent to the server.
* @return {Observable<SupplyOut>} An observable containing the response with the supply data.
*/
postSupply(body: SupplyIn): Observable<SupplyOut>;
/**
* Updates an existing supply with the provided data.
*
* @param {number} id - The unique identifier of the supply to update.
* @param {SupplyIn} body - The data to update the supply with.
* @return {Observable<SupplyOut>} An observable containing the updated supply information.
*/
putSupply(id: number, body: SupplyIn): Observable<SupplyOut>;
/**
* Fetches the supply types based on the provided query parameters.
*
* @param {QueryParams} params - The query parameters to filter the supply types.
* @return {Observable<SupplyTypesOut>} An Observable that emits the supply types data.
*/
getSupplyTypes(params: QueryParams): Observable<SupplyTypesOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiSuppliesService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiSuppliesService>;
}