@glowlabs-org/events-sdk
Version:
Typed event SDK for Glow, powered by RabbitMQ and Zod.
19 lines (18 loc) • 705 B
TypeScript
import type { EventPayload, EventPayloadMap, EventType } from "./types";
interface CreateGlowEventEmitterOptions {
username: string;
password: string;
zoneId: number;
exchangePrefix?: string;
host?: string;
}
interface EmitEventArgs<T extends EventType, V extends keyof EventPayloadMap[T]> {
eventType: T;
schemaVersion: V;
payload: EventPayload<T, V>;
}
export declare function createGlowEventEmitter({ username, password, zoneId, exchangePrefix, host, }: CreateGlowEventEmitterOptions): {
emit: <T extends EventType, V extends keyof import("./types").EventPayloadMap[T]>(args: EmitEventArgs<T, V>) => Promise<void>;
disconnect: () => Promise<void>;
};
export {};