Run pnpm i -D @written/appwrite-types
in your function.
import type AppwriteFunction from '@written/appwrite-types';
export default (ctx => {
// ...
return ctx.json(
{
success: true,
message: 'Hello, World!',
},
200,
{
'x-test': '1',
},
);
}) satisfies AppwriteFunction;
A lot of @written
packages use this for typesafety. If you're using one of these, you will want this package installed, however you will not need to ever directly interact with it.
This is a peer dependency of these as its not strictly required if you're not using TypeScript.