From cc78984783f6518e13505d155e59acc982768968 Mon Sep 17 00:00:00 2001 From: Job Vonk Date: Wed, 29 Apr 2020 13:40:41 +0200 Subject: [PATCH] Added TextStyleOptions interface --- lib/index.d.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 17c1ae5..6adf4bf 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -149,6 +149,12 @@ export class Texture { constructor(url: string); } +interface TextStyleOptions { + font?: string, + fill?: string | CanvasGradient | CanvasPattern, + align?: CanvasTextAlign +} + /** * Text class */ @@ -158,18 +164,14 @@ export class Text { text: string; visible: boolean; update?: (dt?: number, t?: number) => void; - style: { - font?: string, - fill?: string | CanvasGradient | CanvasPattern, - align?: CanvasTextAlign - }; + style: TextStyleOptions' /** * Prints styled text on canvas * @param text Text to print * @param style Styles to apply to text */ - constructor(text: string, style: {}); + constructor(text: string, style: TextStyleOptions); } /**