au-widget-data-driven-editor/interfaces
Interfaces
IDataDrivenEditor
Describes the Data-Driven Editor element and its methods.
Extends
HTMLElement
Properties
$isValid
$isValid: Observable<boolean>;
Observable for the validity state of the editor.
Methods
getFormData()
getFormData(config): Record<string, string>;
Retrieves the filled-in form data.
Parameters
| Parameter | Type |
|---|---|
config | IFormDataConfig |
Returns
Record<string, string>
getIdString()
getIdString(): Promise<string>;
Gets the identification string.
Returns
Promise<string>
getInvalidFieldsNames()
getInvalidFieldsNames(): string[];
Allows you to get the names of fields that have not been validated.
Returns
string[]
getPdfPreview()
getPdfPreview(config): Promise<string>;
Gets a PDF preview.
Parameters
| Parameter | Type |
|---|---|
config | Partial<IRendererConfig> |
Returns
Promise<string>
getPreview()
getPreview(
designId,
width,
height): Promise<string[]>;
Gets preview images for the specified design.
Parameters
| Parameter | Type |
|---|---|
designId | string |
width | number |
height | number |
Returns
Promise<string[]>
getPreviewLink()
getPreviewLink(
designId,
width,
height): Promise<string>;
Gets a preview link for the specified design.
Parameters
| Parameter | Type |
|---|---|
designId | string |
width | number |
height | number |
Returns
Promise<string>
save()
save(asNew?): Promise<string>;
Saves the design. If asNew is true, creates a new private design.
Parameters
| Parameter | Type |
|---|---|
asNew? | boolean |
Returns
Promise<string>
setEditorConfig()
setEditorConfig(config): Promise<void>;
Sets the editor configuration.
Parameters
| Parameter | Type |
|---|---|
config | IEditorConfig |
Returns
Promise<void>
setLang()
setLang(lang): void;
Sets the editor language.
Parameters
| Parameter | Type |
|---|---|
lang | string |
Returns
void
setUserInfo()
setUserInfo(userInfo): void;
Sets user information and updates the form and design.
Parameters
| Parameter | Type |
|---|---|
userInfo | Record<string, string> |
Returns
void
updateToken()
updateToken(token): void;
Updates the access token.
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
void
validate()
validate(): boolean;
Validates the form.
Returns
boolean
IDesignConfig
Describes the design configuration for the editor.
Properties
dataSetId?
optional dataSetId?: string;
Dataset identifier in Asset Storage.
designId
designId: string;
Design identifier in Asset Storage.
designPath
designPath: string;
Path to the design file in Asset Storage.
isPrivateDesign
isPrivateDesign: boolean;
Flag for private design.
IEditorAccess
Describes access credentials for the editor.
Properties
tenantId
tenantId: string;
Tenant identifier.
token
token: string;
Access token.
userId
userId: string;
User identifier.
IEditorAPI
Describes the API endpoints for the editor services.
Properties
assetProcessor
assetProcessor: string;
Asset Processor service URL.
assetStorage
assetStorage: string;
Asset Storage service URL.
backOffice
backOffice: string;
BackOffice URL.
designAtoms
designAtoms: string;
Design Atoms service URL.
IEditorConfig
Provides the main configuration for the Data-Driven Editor.
Example:
{
"access": { "tenantId": "tenant1", "userId": "user1", "token": "token1" },
"design": { "designId": "design1", "dataSetId": "dataset1" },
"api": { "designAtoms": "https://api.example.com/design-atoms" },
"settings": { "lang": "en", "allowManipulations": false },
"renderer": { "width": 800, "height": 600, "format": "Pdf" }
}
Properties
access
access: Partial<IEditorAccess>;
Access credentials for the editor.
api
api: IEditorAPI;
API endpoints for the editor services.
design
design: Partial<IDesignConfig>;
Design configuration.
preview
preview: object;
Preview image dimensions.
height
height: number;
width
width: number;
renderer
renderer: IRendererConfig;
Rendering configuration.
settings?
optional settings?: IEditorSettings;
Editor settings.
translation?
optional translation?: Record<string, any>;
Interface translation configuration.
userInfo?
optional userInfo?: Record<string, string>;
User information for automatic form filling.
IEditorSettings
Describes the settings for the Data-Driven Editor.
Properties
allowManipulations?
optional allowManipulations?: boolean;
Enables/disables manipulation of design elements. Default: false.
itemsSnapLines?
optional itemsSnapLines?: boolean;
Enables/disables snapping of design elements to other elements. Default: false.
lang?
optional lang?: string;
Language used in the editor. Default: "en".
printAreaSnapLines?
optional printAreaSnapLines?: boolean;
Enables/disables snapping to print areas.
regionSnapLines?
optional regionSnapLines?: boolean;
Enables/disables snapping to regions.
safetyLinesSnapLines?
optional safetyLinesSnapLines?: boolean;
Enables/disables snapping to safety lines.
symbols?
optional symbols?: string[];
List of symbols available for insertion.
violationWarningsSettings?
optional violationWarningsSettings?: IViolationServiceConfiguration;
Configuration for violation warnings.
IFormDataConfig
Describes the configuration for retrieving form data.
Properties
readImageAs?
optional readImageAs?: "image-source-id";
How to read images in the form data.
readInvalidValues?
optional readInvalidValues?: boolean;
Whether to include invalid values in the result.
IRendererConfig
Describes the rendering configuration for the final files.
Properties
format
format: FormatTypes;
Format of the output file.
height
height: number;
Height of the output file.
interpolationMode
interpolationMode: InterpolationModes;
Interpolation mode for the output file.
safetyLinesEnabled
safetyLinesEnabled: boolean;
Whether to render safety lines.
watermarkEnabled
watermarkEnabled: boolean;
Whether to enable watermark.
watermarkOpacity
watermarkOpacity: number;
Opacity of the watermark (0 to 1).
watermarkRepeat
watermarkRepeat: boolean;
Whether to repeat the watermark.
width
width: number;
Width of the output file.
IWidgetDataDrivenEditor
Describes the API and properties of the Data-Driven Editor widget.
Properties
idStr
idStr: string;
Identification string.
isValid
isValid: boolean;
Whether the form is filled out correctly.
pdfUrl
pdfUrl: string;
URL to download the rendered PDF.
previewUrlLink
previewUrlLink: string;
URL of the first page preview image.
previewUrls
previewUrls: string[];
URLs of preview images.
stateId
stateId: string;
The private design state ID.
userId
userId: string;
The current user ID.
Methods
createIdStr()
createIdStr(): Promise<string>;
Creates an identification string.
Returns
Promise<string>
createPdfPreview()
createPdfPreview(config): Promise<string>;
Creates a PDF preview and returns a download URL.
Parameters
| Parameter | Type |
|---|---|
config | IRendererConfig |
Returns
Promise<string>
createPreview()
createPreview(config): Promise<string[]>;
Creates preview images and returns their URLs.
Parameters
| Parameter | Type |
|---|---|
config | IRendererConfig |
Returns
Promise<string[]>
getFormData()
getFormData(config): Record<string, string>;
Retrieves the filled-in form data.
Parameters
| Parameter | Type |
|---|---|
config | IFormDataConfig |
Returns
Record<string, string>
saveProduct()
saveProduct(asNew?): Promise<void>;
Saves the edited design. If asNew is true, creates a new private design.
Parameters
| Parameter | Type |
|---|---|
asNew? | boolean |
Returns
Promise<void>
setEditorConfig()
setEditorConfig(config): void;
Sets the editor configuration.
Parameters
| Parameter | Type |
|---|---|
config | IEditorConfig |
Returns
void
setUserInfo()
setUserInfo(userInfo): void;
Sets user information and updates the form and design.
Parameters
| Parameter | Type |
|---|---|
userInfo | Record<string, string> |
Returns
void
validate()
validate(): boolean;
Validates the form.
Returns
boolean
IWidgetDataDrivenParams
Provides configuration for the Data-Driven Editor widget.
You can use this interface to define the params of the widget.
{
"name": "dd-editor",
"type": "data-driven-editor",
"params": {
"config": {
"access": { "tenantId": "tenant1", "userId": "user1", "token": "token1" },
"design": { "designId": "design1", "dataSetId": "dataset1" },
"api": { "designAtoms": "https://api.example.com/design-atoms" },
"settings": { "lang": "en", "allowManipulations": false }
},
"onReady": "{{#function \$['dd-editor'].setUserInfo({ 'Name': 'John' }) }}"
}
}
Properties
config
config: IEditorConfig;
Configuration object for the Data-Driven Editor.
onReady
onReady: Function | Function[];
Function or array of functions to be called when the editor is ready.
Type Aliases
FormatTypes
type FormatTypes = "Jpeg" | "Png" | "Tiff" | "Pdf";
Supported output file formats.
InterpolationModes
type InterpolationModes =
| "High"
| "Medium"
| "Low"
| "NearestNeighbour"
| "Linear"
| "Cubic"
| "Supersampling"
| "Lanczos"
| "Anisotropic4"
| "Anisotropic9"
| "Lanczos3";
Supported interpolation modes for rendering.