Back

User type definition typescript

  • 0
  • General
  • Web
usk
16 Apr, 2024, 04:51

I am trying to the appwrite typescript sdk in my application, account.get() returns a Promise<Models.User<Models.Preferences>>, but the Appwrite sdk does not expose Modal, & hence i am now forced to write my own type for User or use any type. Is there a better way to do this? Is there a way in I can get the Modal user type in my project? my project uses vite & one of the solution mentioned using "moduleResolution": "node" in tsconfig.json instead of "moduleResolution": "bundler". Is my application is a react application. Is using "moduleResolution": "node" a ggod idea? Will it not lead to other issues?

TL;DR
Developers are having issues defining user types in a TypeScript application using the Appwrite SDK. They are currently using any type or writing their own user type due to a missing Modal. One solution suggested is changing "moduleResolution" to "node" in tsconfig.json, instead of "bundler." It is uncertain if this change will cause other issues in a React application.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more