export interface EventBusResources {
}
export declare const EventBus: EventBusResources;
import { EventBridgeEvent } from "aws-lambda";
import { ZodAny, ZodObject, ZodRawShape, z } from "zod";
export declare function createEventBuilder<Bus extends keyof typeof EventBus, MetadataShape extends ZodRawShape | undefined, MetadataFunction extends () => any>(props: {
    bus: Bus;
    metadata?: MetadataShape;
    metadataFn?: MetadataFunction;
}): <Type extends string, Shape extends ZodRawShape, Properties = z.objectOutputType<Shape, ZodAny, "strip">>(type: Type, properties: Shape) => {
    publish: undefined extends MetadataShape ? (properties: Properties) => Promise<void> : (properties: Properties, metadata: z.infer<ZodObject<Exclude<MetadataShape, undefined>, "strip", ZodAny>>) => Promise<void>;
    type: Type;
    shape: {
        metadata: Parameters<undefined extends MetadataShape ? (properties: Properties) => Promise<void> : (properties: Properties, metadata: z.infer<ZodObject<Exclude<MetadataShape, undefined>, "strip", ZodAny>>) => Promise<void>>[1];
        properties: Properties;
        metadataFn: ReturnType<MetadataFunction>;
    };
};
export type inferEvent<T extends {
    shape: ZodObject<any>;
}> = z.infer<T["shape"]>;
type Event = {
    type: string;
    shape: {
        properties: any;
        metadata: any;
        metadataFn: any;
    };
};
type EventPayload<E extends Event> = {
    type: E["type"];
    properties: E["shape"]["properties"];
    metadata: undefined extends E["shape"]["metadata"] ? E["shape"]["metadataFn"] : E["shape"]["metadata"];
    attempts: number;
};
export declare function EventHandler<Events extends Event>(_events: Events | Events[], cb: (evt: {
    [K in Events["type"]]: EventPayload<Extract<Events, {
        type: K;
    }>>;
}[Events["type"]]) => Promise<void>): (event: EventBridgeEvent<string, any> & {
    attempts?: number;
}) => Promise<void>;
export {};
