UNPKG

@aurigma/ui-framework

Version:

A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.

208 lines (116 loc) 3.61 kB
# Interface: IWidgetDataDrivenEditor Describes the API and properties of the Data-Driven Editor widget. ## Hierarchy * **IWidgetDataDrivenEditor** ## Implemented by * [AuWidgetDataDrivenEditor](../classes/auwidgetdatadriveneditor.md) ## Index ### Properties * [idStr](iwidgetdatadriveneditor.md#idstr) * [isValid](iwidgetdatadriveneditor.md#isvalid) * [pdfUrl](iwidgetdatadriveneditor.md#pdfurl) * [previewUrlLink](iwidgetdatadriveneditor.md#previewurllink) * [previewUrls](iwidgetdatadriveneditor.md#previewurls) * [stateId](iwidgetdatadriveneditor.md#stateid) * [userId](iwidgetdatadriveneditor.md#userid) ### Methods * [createIdStr](iwidgetdatadriveneditor.md#createidstr) * [createPdfPreview](iwidgetdatadriveneditor.md#createpdfpreview) * [createPreview](iwidgetdatadriveneditor.md#createpreview) * [getFormData](iwidgetdatadriveneditor.md#getformdata) * [saveProduct](iwidgetdatadriveneditor.md#saveproduct) * [setEditorConfig](iwidgetdatadriveneditor.md#seteditorconfig) * [setUserInfo](iwidgetdatadriveneditor.md#setuserinfo) * [validate](iwidgetdatadriveneditor.md#validate) ## 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`: [IRendererConfig](irendererconfig.md)): *Promise‹string›* Creates a PDF preview and returns a download URL. **Parameters:** Name | Type | ------ | ------ | `config` | [IRendererConfig](irendererconfig.md) | **Returns:** *Promise‹string›* ___ ### createPreview**createPreview**(`config`: [IRendererConfig](irendererconfig.md)): *Promise‹string[]›* Creates preview images and returns their URLs. **Parameters:** Name | Type | ------ | ------ | `config` | [IRendererConfig](irendererconfig.md) | **Returns:** *Promise‹string[]›* ___ ### getFormData ▸ **getFormData**(`config`: [IFormDataConfig](iformdataconfig.md)): *Record‹string, string›* Retrieves the filled-in form data. **Parameters:** Name | Type | ------ | ------ | `config` | [IFormDataConfig](iformdataconfig.md) | **Returns:** *Record‹string, string›* ___ ### saveProduct**saveProduct**(`asNew?`: boolean): *Promise‹void›* Saves the edited design. If `asNew` is `true`, creates a new private design. **Parameters:** Name | Type | ------ | ------ | `asNew?` | boolean | **Returns:** *Promise‹void›* ___ ### setEditorConfig ▸ **setEditorConfig**(`config`: [IEditorConfig](ieditorconfig.md)): *void* Sets the editor configuration. **Parameters:** Name | Type | ------ | ------ | `config` | [IEditorConfig](ieditorconfig.md) | **Returns:** *void* ___ ### setUserInfo**setUserInfo**(`userInfo`: Record‹string, string›): *void* Sets user information and updates the form and design. **Parameters:** Name | Type | ------ | ------ | `userInfo` | Record‹string, string› | **Returns:** *void* ___ ### validate ▸ **validate**(): *boolean* Validates the form. **Returns:** *boolean*