UNPKG

simpleddp-node

Version:

The aim of this library is to simplify the process of working with meteor server over DDP protocol using external JS environments

10 lines (9 loc) 425 B
/** * DDP event listener */ import DDPClient, { DDPMessage, User } from '../DDPClient'; import { PUBLIC_EVENTS } from '../ddp/ddp'; export declare function ddpEventListener<T extends typeof PUBLIC_EVENTS[number] = typeof PUBLIC_EVENTS[number]>(eventname: string, f: T extends 'login' ? (user: User) => void : (message: DDPMessage, id: string) => void, ddplink: DDPClient): { start: () => void; stop: () => void; };