You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using FunctionProps in a Function, type inference will break:
when not using props, event is properly inferred
when specifying props, event drops to any
The root cause is our definition of FunctionProps, which carries with it the type parameters. They will infer to any because there are no arguments that provide the type, which breaks inference.
exportinterfaceFunctionProps<inP=any,O=any,OutPextendsP=P>extendsOmit<aws_lambda.FunctionProps,"code"|"handler"|"runtime"|"onSuccess"|"onFailure">{/** * Method which allows runtime computation of AWS client configuration. * ```ts * new Lambda(clientConfigRetriever('LAMBDA')) * ``` * * @param clientName optionally return a different client config based on the {@link ClientName}. * */clientConfigRetriever?: PrewarmProps["clientConfigRetriever"];/** * The destination for failed invocations. * * Supports use of Functionless {@link IEventBus} or {@link IFunction}. * * ```ts * const bus = new EventBus<> * ``` * * @default - no destination */onSuccess?: FunctionAsyncOnSuccessDestination<OutP,O>;/** * The destination for successful invocations. * * @default - no destination */onFailure?: FunctionAsyncOnFailureDestination<OutP>;}
Proposed solution: remove onSuccess and onFailure from the properties and remove all type parameters.
The text was updated successfully, but these errors were encountered:
When using
FunctionProps
in aFunction
, type inference will break:event
is properly inferredevent
drops toany
The root cause is our definition of
FunctionProps
, which carries with it the type parameters. They will infer toany
because there are no arguments that provide the type, which breaks inference.Proposed solution: remove
onSuccess
andonFailure
from the properties and remove all type parameters.The text was updated successfully, but these errors were encountered: