UNPKG

dynamicsmobile

Version:

Allows development of off-line mobile and web business apps over the Dynamics Mobile platform. More info on https://www.dynamicsmobile.com

47 lines (46 loc) 1.16 kB
export declare enum BarcodeMaskDetectionType { LeadingChar = 0, BarcodeLength = 1 } export declare enum BarcodeMaskSegmentDetectonType { Delimiter = 0, Length = 1 } export type BarcodeMaskSegment = { name: string; length: number; delimiter: string; isDelimiterInSegment: boolean; }; export type BarcodeMask = { name: string; description: string; length: number; maskLengthIncludeLeadingChar: boolean; maskDetectionType: BarcodeMaskDetectionType; charToActivate: string; segmentDetectionType: BarcodeMaskSegmentDetectonType; segments: Array<BarcodeMaskSegment>; }; export type BarcodeParserSettings = { masks: Array<BarcodeMask>; }; export type ParsedBarcode = { mask: BarcodeMask; raw: string; detectedSegments: Array<{ raw: string; value: string; }>; }; export type DetectedSegment = { raw: string; value: string | number; name: string; }; export declare class BarcodeParser { protected settings: BarcodeParserSettings; constructor(settings: BarcodeParserSettings); parse(barcode: string): ParsedBarcode; private detectMask; }