chairemobilite / evolution

MIT License
3 stars 8 forks source link

generator: Use common types with the main survey #532

Open tahini opened 3 weeks ago

tahini commented 3 weeks ago

With #531 the types in the main evolution packages are not generic anymore, so it can be easier for the generator types to use those, as some of the main types are more complete than the generator ones.

samuel-duhaime commented 3 weeks ago

@tahini Could you provide an example?

tahini commented 3 weeks ago

InterviewPathFunction c'est la même chose que ParsingFunction<T>. Beaucoup des types du genre { fr: bla, en: bla } sont en fait des I18nData (qui inclut des parsingFunction), etc. Avant, ces types étaient génériques et donc difficile d'utiliser dans le générateur, mais maintenant, ça peut presque être du find & replace!

tahini commented 2 weeks ago

Also the SectionConfig and SectionConfigs from the generator (in sectionsTypes.ts) should be replaced with SurveySection and SurveySections in interview.ts (evolution-frontend), once the main type is updated. In the generator, it types more fields, but the main one uses some ParsingFunction type where necessary.