symref
Version:
Static code checker for AI code agents (Windsurf, Cline, etc.)
27 lines • 883 B
JavaScript
export class NotificationService {
constructor(userService) {
this.notifications = [];
this.userService = null;
if (userService) {
this.userService = userService;
}
}
setUserService(userService) {
this.userService = userService;
}
notify(notification) {
this.notifications.push(notification);
this.logNotification(notification);
}
getNotificationsForUser(userId) {
return this.notifications.filter(n => n.userId === userId);
}
logNotification(notification) {
var _a;
const user = (_a = this.userService) === null || _a === void 0 ? void 0 : _a.getUser(notification.userId);
if (user) {
console.log(`[${notification.type}] ${notification.message} (User: ${user.name})`);
}
}
}
//# sourceMappingURL=NotificationService.js.map