import { aws_events } from "aws-cdk-lib"; import { DynamicProps, IEventBus, IntegrationWithEventBus } from "./event-bus"; import { IRule } from "./rule"; import { Event } from "./types"; /** * A function interface used by the {@link Rule}'s map function. * * event is the event matched by the rule. This argument is optional. * $utils is a collection of built-in utilities wrapping EventBridge TargetInputs like contextual constants available to the transformer. * * @typeParam - Evnt - The event type from the {@link Rule}. * @typeParam - OutEvnt - The narrowed event type after the transform is applied. */ export declare type EventTransformFunction = (event: Evnt, $utils: EventTransformUtils) => OutEvnt; /** * https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html#eb-transform-input-predefined */ export interface EventTransformUtils { context: { ruleArn: string; ruleName: string; ingestionTime: string; eventJson: string; }; } /** * Represents an event that has been transformed using Target Input Transformers. * https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html * * @see Rule.map for more details on transforming event details. * * @typeParam - Evnt - The event type from the {@link Rule}. * @typeParam - Out - The narrowed event type after the transform is applied. * @typeParam - OutEvnt - Covariant form of {@link Evnt}. Should be inferred. */ export declare class EventTransform { readonly rule: IRule; readonly targetInput: aws_events.RuleTargetInput; /** * This static property identifies this class as an EventTransform to the TypeScript plugin. */ static readonly FunctionlessType = "EventTransform"; constructor(func: EventTransformFunction, rule: IRule); /** * Defines a target of the {@link EventTransform}'s rule using this TargetInput. * * EventBus is not a valid pipe target for transformed events. * * @see Rule.pipe for more details on pipe. */ pipe, Props extends object | undefined>(integration: NonEventBusIntegration, ...props: Parameters>): void; pipe(callback: (targetInput: aws_events.RuleTargetInput) => aws_events.IRuleTarget): void; } /** * EventBus to EventBus input transform is not allowed. */ export declare type NonEventBusIntegration = I extends IEventBus ? never : I; export declare const deploymentOnlyModule = true; //# sourceMappingURL=transform.d.ts.map