In the templates there are always "any" as type... But is there any type declaration that i can use?
(And i don't want to write a whole type from scratch)
Edit: I tried the http types, but than the res.json is not valid. And i tried the express types, but than the res.status throws an error in appwrite
TypeScript
export default async ({ req, res, log, error }: {
req: someType;
res: someType;
log: (msg: any) => void;
error: (msg: any) => void;
}) => {}
TL;DR
Developers want to know if there are type declarations they can use for Appwrite Functions instead of using "any" type. They tried using HTTP types and Express types, but encountered issues with res.json and res.status.
Solution: Developers can specify a more specific type for req and res such as Express's `Request` and `Response` types without needing to write a whole type from scratch.
```js
export default async ({ req, res, log, error }: {
req: Express.Request;
res: Express.Response;
log: (msg: any) => void;
error: (msg: any)Recommended threads
- After assigning a domain to my Dart func...
I’ve attached the images. Could anyone please explain how this execution is being performed?
- I can't UNPAUSE my project with the free...
I received an email notifying me that my project had been paused due to inactivity, and the email included a link to "Restore project." However, that button red...
- Error trying to deploy functions from CL...
✗ Error • on-auth-create (6a00b2ab000c9ce2949b) • Server Error ✗ Error: No functions were pushed. Prject ID: 69ffe0270033a4ac420a