From 01c95168f205199b767607008688dad1e64b85d9 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 23 Jan 2018 08:02:48 -0800 Subject: [PATCH] Make font weight types in ITerminalOption more strict --- src/Interfaces.ts | 6 +++--- src/Types.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Interfaces.ts b/src/Interfaces.ts index 424f7692..6d1c36d3 100644 --- a/src/Interfaces.ts +++ b/src/Interfaces.ts @@ -4,7 +4,7 @@ */ import { ICharset, ILinkMatcherOptions } from './Interfaces'; -import { LinkMatcherHandler, LinkMatcherValidationCallback, LineData } from './Types'; +import { LinkMatcherHandler, LinkMatcherValidationCallback, LineData, FontWeight } from './Types'; import { IColorSet, IRenderer } from './renderer/Interfaces'; import { IMouseZoneManager } from './input/Interfaces'; @@ -139,8 +139,8 @@ export interface ITerminalOptions { disableStdin?: boolean; fontSize?: number; fontFamily?: string; - fontWeight?: string; - fontWeightBold?: string; + fontWeight?: FontWeight; + fontWeightBold?: FontWeight; handler?: (data: string) => void; letterSpacing?: number; lineHeight?: number; diff --git a/src/Types.ts b/src/Types.ts index 3263282e..336ac5cc 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -16,3 +16,5 @@ export enum LinkHoverEventTypes { TOOLTIP = 'linktooltip', LEAVE = 'linkleave' } + +export type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';