The BaseProps type is currently used to create the prop types of intrinsic elements. However, this is hard to read/understand and requires careful usage of the Omit utility type.
This PR creates unique prop types per intrinsic element that are (hopefully) easier to understand and maintain. This also fixes the types so that only <first> and <scope> elements can pass in onEject and onInclude.
I also chose to combine the tokens prop with tokenLimit of the <empty> element to just tokens, which required a slight change to lib.ts, so I added a new test for good measure.
The
BaseProps
type is currently used to create the prop types of intrinsic elements. However, this is hard to read/understand and requires careful usage of theOmit
utility type.This PR creates unique prop types per intrinsic element that are (hopefully) easier to understand and maintain. This also fixes the types so that only
<first>
and<scope>
elements can pass inonEject
andonInclude
.I also chose to combine the
tokens
prop withtokenLimit
of the<empty>
element to justtokens
, which required a slight change tolib.ts
, so I added a new test for good measure.