Closed j-m closed 2 years ago
Those data types receives its name from the spec. E.g. <color>
becomes DataType.Color
and <content-distribution>
becomes DataType.ContentDistribution
. It happens quite frequent that these data types are split into several data types or/and name changes as the spec develops. So there's a risk that a minor/patch update from csstype
can break your typing if you're using the DataType
namespace. But it's easily solved by updating the csstype
dependency in package.json and change to the correct data type. So I can add a JSdoc comment about these risks and export it.
Makes sense. Sounds perfect, yes please!
@frenic do we already have a forecast of when this will be available for use?
Published in csstype@3.1.0
I was wondering whether it'd be possible for the package to export its
DataType
namespace, please? Or is there a reason not to?I think it'd be pretty useful, for example, I'm wanting to limit the prop values of
alignItems
andjustifyContent
to be justDataType.ContentPosition | DataType.ContentDistribution
. The existing type doesn't really limit the prop values as it uses| string
:export type JustifyContent = Globals | DataType.ContentDistribution | DataType.ContentPosition | "left" | "normal" | "right" | (string & {});
I had a quick search through the issues and only found this unanswered question: