feat(core-realtime): IRealtimeHandler + IInboundDescriptor types

This commit is contained in:
2026-05-08 21:12:47 +02:00
parent 795511b5b3
commit caf86abbe5

View File

@@ -0,0 +1,14 @@
import type { z } from "zod";
import type { RealtimeChannelDescriptor } from "./realtime-channel";
export type RealtimeContext = {
userId: string | null;
roles: string[];
};
export type IRealtimeHandler<T> = (input: T, ctx: RealtimeContext) => Promise<void>;
export type IInboundDescriptor<TName extends string, TSchema extends z.ZodType> = {
readonly descriptor: RealtimeChannelDescriptor<TName, TSchema>;
readonly handler: IRealtimeHandler<z.infer<TSchema>>;
};