@aurigma/design-atoms-interfaces
Version:
61 lines (60 loc) • 2.43 kB
TypeScript
import { BarcodeContentType } from "./BarcodeContentType";
import { IBarcodeOptions } from "./IBarcodeOptions";
import { IBarcodePermissionsData } from "./IBarcodePermissionsData";
import { IImageItemData } from "./IImageItemData";
/**
* A structure defining the default parameters of barcodes.
* @example The following example illustrates how you can enable two buttons in the Toolbox: the first one opens the standard **QrCode** dialog box, while the second custom button adds a predefined QR code to the canvas.
* ```json
* {
* "widgets": {
* "Toolbox": {
* "buttons": [
* "QrCode",
* {
* "action": "CustomBarcode",
* "iconClass": "cc-icon-qr-code",
* "itemConfig": {
* "barcodeContent": {
* "barcodeFormat": "QrUrl",
* "url": "example.com"
* },
* "name": "Custom barcode",
* "color": "rgb(255,0,0)",
* "width": "100",
* "location": {
* "originX": "left",
* "originY": "bottom",
* "x": "0%",
* "y": "100%"
* },
* "barcodeOptions": {
* "margin": 0
* },
* "manipulationPermissions": {
* "allowMoveHorizontal": false,
* "allowMoveVertical": false,
* "resizeGrips": {
* "edge": false,
* "corner": []
* }
* }
* }
* }
* ]
* }
* }
* }
* ```
* @public
*/
export interface IBarcodeItemData<TOverlayEffect, TBarcodeFormat, TBarcodeSubType> extends IImageItemData<TOverlayEffect> {
/** The content of barcodes. */
barcodeContent?: BarcodeContentType<TBarcodeFormat, TBarcodeSubType>;
/** Defines permissions for barcodes. */
barcodePermissions?: IBarcodePermissionsData;
/** Defines the barcode color. The default value is `"rgb(0, 0, 0)"`. */
color?: string;
/** Defines encoding options. */
barcodeOptions?: IBarcodeOptions;
}