Open jneug opened 4 months ago
A lot of these will be getting coercions in a future update. Most likely it will be in the form of additionally accepted types followed by a default post-transform.
Will keep this open to track.
Regarding inset
and other such things, these would make for a good addition as a schema rather than a type (see schema folder for examples)
18 added a schema for the Typst builtin type "stroke". But most of the time
stroke
arguments accept either one ofstroke
,length
,color
ordict
. Similarlyfill
usually acceptscolor
,gradient
orpattern
.There should be types to support this, since those are very common use-cases in Typst.
I suggest these compound types:
strokes
:z.either(z.stroke(), z.length(), z.color(), z.dictionary( (thickness: z.length(optional:true), ...) ))
fill
:z.either(z.color(), z.gradient(), z.pattern())
(pattern
is still missing as a base-type, I think)inset
:z.either(z.length(), z.dictionary( (x: z.length(optional:true), ...) ))
I probably missed some.