import { Observable } from 'rxjs'; import { EntityFeedItem, EntityFeedItemWithReaction } from './types'; import * as i0 from "@angular/core"; /** * EntityFeedService — capa de lectura Firestore para entidades proyectables. * * Soporta cualquier tipo de entidad (posts, articles, adoptions, reels...) * siguiendo el esquema de paths: * - Entidades: apps/{appId}/orgs/{orgId}/{entityType}s/{entityId} * - Reacciones del usuario: apps/{appId}/users/{uid}/reactions/{entityType}_{entityId} * * FirestoreService auto-prefija los paths con apps/{appId}/. * * @example * const feed = inject(EntityFeedService); * * // Solo entidades * feed.watchEntities('org_x', 'post').subscribe(posts => ...); * * // Feed con reaccion del viewer incluida * feed.watchFeed('org_x', 'post').subscribe(items => { * items.forEach(item => console.log(item.viewerHasReacted, item.viewerToken)); * }); */ export declare class EntityFeedService { private fs; private auth; /** * Suscripcion en tiempo real a entidades publicadas de un tipo dado. * * Coleccion: orgs/{orgId}/{entityType}s * Auto-prefijada a: apps/{appId}/orgs/{orgId}/{entityType}s * * Filtra por status === 'published', ordena por publishedAt desc. * * @param orgId - ID de la organizacion * @param entityType - Tipo de entidad en singular (ej. 'post', 'article') * @param options - Opciones opcionales (limit, default 20) */ watchEntities(orgId: string, entityType: string, options?: { limit?: number; }): Observable; /** * Suscripcion en tiempo real a las reacciones del usuario actual para un tipo de entidad. * * Coleccion: users/{uid}/reactions * Auto-prefijada a: apps/{appId}/users/{uid}/reactions * * Retorna un Map para lookup O(1) al combinar con el feed. * Si no hay usuario autenticado, retorna un Map vacio. * * @param entityType - Tipo de entidad a filtrar (ej. 'post', 'article') */ watchMyReactions(entityType: string): Observable>; /** * Combina watchEntities + watchMyReactions en un unico stream. * * Cada item del feed incluye viewerToken y viewerHasReacted, listos para * renderizar el estado de reaccion del usuario actual sin logica adicional * en la pagina. * * @param orgId - ID de la organizacion * @param entityType - Tipo de entidad en singular (ej. 'post', 'article') * @param options - Opciones opcionales (limit, default 20) */ watchFeed(orgId: string, entityType: string, options?: { limit?: number; }): Observable[]>; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }