- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8 - Actualizaciones de configuracion Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { OnGatewayConnection, OnGatewayDisconnect } from '@nestjs/websockets';
|
|
import { Server, Socket } from 'socket.io';
|
|
import { Notification } from '../entities';
|
|
interface AuthenticatedSocket extends Socket {
|
|
userId?: string;
|
|
tenantId?: string;
|
|
}
|
|
export declare class NotificationsGateway implements OnGatewayConnection, OnGatewayDisconnect {
|
|
server: Server;
|
|
private readonly logger;
|
|
private userSockets;
|
|
private socketUsers;
|
|
handleConnection(client: AuthenticatedSocket): void;
|
|
handleDisconnect(client: AuthenticatedSocket): void;
|
|
emitToUser(tenantId: string, userId: string, notification: Partial<Notification>): Promise<number>;
|
|
emitToTenant(tenantId: string, event: string, data: any): Promise<void>;
|
|
handleMarkAsRead(client: AuthenticatedSocket, payload: {
|
|
notificationId: string;
|
|
}): void;
|
|
handleMarkAllAsRead(client: AuthenticatedSocket): void;
|
|
handleGetUnreadCount(client: AuthenticatedSocket): {
|
|
event: string;
|
|
};
|
|
emitUnreadCount(tenantId: string, userId: string, count: number): Promise<void>;
|
|
emitNotificationDeleted(tenantId: string, userId: string, notificationId: string): Promise<void>;
|
|
getConnectedUsersCount(): number;
|
|
getTotalConnections(): number;
|
|
isUserOnline(tenantId: string, userId: string): boolean;
|
|
private extractUserId;
|
|
private extractTenantId;
|
|
}
|
|
export {};
|