@glowlabs-org/events-sdk
Version:
Typed event SDK for Glow, powered by RabbitMQ and Zod.
16 lines (15 loc) • 660 B
TypeScript
import type { EventType, EventPayload, EventPayloadMap, GlowEvent } from "./types";
interface CreateGlowEventListenerOptions {
username: string;
password: string;
zoneId: number;
queueName?: string;
exchangePrefix?: string;
host?: string;
}
export declare function createGlowEventListener({ username, password, zoneId, queueName, exchangePrefix, host, }: CreateGlowEventListenerOptions): {
onEvent: <T extends EventType, V extends keyof EventPayloadMap[T]>(eventType: T, schemaVersion: V, handler: (event: GlowEvent<EventPayload<T, V>>) => void) => void;
start: () => Promise<void>;
stop: () => Promise<void>;
};
export {};