nestjs-typed-events
Version:
Typesafe NestJS event emitter module
29 lines (28 loc) • 996 B
TypeScript
import { z } from 'zod';
import { ContractEvent } from './types';
declare const contract: {
"test.event": import("./types").Entry<z.ZodObject<{
foo: z.ZodString;
}, "strip", z.ZodTypeAny, {
foo: string;
}, {
foo: string;
}>>;
} & {
"optional.event": import("./types").Entry<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
};
declare const ContractEvent: <ResourceKey extends "test.event" | "optional.event">(key: ResourceKey) => (target: import("type-fest").Constructor<import("./decorator").Watcher<({
"test.event": import("./types").Entry<z.ZodObject<{
foo: z.ZodString;
}, "strip", z.ZodTypeAny, {
foo: string;
}, {
foo: string;
}>>;
} & {
"optional.event": import("./types").Entry<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
})[ResourceKey]["schema"]>, any[]>) => void;
export declare class TestWatcher {
handle(props: ContractEvent<typeof contract['test.event']>): Promise<void>;
}
export {};