Sure, some means of notifying an “exporter” that a file of its type is about to be embedded, allowing it to be exported. I think it should be possible to declare a handler for each ref type that emits the markup for the preview.
Draw.io documents might need to be exported to SVG or a raster, and since multiple pages can be embedded in a given document I would want to pick the specified page.