Appearance
API Reference
@repo/electron-ipc가 export하는 모든 심볼의 시그니처와 설명.
엔트리포인트
| 경로 | 용도 | Electron 의존성 |
|---|---|---|
@repo/electron-ipc | 메인 프로세스 (DI, 데코레이터, createApp) | O |
@repo/electron-ipc/contract | IPC 선언 (defineIpc, defineWindows, contract, handle, forward, 타입) | X |
@repo/electron-ipc/bridge | preload (exposeBridge) | O |
@repo/electron-ipc/service | 렌더러 (createService) | X |
데코레이터
Injectable()
DI 컨테이너에 등록 가능한 서비스를 표시한다.
ts
function Injectable(): (target: Constructor, context: ClassDecoratorContext) => voidController(contract)
IPC 핸들러를 포함하는 클래스를 표시한다. 두 가지를 동시에 수행한다:
- 클래스 형태 강제 — 클래스가
ControllerOf<C>를 만족하지 않으면 컴파일 에러. 메서드 누락이나 시그니처 mismatch가 IDE에서 잡힌다. - 자동 채널 바인딩 — 부트스트랩 시
contract.handles와contract.forwards를 순회해 동일 이름의 메서드를 IPC 채널에 바인딩한다.
ts
function Controller<C extends Contract>(
contract: C
): <T extends Constructor<ControllerOf<C>>>(
target: T,
context: ClassDecoratorContext<T>
) => void매개변수:
| 이름 | 타입 | 설명 |
|---|---|---|
contract | Contract | 도메인 contract. 클래스 형태와 채널 바인딩에 사용. 부를 수 있는 창(windows)과 알림 기본 대상(forward to)도 contract가 정한다 |
WARNING
createApp은 contract 없이 등록된 controller를 거부한다. @Controller(contract) 형태로 사용한다.
UsePipes(...pipes)
핸들러 메서드에 Pipe를 적용한다. 글로벌 Pipe 이후에 실행된다.
ts
function UsePipes(...pipes: IpcPipe[]): (target: IpcHandler, context: ClassMethodDecoratorContext) => void매개변수:
| 이름 | 타입 | 설명 |
|---|---|---|
pipes | IpcPipe[] | 핸들러에 적용할 Pipe 인스턴스 |
OnWindow(stage, options?)
provider 메서드를 창 수명 단계에 건다. 창이 열릴 때마다(메인·서브) 불리며 kind로 거를 수 있다. 메타데이터는 자기 클래스에만 스코프된다 (Lifecycle 참고).
ts
function OnWindow(
stage: WindowStage,
options?: { kind?: RegisteredWindowKind | RegisteredWindowKind[] }
): MethodDecorator
type WindowStage = 'created' | 'loaded' | 'shown' | 'focused' | 'blurred' | 'closing' | 'closed'
type WindowHook = (window: BrowserWindow, kind: RegisteredWindowKind) => void | booleanclosing 훅이 false를 돌려주면 창이 닫히지 않는다. 훅은 동기다.
Module(metadata)
provider와 controller를 모듈 단위로 그룹화한다.
ts
function Module(metadata: ModuleMetadata): (target: Constructor, context: ClassDecoratorContext) => void매개변수:
| 이름 | 타입 | 설명 |
|---|---|---|
metadata | ModuleMetadata | 모듈 구성 정보 |
Contract 헬퍼 (@repo/electron-ipc/contract)
handle(channel, options?)
IPC invoke 채널의 타입을 정의한다. options.schema를 전달하면 프레임워크가 핸들러 실행 전에 모든 Pipe보다 먼저 schema.parse(args[0])로 강제한다.
ts
function handle<A extends unknown[], R>(
channel: string,
options?: { schema?: Parseable },
): HandleDef<A, R>제네릭:
| 이름 | 설명 |
|---|---|
A | 인자 타입 (tuple) |
R | 반환 타입. void이면 service에서 true | null 반환 |
매개변수:
| 이름 | 타입 | 설명 |
|---|---|---|
channel | string | IPC 채널 이름 |
options.schema | Parseable | 선택. 인자 검증/파싱에 사용할 스키마 (Zod 등) |
forward(channel, options?)
IPC 이벤트 채널의 타입을 정의한다. options.to로 기본 알림 대상을 정한다 — 없으면 모든 창, emit(data, target)의 target이 우선한다.
ts
function forward<T>(channel: string, options?: { to?: BroadcastScope }): ForwardDef<T>
type BroadcastScope = 'all' | { kind: RegisteredWindowKind | RegisteredWindowKind[] }제네릭:
| 이름 | 설명 |
|---|---|
T | 이벤트 데이터 타입 |
send(channel, options?)
렌더러 → 메인 단방향 알림(fire-and-forget) 채널의 타입을 정의한다. handle과 달리 응답이 없다 — 게스트 뷰처럼 신뢰할 수 없는 발신자에게 응답 표면을 열지 않기 위한 primitive다.
ts
function send<T>(channel: string, options?: { schema?: Parseable }): SendDef<T>제네릭:
| 이름 | 설명 |
|---|---|
T | 알림 데이터 타입 |
controller 메서드는 (data: T, ctx: IpcContext) => void 형태로 구현하며, 발신자 식별이 필요하면 ctx.event.sender를 쓴다. 바인딩에는 AppConfig.sendGuards가 필수다.
contract(def)
handle·forward·send를 하나의 도메인 contract로 묶는다.
ts
function contract<H, F, S>(def: {
handles: H
forwards?: F
sends?: S
windows?: RegisteredWindowKind[] // 이 contract를 부를 수 있는 창. 없으면 모든 창
}): Contract<H, F, S>windows를 주면 다른 창·레지스트리에 없는 창의 요청(handle·send 모두)은 guard 거부와 같은 UNAUTHORIZED로 막힌다.
클래스
Container
싱글톤 레지스트리. provider를 등록하고 lifecycle을 관리한다.
ts
class Container {
constructor(options?: ContainerOptions)
register(token: Constructor): void
resolve<T>(token: Constructor<T>): T
createInstance<T>(cls: Constructor<T>): T
resolveAll(): void
initAll(): void
runWindowHooks(stage: WindowStage, window: BrowserWindow, kind: RegisteredWindowKind): boolean
disposeAll(): void
}| 메서드 | 설명 |
|---|---|
register(token) | @Injectable 표시된 클래스를 등록한다 |
resolve(token) | 싱글톤 인스턴스를 반환한다. 첫 호출 시 생성한다 |
createInstance(cls) | 레지스트리에 등록하지 않는 일회성 인스턴스를 생성한다 |
resolveAll() | 등록된 모든 provider를 등록 순서대로 eagerly resolve한다 |
initAll() | OnInit.onInit()을 등록 순서대로 호출한다 |
runWindowHooks(stage, window, kind) | 모든 provider의 @OnWindow(stage) 훅을 등록 순서대로 호출한다. closing에서 하나라도 false면 false |
disposeAll() | OnDispose.onDispose()를 등록 순서대로 호출한다 |
WindowRegistry
AppConfig.windows에 선언된 창의 유일한 주인. 창 이름마다 인스턴스 하나만 둔다. 프레임워크가 만들어 provider로 등록하므로 서비스는 inject(WindowRegistry)로 받는다.
ts
class WindowRegistry {
open(kind: RegisteredWindowKind, overrides?: BrowserWindowConstructorOptions): BrowserWindow
get(kind: RegisteredWindowKind): BrowserWindow | null
kindOf(window: BrowserWindow): RegisteredWindowKind | null
def(kind: RegisteredWindowKind): WindowDef
all(): BrowserWindow[]
close(kind: RegisteredWindowKind): void
closeAll(): void
}| 메서드 | 설명 |
|---|---|
open(kind, overrides?) | 창을 연다. 이미 열려 있으면 포커스만 옮기고 그 창을 돌려준다. overrides는 이번 생성에만 선언 위에 덮인다 (위치 등) |
get(kind) | 열려 있는 창. 없거나 파괴됐으면 null |
kindOf(window) | 창의 이름. 레지스트리가 모르는 창(앱이 직접 만든 팝업 등)이면 null |
def(kind) | defaults와 창별 선언을 합친 최종 선언. 크기 등 선언값이 필요할 때 읽는다 |
all() | 살아있는 모든 창. forward 브로드캐스트 대상 |
close(kind) | 열린 창을 닫는다. 안 열려 있으면 무시 |
closeAll() | 살아있는 모든 창을 닫는다. 메인 창이 닫힐 때 프레임워크가 부른다 |
EventSource<T>
Service가 도메인 이벤트를 발행하는 경량 이벤트 버스. contract의 forward 메서드가 반환한다.
ts
class EventSource<T = void> {
emit(data: T, target?: BroadcastTarget): void
subscribe(listener: (data: T, target?: BroadcastTarget) => void): () => void
}
type BroadcastTarget =
| BroadcastScope // 'all' | { kind }
| { window: BrowserWindow } // 그 창 하나만
| { except: BrowserWindow | undefined } // 그 창을 뺀 전체(없으면 전체) — 요청한 창은 이미 아는 값일 때target이 없으면 contract forward의 to, 그것도 없으면 레지스트리가 아는 모든 창에 보낸다. 닫힌 창은 건너뛴다.
| 메서드 | 설명 |
|---|---|
emit(data) | 이벤트를 발행한다. 등록된 모든 리스너에 데이터를 전달한다 |
subscribe(listener) | 리스너를 등록하고 해제 함수를 반환한다 |
SenderGuard
발신자가 AppConfig.windows에 선언된 창의 최상위 webContents인지 검증하는 내장 Guard. ctx.kind가 있고 ctx.window.webContents === sender면 허용한다. 앱이 직접 만든 창(외부 페이지 팝업 등)은 레지스트리에 없어 거부된다.
ts
class SenderGuard implements IpcGuard {
canActivate(ctx: IpcContext): boolean
}GuestViewGuard
발신자가 선언된 창에 얹힌 자식 뷰(WebContentsView 등)인지 검증하는 내장 Guard. SenderGuard의 대칭으로, send 채널의 발신자 정책(AppConfig.sendGuards)에 쓴다.
ts
class GuestViewGuard implements IpcGuard {
canActivate(ctx: IpcContext): boolean
}함수
createApp(config)
모듈을 부트스트랩하고 IPC 핸들러를 등록하는 팩토리. 반환된 객체의 start()로 앱을 시작한다.
ts
function createApp<Cs, W extends WindowKinds>(config: AppConfig<Cs, W>): App<W>
interface App<W> {
start(): BrowserWindow // 메인 창을 열고 IPC를 연결한다
windows: WindowRegistry // 서비스에서는 inject(WindowRegistry)
kinds: W // ipc.windows 그대로
}자세한 설정은 AppConfig를 참고한다.
defineIpc(def) — @repo/electron-ipc/contract
앱의 IPC 선언을 만든다. shared에 한 번 만들어 세 프로세스에 그대로 넘긴다 — 메인 createApp({ ipc }), preload exposeBridge(ipc), 렌더러 createService(ipc).
ts
function defineIpc<Cs extends Record<string, Contract>, W extends WindowKinds>(def: {
contracts: Cs // 도메인 이름 → contract. 'window' 키는 내장 도메인이라 쓸 수 없다
windows: W // 창 이름 → 선언. main 필수
}): IpcManifest<Cs, W>defineWindows(windows) — @repo/electron-ipc/contract
창 선언을 만드는 타입 추론용 항등 함수. 창 목록을 따로 상수로 빼서 Register에 등록할 때 쓴다 — 키가 창 이름 타입이 되고 창별 추가 속성(route 등)이 보존된다.
ts
function defineWindows<W extends WindowKinds>(windows: W): WexposeBridge(ipc) — @repo/electron-ipc/bridge
IPC 선언대로 bridge를 만들어 렌더러에 노출한다. preload에서 이 한 줄이면 된다. 각 handle은 ipcRenderer.invoke(), 각 forward는 ipcRenderer.on()으로 바인딩되고, 내장 window 도메인이 자동으로 붙는다. window.self는 이 창의 이름이다 — WindowRegistry가 프로세스 인자로 심어 준다.
ts
function exposeBridge(ipc: IpcManifest): void노출 키(BRIDGE_KEY)와 전역 타입은 프레임워크가 소유한다. 창 종류 인자가 없으면 에러 — WindowRegistry가 만들지 않은 창의 preload에서는 쓸 수 없다. bridge 객체를 직접 다뤄야 하면 createBridge(contracts)를 쓴다.
createGuestBridge(contracts) — @repo/electron-ipc/bridge
contracts 맵에서 게스트 뷰 전용 bridge를 생성한다. sends만 ipcRenderer.send()로 바인딩한다 — invoke도 수신도 없는 최소 표면이라 신뢰할 수 없는 웹 컨텐츠 옆(게스트 preload)에 두어도 앱 API가 노출되지 않는다.
ts
function createGuestBridge<Cs extends Record<string, Contract>>(
contracts: Cs
): GuestBridgeAPI<Cs>createService(ipc, options?) — @repo/electron-ipc/service
preload의 exposeBridge(ipc)가 노출한 bridge를 받아 IpcResponse를 자동 언래핑하는 service 객체를 생성한다. 내장 window 도메인이 같은 규칙으로 붙는다 (service.window.self, open, close, focus, isFullscreen, onStageChanged, onFullscreenChanged). bridge가 없으면 원인을 담아 에러가 난다.
ts
function createService<Cs extends Record<string, Contract>>(
ipc: IpcManifest<Cs>,
options?: ServiceOptions<Cs>
): ServiceAPI<Cs>
interface ServiceOptions<Cs> {
/** 실패 시 호출되는 중앙 에러 훅. null 반환 직전에 불린다 */
onError?: (error: IpcError, ctx: { domain: string; method: string }) => void;
/** bridge를 직접 넘긴다 (테스트·특수 환경용). 없으면 exposeBridge가 노출한 것을 쓴다 */
bridge?: BridgeAPI<Cs>;
}언래핑 규칙:
- handle (데이터 반환): 성공 시
data, 실패 시null - handle (void 반환): 성공 시
true, 실패 시null - forward: 패스스루
에러 계약: handle 메서드는 절대 throw하지 않는다. 메인의 { ok: false, error } 응답과 invoke 자체의 rejection(핸들러 미등록, 직렬화 불가 등 — code: 'INVOKE_ERROR') 모두 onError 호출 후 null로 수렴한다. onError 훅이 throw해도 계약은 유지된다.
inject(token)
클래스 필드 이니셜라이저에서 의존성을 주입한다. Container의 인스턴스 생성 컨텍스트 안에서만 호출할 수 있다.
ts
function inject<T>(token: Constructor<T>): T매개변수:
| 이름 | 타입 | 설명 |
|---|---|---|
token | Constructor<T> | resolve할 서비스 클래스 |
인터페이스
AppConfig
createApp()에 전달하는 설정 객체. 자세한 설명은 AppConfig 레퍼런스를 참고한다.
ts
interface AppConfig<Cs, W extends WindowKinds> {
ipc: IpcManifest<Cs, W>
windows: WindowsPolicy<W>
modules: Constructor[]
guards?: IpcGuard[]
sendGuards?: IpcGuard[]
pipes?: IpcPipe[]
exceptionHandler?: IpcExceptionHandler
logger?: AppLogger
onError?: (name: string, error: unknown) => void
}IpcManifest<Cs, W>
defineIpc()의 결과. 세 프로세스가 공유하는 앱의 IPC 선언.
ts
interface IpcManifest<Cs, W extends WindowKinds> {
readonly contracts: Cs
readonly windows: W
}
interface WindowDef extends Omit<BrowserWindowConstructorOptions, 'show'> {
show?: boolean | 'ready' // 'ready': 숨긴 채 만들고 첫 화면 준비(ready-to-show) 후 표시
}
type WindowKinds = Record<string, WindowDef> & { main: WindowDef }WindowsPolicy<W>
AppConfig.windows. 메인만 아는 창 정책 (AppConfig 참고).
ts
interface WindowsPolicy<W extends WindowKinds> {
defaults?: WindowDef // 모든 창 공통 옵션 (얕은 병합)
load: (window: BrowserWindow, kind: keyof W & string, def: WindowDef & W[keyof W]) => void
}WindowContract
프레임워크 내장 window contract. 앱 contracts 옆에 window 도메인으로 자동으로 붙어 렌더러가 창을 이름으로 다룬다. Electron 무관이라 @repo/electron-ipc/contract에서도 가져올 수 있다.
ts
const windowContract = contract({
handles: {
open: handle<[kind: RegisteredWindowKind], void>('electron-ipc:window:open'),
close: handle<[kind: RegisteredWindowKind], void>('electron-ipc:window:close'),
focus: handle<[kind: RegisteredWindowKind], void>('electron-ipc:window:focus'),
isFullscreen: handle<[kind: RegisteredWindowKind], boolean>('electron-ipc:window:is-fullscreen'),
},
forwards: {
onStageChanged: forward<WindowStageEvent>('electron-ipc:window:stage'),
onFullscreenChanged: forward<WindowFullscreenEvent>('electron-ipc:window:fullscreen'),
},
})
interface WindowStageEvent { kind: RegisteredWindowKind; stage: WindowStage }
interface WindowFullscreenEvent { kind: RegisteredWindowKind; fullscreen: boolean }| 메서드 | 동작 |
|---|---|
open(kind) | 창을 연다. 이미 열려 있으면 포커스만. 선언에 없는 이름은 에러 봉투 |
close(kind) / focus(kind) | 열린 창에만. 안 열려 있으면 무시 |
isFullscreen(kind) | 안 열려 있으면 false |
onStageChanged | 어떤 창이든 단계 진입 시. 취소된 closing은 나가지 않는다 |
onFullscreenChanged | 어떤 창이든 fullscreen 상태 변경 시 |
메인 쪽 구현은 프레임워크가 createApp에서 앱 컨트롤러와 함께 바인딩하므로 앱이 할 일은 없다. 요청은 앱의 guards를 그대로 거친다.
Register
앱이 창 선언 타입을 등록하는 빈 인터페이스. 선택 사항 — 등록하지 않아도 전부 동작하고 창 이름만 string이 된다. 등록하면 RegisteredWindowKind가 창 선언의 키로 좁혀져 WindowRegistry, @OnWindow, IpcContext.kind, contract의 windows·to, 렌더러의 service.window가 전부 자동완성된다.
ts
// shared/ipc.ts
const windows = defineWindows({ main: {...}, settings: {...} });
export const ipc = defineIpc({ contracts, windows });
declare module '@repo/electron-ipc' {
interface Register { windows: typeof windows }
}
type RegisteredWindowKind = Register extends { windows: infer W } ? keyof W & string : stringcontract의 windows: ['main']이 이 타입을 쓰므로 등록 대상은 contract를 담은 ipc가 아니라 창 선언만이다(순환 참조 방지). 선언을 바꾼 직후 편집기가 string으로 보이면 TS 서버를 재시작한다.
AppLogger
AppConfig.logger에 전달하는 로거 인터페이스.
ts
interface AppLogger {
info(message: string): void
}ContainerOptions
Container 생성자에 전달하는 옵션.
ts
interface ContainerOptions {
onError?: (name: string, error: unknown) => void
}IpcContext
Guard와 ExceptionHandler에 전달되는 IPC 요청 컨텍스트.
ts
interface IpcContext {
event: IpcMainInvokeEvent
channel: string
window: BrowserWindow // 요청을 보낸 창 (발신자 미상이면 메인 창)
kind: RegisteredWindowKind | null // 그 창의 이름. 레지스트리가 모르는 창·발신자 미상이면 null
args: unknown[]
}IpcGuard
IPC 요청 검증 인터페이스.
ts
interface IpcGuard {
canActivate(ctx: IpcContext): boolean | Promise<boolean>
}IpcPipe
IPC 인자 변환/검증 인터페이스. Guard 이후, 핸들러 이전에 실행된다.
ts
interface IpcPipe {
transform(args: unknown[], ctx: IpcContext): unknown[] | Promise<unknown[]>
}IpcExceptionHandler
IPC 에러 처리 인터페이스. catch()는 IpcError를 반환한다. 프레임워크가 이를 IpcResponse의 { ok: false, error } 형태로 래핑하여 렌더러에 전달한다.
ts
interface IpcExceptionHandler {
catch(error: unknown, ctx: IpcContext): IpcError
}OnInit
윈도우 생성 전 초기화 lifecycle.
ts
interface OnInit {
onInit(): void
}OnDispose
윈도우 종료 시 정리 lifecycle.
ts
interface OnDispose {
onDispose(): void
}타입
Parseable
Zod 의존 없이 parse(data) 호출만 요구하는 인터페이스. handle()의 schema 옵션에 전달한다.
ts
interface Parseable {
parse(data: unknown): unknown
}HandleDef<A, R>
handle() 함수가 반환하는 handle 정의 타입.
ts
type HandleDef<A extends unknown[] = unknown[], R = unknown> = {
readonly _tag: 'handle'
readonly channel: string
readonly schema?: Parseable // 인자 검증/파싱 스키마
readonly _args: A // 타입 추론 전용
readonly _return: R // 타입 추론 전용
}ForwardDef<T>
forward() 함수가 반환하는 forward 정의 타입.
ts
type ForwardDef<T = unknown> = {
readonly _tag: 'forward'
readonly channel: string
readonly to?: BroadcastScope // 기본 알림 대상
readonly _data: T // 타입 추론 전용
}Contract<H, F>
contract() 함수가 반환하는 도메인 contract 타입.
ts
type Contract<H, F, S> = {
readonly handles: H
readonly forwards: F
readonly sends: S
readonly windows?: RegisteredWindowKind[] // 부를 수 있는 창
}BridgeAPI<Cs>
contracts 맵에서 preload bridge API 타입을 추출한다. 내장 window 도메인이 항상 포함된다.
ts
type BridgeAPI<Cs extends Record<string, Contract>> = {
[K in keyof Cs]: SingleBridgeAPI<Cs[K]>
} & { window: WindowBridgeAPI }
type WindowBridgeAPI = SingleBridgeAPI<WindowContract> & {
readonly self: RegisteredWindowKind // 이 창의 이름
}- handle →
(...args: A) => Promise<IpcResponse<R>> - forward →
(callback: (data: T) => void) => () => void
ServiceAPI<Cs>
contracts 맵에서 렌더러 service API 타입을 추출한다. IpcResponse가 자동 언래핑된다.
ts
type ServiceAPI<Cs extends Record<string, Contract>> = {
[K in keyof Cs]: SingleServiceAPI<Cs[K]>
} & { window: WindowServiceAPI }
type WindowServiceAPI = SingleServiceAPI<WindowContract> & {
readonly self: RegisteredWindowKind // 이 창의 이름
}- handle (R이 데이터) →
(...args: A) => Promise<R | null> - handle (R이 void) →
(...args: A) => Promise<true | null> - forward →
(callback: (data: T) => void) => () => void
IpcError
IPC 에러를 표현하는 구조체.
ts
type IpcError = { code: string; message: string }IpcResponse<T>
IPC 핸들러 응답의 discriminated union. createApp()이 모든 핸들러 응답을 이 형태로 자동 래핑한다.
ts
type IpcResponse<T> =
| { ok: true; data: T }
| { ok: false; error: IpcError }렌더러에서는 createService()가 자동 언래핑하므로 직접 다룰 필요가 없다.
ModuleMetadata
@Module() 데코레이터에 전달하는 모듈 구성 정보.
ts
type ModuleMetadata = {
providers: Constructor[]
controllers: Constructor[]
}ControllerOf<C>
Contract에서 controller가 만족해야 할 클래스 형태를 추출한다. @Controller(contract)가 내부적으로 사용하여 클래스 시그니처를 강제한다.
handles[K]→(...args: A, ctx: IpcContext) => R | Promise<R>—ctx는 마지막 인자. 발신 창이 필요 없으면 안 받아도 된다forwards[K]→() => EventSource<T>
ts
type ControllerOf<C extends Contract> = {
[K in keyof C['handles']]: (
...args: [...C['handles'][K]['_args'], ctx: IpcContext]
) => C['handles'][K]['_return'] | Promise<C['handles'][K]['_return']>
} & {
[K in keyof C['forwards']]: () => EventSource<C['forwards'][K]['_data']>
}HandleEntry
contract에서 추출되는 채널-메서드 매핑 정보. 프레임워크 내부에서 사용한다.
ts
type HandleEntry = {
channel: string
methodKey: string
pipes?: IpcPipe[]
}ForwardEntry
contract에서 추출되는 forward 채널-메서드 매핑 정보. 프레임워크 내부에서 사용한다.
ts
type ForwardEntry = {
channel: string
methodKey: string
}IpcHandler
IPC 핸들러 함수 타입.
ts
type IpcHandler = (...args: any[]) => unknown | Promise<unknown>내부 유틸리티 함수
데코레이터 메타데이터를 조회하는 함수. 프레임워크 내부에서 사용하지만 export되어 있다.
isInjectable(cls)
클래스에 @Injectable() 데코레이터가 적용되었는지 확인한다.
ts
function isInjectable(cls: Constructor): booleangetControllerContract(cls)
@Controller()에 전달된 contract를 반환한다. createApp이 채널 바인딩에 사용한다.
ts
function getControllerContract(cls: Constructor): Contract | undefinedgetControllerMethodPipes(cls)
@UsePipes로 등록된 메서드별 pipe 맵을 반환한다.
ts
function getControllerMethodPipes(cls: Constructor): Map<string, IpcPipe[]>getModuleMetadata(cls)
@Module() 클래스의 메타데이터를 반환한다.
ts
function getModuleMetadata(cls: Constructor): ModuleMetadata | undefined