Skip to content

Split the API functions into multiple files

Erwan Rouchet requested to merge split-api into master

I started #1101 (closed) by migrating the image store to Pinia, which requires migrating 1 (one) API function, listImageElements, to TypeScript. I could have renamed api.js to api.ts and just added some ESLint command to ignore all implicit any that TypeScript will detect, but then that means I cannot see when I am having some issues in the things that I actually want to type.

Instead, I split api.js into an awful lot of files, both splitting by general concept and by my guesstimate™ at how complex the typing will be for each portion. src/api/index.ts is the only typed file for now, with just the unique decorator, and we can work on typing each file separately. If needed, we could even just type the API itself without typing the store for now in one MR per file…

Merge request reports

Loading