onDrawingUpdate
Drawing update handler
This example demonstrates how the onDrawingUpdate callback receives an updated DIQ_DrawingRevision and
saves it in the host application. Once completed, the result is returned to the widget through the
onResponse
callback.
Drawing update handler
const onDrawingUpdate = async function(drawing: DIQ_DrawingRevision, onResponse: (result: DIQ_Result) => void) => {
// Example host-side handling
try {
drawingStore.save(drawing);
onResponse({
success: true
} as DIQ_Result);
} catch (error) {
onResponse({
success: false,
error: error instanceof Error ? error.message : "Unknown error"
} as DIQ_Result);
}
};