The solution causes a tsc complaint for strings not matching the union of literals "left" | "middle" | "right".
Argument of type '{ width: number; } | { align: string; width: number; }' is not assignable to parameter of type 'AlignmentOptions'.
Type '{ align: string; width: number; }' is not assignable to type 'AlignmentOptions'.
Types of property 'align' are incompatible.
Type 'string' is not assignable to type '"left" | "middle" | "right" | undefined'.
PR Checklist
Overview
The solution causes a
tsc
complaint forstring
s not matching the union of literals"left" | "middle" | "right"
.