Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated BaseOptions.format with explicit format types #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions jsbarcode.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;