Looks like the Api construct does not allow you to...
# sst
m
Looks like the Api construct does not allow you to pass a
LambdaFunction
as a function type. It has to be a
Function
from sst. However I cannot use sst's
Function
as a type in another construct because it is banned. Am I missing something?
Copy code
Don't use `Function` as a type. The `Function` type accepts any function-like value.
It provides no type safety when calling the function, which can be a common source of bugs.
It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.
If you are expecting the function to accept certain arguments, you should explicitly define the function shape
t
This is because js is getting confused with the native Function type
Alias your import
Or star import it and reference it as sst.Function
m
yup, good catch. Thank you!
(still think api should accept lambda functions from cdk)
t
Yeah I'm thinking about why it doesn't
Probably should