import { Observable } from 'rxjs'; import { MainService } from '../main/main.service'; import { CustomEntityOptions } from '../models/custom-entity'; import * as i0 from "@angular/core"; /** * custom entity service for drupal using services_entity module * @see https://www.drupal.org/project/services_entity */ export declare class EntityService extends MainService { /** * the entity prefix for all the entities */ entityType: string; /** * getting the full entity url for the entity * @param entityMachineName entity machine name, ex: node, user * @return string of full path to resource */ protected fullRequestURL(entityMachineName: string): string; /** * implement index resource * @param entityMachineName entity machine name, ex: node, user * @param options parameter options * @return array of the required entity type. * personally suggest to create an interface for each type you want to retrive, * you can use the models in this module as a perent interfaces. */ indexEntity(entityMachineName: string, options?: CustomEntityOptions): Observable; /** * implement retrive resource * @param entityMachineName entity machine name, ex: node, user * @param selector the id of the entity * @param options parameter options * @return entity object */ retrieveEntity(entityMachineName: string, selector: number, options?: CustomEntityOptions): Observable; /** * implement delete resource * @param entityMachineName entity machine name, ex: node, user * @param selector the id of the entity * @return null if the entity is deleted,otherwise throws an error. */ deleteEntity(entityMachineName: string, selector: number): Observable; /** * implement create resource * @param entityMachineName entity machine name, ex: node, user * @param entity entity object to create * @return created entity */ createEntity(entityMachineName: string, entity: Object): Observable; /** * implement update resource * @param entityMachineName entity machine name, ex: node, user * @param entity entity to update * @param selector entity id to update and must match the id inside the entity object * @return updated entity */ updateEntity(entityMachineName: string, entity: any, selector: number): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }