Merge pull request #1772 from squoddam/fix-fill-type-gradient

Update `fill` type to accept `CanvasGradient`
This commit is contained in:
Anton Lavrenov 2024-06-04 11:48:25 -05:00 committed by GitHub
commit cb0cbbfe3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ export type LineJoin = 'round' | 'bevel' | 'miter';
export type LineCap = 'butt' | 'round' | 'square'; export type LineCap = 'butt' | 'round' | 'square';
export interface ShapeConfig extends NodeConfig { export interface ShapeConfig extends NodeConfig {
fill?: string; fill?: string | CanvasGradient;
fillPatternImage?: HTMLImageElement; fillPatternImage?: HTMLImageElement;
fillPatternX?: number; fillPatternX?: number;
fillPatternY?: number; fillPatternY?: number;
@ -766,7 +766,7 @@ export class Shape<
dash: GetSet<number[], this>; dash: GetSet<number[], this>;
dashEnabled: GetSet<boolean, this>; dashEnabled: GetSet<boolean, this>;
dashOffset: GetSet<number, this>; dashOffset: GetSet<number, this>;
fill: GetSet<string, this>; fill: GetSet<string | CanvasGradient, this>;
fillEnabled: GetSet<boolean, this>; fillEnabled: GetSet<boolean, this>;
fillLinearGradientColorStops: GetSet<Array<number | string>, this>; fillLinearGradientColorStops: GetSet<Array<number | string>, this>;
fillLinearGradientStartPoint: GetSet<Vector2d, this>; fillLinearGradientStartPoint: GetSet<Vector2d, this>;
@ -815,7 +815,7 @@ export class Shape<
shadowOffsetY: GetSet<number, this>; shadowOffsetY: GetSet<number, this>;
shadowOpacity: GetSet<number, this>; shadowOpacity: GetSet<number, this>;
shadowBlur: GetSet<number, this>; shadowBlur: GetSet<number, this>;
stroke: GetSet<string, this>; stroke: GetSet<string | CanvasGradient, this>;
strokeEnabled: GetSet<boolean, this>; strokeEnabled: GetSet<boolean, this>;
fillAfterStrokeEnabled: GetSet<boolean, this>; fillAfterStrokeEnabled: GetSet<boolean, this>;
strokeScaleEnabled: GetSet<boolean, this>; strokeScaleEnabled: GetSet<boolean, this>;