From 510c6034fede1d6f1ffb5d9b3f8674d844ae23ee Mon Sep 17 00:00:00 2001 From: Richard Scotten Date: Sun, 24 Mar 2019 12:01:31 -0700 Subject: [PATCH] updated BaseOptions.format with explicit types --- jsbarcode.d.ts | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/jsbarcode.d.ts b/jsbarcode.d.ts index 2b934bf6..63364c39 100644 --- a/jsbarcode.d.ts +++ b/jsbarcode.d.ts @@ -1,8 +1,29 @@ declare namespace JsBarcode { + type Format = + | "CODE39" + | "CODE128" + | "CODE128A" + | "CODE128B" + | "CODE128C" + | "EAN13" + | "EAN8" + | "EAN5" + | "EAN2" + | "UPC" + | "ITF14" + | "ITF" + | "MSI" + | "MSI10" + | "MSI11" + | "MSI1010" + | "MSI1110" + | "pharmacode" + | "codabar"; + interface BaseOptions { width?: number; height?: number; - format?: string; + format?: Format; displayValue?: boolean; fontOptions?: string; font?: string; @@ -64,7 +85,11 @@ declare namespace JsBarcode { } declare function JsBarcode(element: any): JsBarcode.api; -declare function JsBarcode(element: any, data: string, options?: JsBarcode.Options): void; +declare function JsBarcode( + element: any, + data: string, + options?: JsBarcode.Options +): void; export = JsBarcode; export as namespace JsBarcode;