stitchesjs / stitches

[Not Actively Maintained] CSS-in-JS with near-zero runtime, SSR, multi-variant support, and a best-in-class developer experience.
https://stitches.dev
MIT License
7.72k stars 251 forks source link

force createStitches return typing #1106

Open yovanoc opened 1 year ago

yovanoc commented 1 year ago

Hello,

I would like to know how to force the return type.

In this case, I want to build a wrapper around createStitches for my lib.

I want the users to be able to override the config BUT that there is ALWAYS this xs field for example.

image

The more curious case is that if we explicitly add the return type like this the typescript server crash and don't want to work anymore.

image

PS: If you want a branch to debug, you can pull this one, and try on this file: https://github.com/Achaak/pikas/blob/fix/stitches-typing/packages/ui/styles/src/css.ts

Thanks ☺️