From e1bdae08bdb84d9b60391c1131b90d8b5625e10d Mon Sep 17 00:00:00 2001 From: barsa Date: Mon, 15 Dec 2025 11:11:17 +0900 Subject: [PATCH] Refactor imports and update type definitions in Realtime module - Removed unnecessary import of `MessageEvent` from `@nestjs/common` in `realtime.types.ts`. - Updated `realtime.pubsub.ts` to import `OnModuleDestroy` and `OnModuleInit` as types, improving clarity and consistency in type usage. - Added a note in `realtime.types.ts` to clarify the non-generic nature of `MessageEvent` in the current setup, ensuring better understanding of shared type definitions. --- apps/bff/src/infra/realtime/realtime.pubsub.ts | 3 ++- apps/bff/src/infra/realtime/realtime.types.ts | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/bff/src/infra/realtime/realtime.pubsub.ts b/apps/bff/src/infra/realtime/realtime.pubsub.ts index 6476e326..3a5de007 100644 --- a/apps/bff/src/infra/realtime/realtime.pubsub.ts +++ b/apps/bff/src/infra/realtime/realtime.pubsub.ts @@ -1,4 +1,5 @@ -import { Inject, Injectable, Logger, OnModuleDestroy, OnModuleInit } from "@nestjs/common"; +import { Inject, Injectable, Logger } from "@nestjs/common"; +import type { OnModuleDestroy, OnModuleInit } from "@nestjs/common"; import { Redis } from "ioredis"; import { getErrorMessage } from "@bff/core/utils/error.util.js"; import type { RealtimePubSubMessage } from "./realtime.types.js"; diff --git a/apps/bff/src/infra/realtime/realtime.types.ts b/apps/bff/src/infra/realtime/realtime.types.ts index 37964542..9a548fd8 100644 --- a/apps/bff/src/infra/realtime/realtime.types.ts +++ b/apps/bff/src/infra/realtime/realtime.types.ts @@ -1,5 +1,3 @@ -import type { MessageEvent } from "@nestjs/common"; - export interface RealtimeEventEnvelope { event: TEvent; data: TData; @@ -32,4 +30,5 @@ export interface RealtimeStreamOptions { heartbeatEvent?: string | null; } -export type RealtimeMessageEvent = MessageEvent; +// Note: NestJS MessageEvent is not a generic type in our setup (verbatimModuleSyntax + current Nest types). +// Keep this file purely as shared shape definitions.