Thank you for maintaining Types-for-Adobe.
The type parameter of ScriptUIGraphics.newBrush() appears to be declared as typeof ScriptUIGraphics.BrushType. As a result, passing an enum value produces a TypeScript error:
const brush = graphics.newBrush(
ScriptUIGraphics.BrushType.SOLID_COLOR,
[1, 1, 1, 1],
);
Argument of type '_BrushOrPenType' is not assignable to parameter of type 'typeof _BrushOrPenType'.
It seems that the parameter should accept _BrushOrPenType rather than typeof _BrushOrPenType.
The same issue may also apply to ScriptUIGraphics.newPen() and other related declarations.
Would changing the parameter type as follows be appropriate?
newBrush(
type: _BrushOrPenType,
color: number[],
name?: string,
): ScriptUIBrush;
Thank you for taking a look.
Thank you for maintaining Types-for-Adobe.
The
typeparameter ofScriptUIGraphics.newBrush()appears to be declared astypeof ScriptUIGraphics.BrushType. As a result, passing an enum value produces a TypeScript error:It seems that the parameter should accept
_BrushOrPenTyperather thantypeof _BrushOrPenType.The same issue may also apply to
ScriptUIGraphics.newPen()and other related declarations.Would changing the parameter type as follows be appropriate?
Thank you for taking a look.