@aurigma/design-atoms-interfaces
Version:
53 lines (52 loc) • 3.31 kB
TypeScript
import { BarcodeContentType } from "./BarcodeContentType";
import { ContentResizeMode } from "./ContentResizeMode";
import { IBarcodeOptions } from "./IBarcodeOptions";
import { IContentPermissionsData } from "./IContentPermissionsData";
import { IPlaceholderPermissionsData } from "./IPlaceholderPermissionsData";
import { IShapeItemData } from "./IShapeItemData";
/**
* A structure defining the default parameters of image placeholders.
* @remarks You can apply these parameters to the `placeholder` object through either **clientConfig.json** or {@link https://customerscanvas.com/dev/editors/iframe-api/reference/design-editor-iframe/iconfiguration.html|IConfiguration}.
* @example The following example shows how you can allow your users to select images only from the **europe_photos** subfolder of the public folder and disable the cover mode.
* ```json
* {
* "defaultItemsConfig": {
* "placeholder": {
* "allowedSubfolder": "europe_photos",
* "isCoverMode": false
* }
* }
* }
* ```
* @public
*/
export interface IPlaceholderItemData<TBarcodeFormat, TBarcodeSubType, TOverlayEffect> extends IShapeItemData {
/** Defines permissions for placeholders. */
placeholderPermissions?: IPlaceholderPermissionsData;
/** Defines permissions for the content of placeholders. */
contentPermissions?: IContentPermissionsData;
/** Defines the resize mode for image placeholders. It can be either `fill`, `fit`, or `original`. The default value is `fill`. */
contentResizeMode?: ContentResizeMode;
/** Defines the barcode color. The default value is `"rgb(0, 0, 0)"`. */
contentBarcodeColor?: string;
/** Defines the content fillColor. */
contentFillColor?: string;
contentBarcodeOptions?: IBarcodeOptions;
contentOverlayEffect?: TOverlayEffect;
/** Defines the barcode format. */
barcodeFormat?: TBarcodeFormat;
/** Defines the barcode content type. */
barcodeContent?: BarcodeContentType<TBarcodeFormat, TBarcodeSubType>;
/** Enables the cover mode for image placeholders. The default value is `true`. */
isCoverMode?: boolean;
/** Maintains the size of stub images while resizing image placeholders. The default value is `false`. */
fixedStubContentSize?: boolean;
/** Defines a subfolder of `/assets/images/` from which the user can select images for placeholders. When you specify this property, the gallery shows images only from the corresponding public subfolder. By default, your users can select images from any gallery tab or public subfolder. */
allowedSubfolder?: string;
/** Defines an array of gallery tab names from which the user can select images for placeholders. For example, to open only the **Public files** and **My files** tabs for image placeholders, set **allowedTabs** to `["Public files", "My files"]`. By default, your users can select images from any gallery tab. */
allowedTabs?: string[];
/** Defines a link to an image used as the placeholder's content. You can define URLs, links to private images (`"user:someprivateimage.png"`), and images from the public gallery (`"public:logos/logo.png"`). */
contentImageUrl?: string;
/** Defines whether this is a stub placeholder. The default value is `false`. */
isStubContent?: boolean;
}