bitfront-library
Version:
Angular CLI project with components and classes used by other Angular projects of the BIT foundation.
38 lines (37 loc) • 1.29 kB
TypeScript
import { Observable } from "rxjs";
import { BaseFilter } from "./base.filter";
import { Item } from "../../shared/data/item";
import { FormType } from "../../shared/global.constants";
/**
* Interface básica para cualquier servicio CRUD.
*/
export interface BaseCRUDServiceInterface {
/** Inserta o modifica la información del elemento. */
save(object: Item, mode: FormType, params?: {
[key: string]: string;
}): any;
/** Elimina el elemento. */
delete(id: Number, params?: {
[key: string]: string;
}): any;
/** Elimina todos los elementos especificados por parámetros */
deleteAll(items: number[], params?: {
[key: string]: string;
}): Observable<any>;
/** Recupera la información del elemento. */
get(id: Number, params?: {
[key: string]: string;
}): any;
/** Recupera todos los elementos */
getAll(params?: {
[key: string]: string;
}): any;
/** Recupera la lista (opcionalmente, filtrada y paginada) de elementos. */
getAllByFilter(filter: BaseFilter, params?: {
[key: string]: string;
}): any;
/** Recupera el número total de la lista (filtrada) de elementos. */
countAllByFilter(filter: BaseFilter, params?: {
[key: string]: string;
}): any;
}