Type Alias: DesignerEntityEvent<T = unknown>
ts
type DesignerEntityEvent<T = unknown> = object;An event from the editor, passed to the callbacks registered with subscribeDesignerEvent() or with the data-td-*-callback attributes of the script tag.
Remarks
The events and their payload:
entityType | eventType | When | entityGuid | detail |
|---|---|---|---|---|
printJob | created | A print job was saved in a Create session — by a Save / SaveAndClose button (each time), when a proofreading is generated (only before the first save), or by the final confirmation (if not saved before). Same GUID for the whole session. | print job GUID | IPrintJobDto |
printJob | updated | A print job opened with openMode: 'Edit' was saved (final confirmation, Save / SaveAndClose), or the final confirmation of a Create session after an earlier save. Generating a proofreading of an existing print job fires no event. | print job GUID | IPrintJobDto |
logo | created | The user uploaded a new logo while designing. | logo GUID | ILogoDTO |
logo | updated | The user renamed a logo or added an edited logo to the gallery. | logo GUID | none |
logo | deleted | The user deleted a logo from the gallery. | logo GUID | none |
logo | selected | The user selected or uploaded a logo in the OpenGallery / OpenUpload open mode. | logo GUID | { logoGuid, logoUploaded } |
logo | selected | The user cleared the selected logo in the OpenGallery / OpenUpload open mode. | null | {} |
text | created | The user created a text in the editor, or changed an existing one. | text object ID (GUID) | ITextDTO |
proofreading | created | A proofreading was generated. | print job GUID | Blob with the PDF |
For printJob events the script converts the editor's data to IPrintJobDto, including the URLs of the print job files. After a logo / selected event from the OpenGallery / OpenUpload open mode the script also sets the selected logo as the customer's logo (Customer.logoGuid).
See Events and callbacks.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
T | unknown | Type of DesignerEntityEvent.detail. |
Properties
| Property | Type | Description |
|---|---|---|
detail? | T | Data of the entity (see the table above). |
entityGuid | string | GUID of the entity (see the table above). At runtime it can be null (a cleared logo/selected), although the type says string. |
entityType | DesignerEntityType | The kind of entity. |
eventType | DesignerEventType | What happened. |