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!