export interface EventBusResources { } export declare const EventBus: EventBusResources; import { PutEventsCommandOutput } from "@aws-sdk/client-eventbridge"; import { EventBridgeEvent } from "aws-lambda"; import { ZodObject, ZodSchema, z } from "zod"; /** * @link https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eventbridge/Interface/PutEventsCommandInput/ */ type PublishOptions = { traceHeader?: string; }; /** * PutEventsCommandOutput is used in return type of createEvent, in case the consumer of SST builds * their project with declaration files, this is not portable. In order to allow TS to generate a * declaration file without reference to @aws-sdk/client-eventbridge, we must re-export the type. * * More information here: https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189 */ export { PutEventsCommandOutput }; export declare function createEventBuilder any, Validator extends (schema: any) => (input: any) => any, MetadataSchema extends Parameters[0] | undefined>(input: { bus: Bus; metadata?: MetadataSchema; metadataFn?: MetadataFunction; validator: Validator; }): [0]>(type: Type, schema: Schema) => { publish: undefined extends MetadataSchema ? (properties: inferParser["in"], options?: PublishOptions) => Promise : (properties: inferParser["in"], metadata: inferParser["in"], options?: PublishOptions) => Promise; type: Type; $input: inferParser["in"]; $output: inferParser["out"]; $metadata: ReturnType; }; export declare function ZodValidator(schema: Schema): (input: z.input) => z.output; export type ParserZodEsque = { _input: TInput; _output: TParsedInput; }; export type ParserValibotEsque = { _types?: { input: TInput; output: TParsedInput; }; }; export type ParserMyZodEsque = { parse: (input: any) => TInput; }; export type ParserSuperstructEsque = { create: (input: unknown) => TInput; }; export type ParserCustomValidatorEsque = (input: unknown) => Promise | TInput; export type ParserYupEsque = { validateSync: (input: unknown) => TInput; }; export type ParserScaleEsque = { assert(value: unknown): asserts value is TInput; }; export type ParserWithoutInput = ParserCustomValidatorEsque | ParserMyZodEsque | ParserScaleEsque | ParserSuperstructEsque | ParserYupEsque; export type ParserWithInputOutput = ParserZodEsque | ParserValibotEsque; export type Parser = ParserWithInputOutput | ParserWithoutInput; export type inferParser = TParser extends ParserWithInputOutput ? { in: $TIn; out: $TOut; } : TParser extends ParserWithoutInput ? { in: $InOut; out: $InOut; } : never; export type inferEvent; }> = z.infer; type Event = { type: string; $output: any; $metadata: any; }; type EventPayload = { type: E["type"]; properties: E["$output"]; metadata: E["$metadata"]; attempts: number; }; export declare function EventHandler(_events: Events | Events[], cb: (evt: { [K in Events["type"]]: EventPayload>; }[Events["type"]]) => Promise): (event: EventBridgeEvent & { attempts?: number; }) => Promise;