const require_objectSpread2 = require("../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_useEngineContext = require("./useEngineContext.js");
//#region src/hooks/printer.ts
const usePrinter = () => {
	var _context$appHelper;
	const context = require_useEngineContext.default();
	const { action } = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
	const nativePrint = (data, callback) => {
		action({
			type: "webpos.handlePrint",
			data,
			callback: (res) => {
				if (typeof (res === null || res === void 0 ? void 0 : res.status) === "string") callback === null || callback === void 0 || callback(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, res || {}), {}, { result: (res === null || res === void 0 ? void 0 : res.status) == "success" ? true : false }));
				else callback === null || callback === void 0 || callback(res);
			}
		});
	};
	return { nativePrint };
};
//#endregion
exports.default = usePrinter;
