Iām trying to migrate the existent mars-theme to typescript as a starting point for a new theme and I noticed there is no way to know the types of the state.frontity fields. Should I define them manually in my themeās types or should they be defined somewhere else?
EDIT: Also, I noticed that tiny-router is importing @frontity/router types, but that package is declared as a dev dependency, so when you do npm i inside a Frontity project, those packages are not installed and you will have TypeScript complaining.
Good question. Iāve only defined url because Iām not sure which ones should be the standard.
I wonāt like to add too many things to the āstandardā. Maybe title and description are basic, since you wonāt usually want to retrieve them from the REST API, right?
I didnāt miss anything else. Itās just a bit weird to define some fields under the frontity namespace, and then to type them in the theme, but I guess that if we cover those 3, people will define the new ones under the theme namespace.
If you want me to add those types in a PR let me know
did you ever succeed in creating the TS version of the mars theme? And if so, would you mind sharing? I was about to start working on this when I realised that I am likely not the first one who thought about this and found your old post.
Hi! Iām afraid I stopped working on that. But I didnāt actually ported mars-theme to TypeScript, I built another theme from it. So you can proceed with your theme!