@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
293 lines (292 loc) • 9.67 kB
TypeScript
import { BarcodeFormat, BarcodeSubType, TextAlignment, BlendMode, OverlayEffect, ResizeGripsCorner } from "@aurigma/design-atoms-model/Product/Items";
import { IStrokeSettings, IShadowSettings } from "@aurigma/design-atoms-model/Product/Interfaces";
export interface IPointF {
x?: number;
y?: number;
}
export interface IManipulationPermissionsData {
allowDelete?: boolean;
allowMoveHorizontal?: boolean;
allowMoveVertical?: boolean;
allowRotate?: boolean;
allowDragAndDrop?: boolean;
resizeGrips?: IResizeGripsPermissions;
}
export interface IResizeGripsPermissions {
edge?: boolean;
corner?: ResizeGripsCorner[];
}
export interface IImagePermissionsData {
allowChangeImage?: boolean;
allowEditImage?: boolean;
allowKeepOverlayColor?: boolean;
}
export interface IBarcodePermissionsData {
allowChangeBarcodeType?: boolean;
allowChangeBarcodeContent?: boolean;
allowChangeBarcodeColor?: boolean;
}
export interface IItemPermissionsData {
allowZOrderChange?: boolean;
allowOpacityChange?: boolean;
allowRemoveOnLayoutChange?: boolean;
itemToolbarPermissions?: IItemToolbarPermissionsData;
}
export interface IItemToolbarPermissionsData {
showDeleteButton?: boolean;
showEditButton?: boolean;
showSelectButton?: boolean;
showHandleButton?: boolean;
}
export interface ILinePermissionsData {
allowChangeLineWidth?: boolean;
allowChangeLineColor?: boolean;
}
export interface ITextPermissionsData {
allowChangeText?: boolean;
allowChangeFont?: boolean;
allowChangeFontSize?: boolean;
allowChangeFontColor?: boolean;
allowChangeTextAlignment?: boolean;
allowChangeTextBIU?: boolean;
allowChangeShadow?: boolean;
allowChangeStroke?: boolean;
allowTextFormatting?: boolean;
allowChangeStrokeColor?: boolean;
}
export interface IShapePermissionsData {
allowChangeBorderWidth?: boolean;
allowChangeFillColor?: boolean;
allowChangeBorderColor?: boolean;
}
export interface IVisualizationPermissionsData {
noPrint?: boolean;
noShow?: boolean;
}
export declare type WrappingMode = "none" | "square" | "tight";
export interface IItemData {
manipulationPermissions?: IManipulationPermissionsData;
visualizationPermissions?: IVisualizationPermissionsData;
itemPermissions?: IItemPermissionsData;
violationSettings?: IViolationSettings;
angle?: number;
textWrappingMode?: WrappingMode;
opacity?: number;
location?: ILocationData;
themeBinding?: IThemeBindingData;
name?: string;
isVariable?: boolean;
width?: string | number;
height?: string | number;
blendMode?: BlendMode;
adjustSize?: boolean;
}
export declare type ImageEffect = "none" | "blackAndWhite" | "flipVertical" | "flipHorizontal" | "colorize" | "blackAndTransparent";
export interface IImageItemData extends IContentItemData {
imagePermissions?: IImagePermissionsData;
addImageAsPlaceholder?: boolean;
overlayColor?: string;
overlayEffect?: OverlayEffect;
imageUrl?: string;
effect?: ImageEffect;
}
export interface IPlaceholderPermissionsData {
allowEditContent?: boolean;
showSelectButton?: boolean;
showHandleButton?: boolean;
}
export interface IContentPermissionsData {
imagePermissions?: IImagePermissionsData;
barcodePermissions?: IBarcodePermissionsData;
}
export declare type ContentResizeMode = "fill" | "fit" | "original";
export interface IPlaceholderItemData extends IShapeItemData {
placeholderPermissions?: IPlaceholderPermissionsData;
contentPermissions?: IContentPermissionsData;
contentResizeMode?: ContentResizeMode;
contentBarcodeColor?: string;
contentBarcodeOptions?: IBarcodeOptions;
contentOverlayEffect?: OverlayEffect;
barcodeFormat?: BarcodeFormat;
barcodeContent?: BarcodeContentType;
isCoverMode?: boolean;
fixedStubContentSize?: boolean;
allowedSubfolder?: string;
allowedTabs?: string[];
contentImageUrl?: string;
isStubContent?: boolean;
}
export interface IEmptyBarcodeContent {
barcodeFormat?: BarcodeFormat;
barcodeSubType?: BarcodeSubType;
}
export interface IStubBarcodeContent extends IEmptyBarcodeContent {
text?: string;
postScriptName?: string;
}
export interface ILinearBarcodeContent extends IEmptyBarcodeContent {
barcodeValue?: string;
}
export interface IQrVCardBarcodeContent extends IEmptyBarcodeContent {
email?: string;
firstName?: string;
lastName?: string;
mobilePhone?: string;
organization?: string;
phone?: string;
position?: string;
url?: string;
}
export interface IQrUrlBarcodeContent extends IEmptyBarcodeContent {
url?: string;
}
export interface IQrPhoneBarcodeContent extends IEmptyBarcodeContent {
phone?: string;
}
export declare type BarcodeContentType = IEmptyBarcodeContent | IStubBarcodeContent | ILinearBarcodeContent | IQrVCardBarcodeContent | IQrUrlBarcodeContent | IQrPhoneBarcodeContent;
export interface IBarcodeItemData extends IImageItemData {
barcodeContent?: BarcodeContentType;
barcodePermissions?: IBarcodePermissionsData;
color?: string;
barcodeOptions?: IBarcodeOptions;
}
export interface IBarcodeOptions {
margin?: number;
pureBarcode?: boolean;
errorCorrection?: string;
characterSet?: string;
pdf417Compact?: boolean;
pdf417Compaction?: string;
pdf417Dimensions?: {};
disableEci?: boolean;
code128ForceCodesetB?: boolean;
aztecLayers?: number;
qrVersion?: number;
xDimension?: number;
databarExpandedSegments?: number;
}
export interface ILocationData {
x?: string | number;
y?: string | number;
originX?: OriginPointType;
originY?: OriginPointType;
}
export interface IShapeItemData extends IItemData {
borderWidth?: number;
borderColor?: string;
fillColor?: string;
overprintStroke?: boolean;
overprintFill?: boolean;
shapePermissions?: IShapePermissionsData;
}
export interface IRectangleItemData extends IShapeItemData {
}
export interface IEllipseItemData extends IShapeItemData {
}
export interface IContentItemData extends IRectangleItemData {
maskOpacity?: number;
fillColor?: string;
}
export declare enum OriginPointType {
Left = "left",
Right = "right",
Top = "top",
Bottom = "bottom",
Center = "center"
}
export declare type HorizontalOriginPointType = OriginPointType.Left | OriginPointType.Right | OriginPointType.Center;
export declare type VerticalOriginPointType = OriginPointType.Top | OriginPointType.Bottom | OriginPointType.Center;
export interface IBaseTextItemData extends IContentItemData {
text?: string;
font?: IFontSettingsData;
alignment?: TextAlignment;
underline?: boolean;
color?: string;
tracking?: number;
leading?: number;
previewLeading?: number;
horizontalScale?: number;
verticalScale?: number;
previewScale?: number;
stroke?: IStrokeSettings;
shadow?: IShadowSettings;
textPermissions?: ITextPermissionsData;
overlapLinesEnabled?: boolean;
checkTextCrop?: boolean;
overprintText?: boolean;
}
export interface IFontSettingsData {
previewSize?: number | string;
postScriptName?: string;
size?: number | string;
fauxBold?: boolean;
fauxItalic?: boolean;
allCaps?: boolean;
}
export interface IPlainTextItemData extends IBaseTextItemData {
isVertical?: boolean;
}
export interface IArchedTextItemData extends IBaseTextItemData {
bend?: number;
warp?: boolean;
}
export interface IParagraphSettingsData {
overlapLines?: boolean;
rightIndent?: number;
leftIndent?: number;
spaceBefore?: number;
spaceAfter?: number;
firstLineIndent?: number;
}
export declare type VerticalAlignmentType = "top" | "center" | "bottom";
export declare type ShrinkMode = "scale" | "size";
export declare type OverflowStrategy = "clip" | "fitToWidth" | "fitToBox" | "expandBox";
export interface IBoundedTextItemData extends IBaseTextItemData {
wrappingMargin?: number;
paragraphSettings?: IParagraphSettingsData;
verticalAlignment?: VerticalAlignmentType;
characterLimit?: number;
isVertical?: boolean;
maxLineLength?: number;
maxLineCount?: number;
overflowStrategy?: OverflowStrategy;
textShrinkMode?: ShrinkMode;
}
export interface ITextItemData extends IBaseTextItemData, IBoundedTextItemData, IArchedTextItemData {
}
export interface IRichTextData extends IBaseTextItemData, IBoundedTextItemData {
}
export interface IGroupItemData extends IItemData {
}
export interface IClipartItemData extends IGroupItemData {
}
export interface ILineItemData extends IItemData {
width?: number;
color?: string;
fixedWidth?: boolean;
point0?: IPointF;
point1?: IPointF;
linePermissions?: ILinePermissionsData;
overprintStroke?: boolean;
}
export interface IThemeBindingData {
text?: string;
stroke?: string;
shadow?: string;
img?: string;
border?: string;
fill?: string;
textFill?: string;
line?: string;
barcode?: string;
styles?: string[];
}
export interface IViolationSettings {
allowSafetyLines?: boolean;
allowRegion?: boolean;
allowBleedArea?: boolean;
allowShape?: boolean;
allowTextCrop?: boolean;
allowImageQuality?: boolean;
allowInPlaceText?: boolean;
}