From ccb2dae37690839ca37408340e3f4a8ead9803c8 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 25 Oct 2020 19:15:34 +0800 Subject: [PATCH] type complement --- src/Shape.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Shape.ts b/src/Shape.ts index 879f08a4..5406bec6 100644 --- a/src/Shape.ts +++ b/src/Shape.ts @@ -21,6 +21,9 @@ export type ShapeConfigHandler = { bivarianceHack(ctx: Context, shape: TTarget): void; }['bivarianceHack']; +export type LineJoin = 'round' | 'bevel' | 'miter'; +export type LineCap = 'butt' | 'round' | 'square'; + export interface ShapeConfig extends NodeConfig { fill?: string; fillPatternImage?: HTMLImageElement; @@ -58,8 +61,8 @@ export interface ShapeConfig extends NodeConfig { strokeScaleEnabled?: boolean; strokeHitEnabled?: boolean; strokeEnabled?: boolean; - lineJoin?: string; - lineCap?: string; + lineJoin?: LineJoin; + lineCap?: LineCap; sceneFunc?: (con: Context, shape: Shape) => void; hitFunc?: (con: Context, shape: Shape) => void; shadowColor?: string; @@ -789,8 +792,8 @@ export class Shape extends Node< fillPatternY: GetSet; fillPriority: GetSet; hitFunc: GetSet, this>; - lineCap: GetSet; - lineJoin: GetSet; + lineCap: GetSet; + lineJoin: GetSet; perfectDrawEnabled: GetSet; sceneFunc: GetSet, this>; shadowColor: GetSet;