@aurigma/design-atoms-interfaces
Version:
93 lines (92 loc) • 3.24 kB
TypeScript
/**
* A structure defining the content of empty barcode placeholders.
*/
export interface IEmptyBarcodeContent<TBarcodeFormat, TBarcodeSubType> {
/** The barcode format. */
barcodeFormat?: TBarcodeFormat;
/** The barcode subtype. */
barcodeSubType?: TBarcodeSubType;
}
/**
* A structure defining the content of stub barcode placeholders.
* @example
* ```json
* {
* "defaultItemsConfig": {
* "stubImages": {
* "barcode": {
* "postScriptName": "LucidaSans-Italic",
* "text": "Define a Barcode"
* }
* }
* }
* }
* ```
* @public
*/
export interface IStubBarcodeContent<TBarcodeFormat, TBarcodeSubType> extends IEmptyBarcodeContent<TBarcodeFormat, TBarcodeSubType> {
/** The text message in the stub barcode placeholder. */
text?: string;
/** The font PostScript name of the text message in the stub barcode placeholder. */
postScriptName?: string;
}
/**
* A structure defining the content of linear barcodes.
*/
export interface ILinearBarcodeContent<TBarcodeFormat, TBarcodeSubType> extends IEmptyBarcodeContent<TBarcodeFormat, TBarcodeSubType> {
/** A value encoded into the barcode. */
barcodeValue?: string;
}
/**
* A structure defining the content of VCard QR codes.
*/
export interface IQrVCardBarcodeContent<TBarcodeFormat, TBarcodeSubType> extends IEmptyBarcodeContent<TBarcodeFormat, TBarcodeSubType> {
/** An email address encoded into the QR code. */
email?: string;
/** A first name encoded into the QR code. */
firstName?: string;
/** A last name encoded into the QR code. */
lastName?: string;
/** A cell phone number encoded into the QR code. */
mobilePhone?: string;
/** An organization name encoded into the QR code. */
organization?: string;
/** A work phone number encoded into the QR code. */
phone?: string;
/** A job position encoded into the QR code. */
position?: string;
/** A URL encoded into the QR code. */
url?: string;
}
/**
* A structure defining the content of URL QR codes.
* @example
* ```json
* {
* "defaultItemsConfig": {
* "barcode": {
* "barcodeContent": {
* "barcodeFormat": "QrUrl",
* "url": "example.com"
* }
* }
* }
* }
* ```
* @public
*/
export interface IQrUrlBarcodeContent<TBarcodeFormat, TBarcodeSubType> extends IEmptyBarcodeContent<TBarcodeFormat, TBarcodeSubType> {
/** A URL encoded into the QR code. */
url?: string;
}
/**
* A structure defining the content of VCard QR codes.
*/
export interface IQrPhoneBarcodeContent<TBarcodeFormat, TBarcodeSubType> extends IEmptyBarcodeContent<TBarcodeFormat, TBarcodeSubType> {
/** A phone number encoded into the QR code. */
phone?: string;
}
/**
* Info encoded in the barcode.
*/
export type BarcodeContentType<TBarcodeFormat, TBarcodeSubType> = IEmptyBarcodeContent<TBarcodeFormat, TBarcodeSubType> | IStubBarcodeContent<TBarcodeFormat, TBarcodeSubType> | ILinearBarcodeContent<TBarcodeFormat, TBarcodeSubType> | IQrVCardBarcodeContent<TBarcodeFormat, TBarcodeSubType> | IQrUrlBarcodeContent<TBarcodeFormat, TBarcodeSubType> | IQrPhoneBarcodeContent<TBarcodeFormat, TBarcodeSubType>;