NPM Package/docs/components/revision/api
API References
Technical reference for compare, align, and revision result events.
Call viewer.compare.compare({ backgroundUrl, overlayUrl }) when both source files are already positioned correctly and you want Canvas to generate a visual diff. In SDK 2.2.2, it returns Promise<ComparisonResult> and resolves after the payload-bearing comparisonComplete and following progressEnd events.
Compare Method
Call viewer.compare.align({ backgroundUrl, overlayUrl, alignArray }) when the source files require interactive point matching, or when the host already has alignArray point objects.
Align Method
Both compare and align report through the same completion and error event listeners on viewer.compare. Compare additionally returns a promise; align remains event-driven.
- comparisonComplete: Fires when the compare or align workflow finishes successfully (or reaches the interactive align stage).
- comparisonError: Fires when the compare or align workflow fails.
Result Events
