I am currently building my own abstraction on top of styled-components and I won't my theme getters to be strictly typed.
type Theme = {
colors: {
blue: [
string,
string,
],
red: {
a: string;
b: string;
}
orange: Array<string>;
},
}
type Paths<Theme, "/"> = ...;
// Type will be these values
// "colors/blue/0"
// "colors/blue/1"
// "colors/red/a"
// "colors/red/b"
// `colors/orange/${number}`
Perhaps the Paths type could return instead tuples that resample the path and we could have a Join type to join the tuples with a delimiter.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too