import { getRenderMode, isNativeCanvasApiAvailable } from "./previewSettings.js";

//#region src/preview/renderers.ts
/**
* Get the effective render mode, validating that native is available when selected.
* Falls back to foreignObject if native is selected but not available.
*/
function getEffectiveRenderMode() {
	const mode = getRenderMode();
	if (mode === "native" && !isNativeCanvasApiAvailable()) return "foreignObject";
	return mode;
}
/**
* Check if a render result is a canvas element.
*/
function isCanvas(result) {
	return result instanceof HTMLCanvasElement;
}
/**
* Check if a render result is an image element.
*/
function isImage(result) {
	return result instanceof HTMLImageElement;
}

//#endregion
export { getEffectiveRenderMode, isCanvas, isImage };
//# sourceMappingURL=renderers.js.map