'Typescript types/intellisense that change dynamically, based on other objects?
I've created a DX tool that's used like this:
const Title = () => (
<Div w_full bg_black text_white />
)
- User passes attributes to a function component
- Component parses the attributes, which are passed into Styled Components
- A CSS rich component is returned
So far so good, and I've got full intellisense for the above keys, but I'm trying to implement a 'describe' attribute, with which the use case is:
const Title = () => (
<Div describe="kinda big, centered on screen" />
The describe string is sent to a language processing API, and the component generates intellisense suggestions based on what the user is likely describing. So once they hit this stage in their typing, it should populate their intellisense with certain tags:
const Title = () => (
<Div
describe="kinda big, centred on screen"
*tags=*
/>
)
Is this possible?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
