{"_id":"@cacio/react-native-bluetooth-escpos-printer","_rev":"2-c7bf2ac3e3049fddc963710d9d1d9f16","name":"@cacio/react-native-bluetooth-escpos-printer","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@cacio/react-native-bluetooth-escpos-printer","version":"1.0.1","keywords":["react-native","ESC","epson","bluetooth","POS","bluetooth","printer","print"],"author":{"name":"janus j k lu"},"license":"ISC","_id":"@cacio/react-native-bluetooth-escpos-printer@1.0.1","maintainers":[{"name":"cacio","email":"caciorenato@gmail.com"}],"dist":{"shasum":"c729b499431cb83480ef00ee4845202671dbe8be","tarball":"https://registry.npmjs.org/@cacio/react-native-bluetooth-escpos-printer/-/react-native-bluetooth-escpos-printer-1.0.1.tgz","fileCount":63,"integrity":"sha512-tFP1HVB1mnnk+vuIhRZTczro93iHZuH9twlI0Do1LZSPrOPNsL/pWuUdq3Y5QYPSTPS5UMtJWJwThmbijgDP4Q==","signatures":[{"sig":"MEQCICOrWDz37Ae8e0m21f0FBZTPEoLHM2gmyQTrEcTgUyNWAiAJ+FiRuxdHPD2rtIB+2/v1vdqDK96ZHcN8eeJOwdBjgg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":99518940},"main":"index.js","types":"index.d.ts","gitHead":"70c23f92f5efd3b8d56ceb19c6ac0379935a8fe4","_npmUser":{"name":"cacio","email":"caciorenato@gmail.com"},"_npmVersion":"11.1.0","description":"React-Native plugin for the bluetooth ESC/POS printers.","directories":{},"_nodeVersion":"22.13.1","_hasShrinkwrap":false,"peerDependencies":{"react-native":">=0.55.4"},"_npmOperationalInternal":{"tmp":"tmp/react-native-bluetooth-escpos-printer_1.0.1_1759413861617_0.3827599858368631","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@cacio/react-native-bluetooth-escpos-printer","version":"1.0.2","description":"React-Native plugin for the bluetooth ESC/POS printers.","main":"index.js","types":"index.d.ts","keywords":["react-native","ESC","epson","bluetooth","POS","bluetooth","printer","print"],"author":{"name":"janus j k lu"},"license":"ISC","peerDependencies":{"react-native":">=0.55.4"},"_id":"@cacio/react-native-bluetooth-escpos-printer@1.0.2","gitHead":"cecc157d85b32d45f5e5092c7e92f952332c513d","_nodeVersion":"22.13.1","_npmVersion":"11.1.0","dist":{"integrity":"sha512-sJ8QWHCCsxffqQ1jB5RcKUt1XAwy1eISdU3XIMd1dlGkR/Mfsans7Xmmmc6wenvucbeyciyyB/0m+vxXgMcjeQ==","shasum":"543575e1e35dc6485139628100521bc83e1539f8","tarball":"https://registry.npmjs.org/@cacio/react-native-bluetooth-escpos-printer/-/react-native-bluetooth-escpos-printer-1.0.2.tgz","fileCount":63,"unpackedSize":99508610,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDRuBJSnwpHFKuf6R7eB/ytKAX64ufrDNrGpBwv8azTpQIgd2DHMOUp3moI5epV2yFICjekp/mWFu2nVnZq9FIxxQ8="}]},"_npmUser":{"name":"cacio","email":"caciorenato@gmail.com"},"directories":{},"maintainers":[{"name":"cacio","email":"caciorenato@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-bluetooth-escpos-printer_1.0.2_1759415235262_0.3582787869192856"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-02T14:04:21.562Z","modified":"2025-10-02T14:27:16.799Z","1.0.1":"2025-10-02T14:04:23.010Z","1.0.2":"2025-10-02T14:27:16.624Z"},"author":{"name":"janus j k lu"},"license":"ISC","keywords":["react-native","ESC","epson","bluetooth","POS","bluetooth","printer","print"],"description":"React-Native plugin for the bluetooth ESC/POS printers.","maintainers":[{"name":"cacio","email":"caciorenato@gmail.com"}],"readme":"# @cacio/react-native-bluetooth-escpos-printer\r\n\r\n> Fork ajustado de [januslo/react-native-bluetooth-escpos-printer](https://github.com/januslo/react-native-bluetooth-escpos-printer)\r\n> Compatível com Gradle atualizado e Android 13+.\r\n\r\n[![npm version](https://badge.fury.io/js/%40cacio%2Freact-native-bluetooth-escpos-printer.svg)](https://www.npmjs.com/package/@cacio/react-native-bluetooth-escpos-printer)\r\n\r\nBiblioteca **React Native** para integração com impressoras Bluetooth ESC/POS & TSC.\r\nIdeal para recibos, etiquetas e integração com dispositivos Android.\r\n\r\n---\r\n\r\n## ✨ Features\r\n- Suporte a **ESC/POS** (recibos) e **TSC** (etiquetas)\r\n- Gerenciamento de Bluetooth (parear, conectar, listar dispositivos)\r\n- Compatível com **TypeScript**\r\n- Testado principalmente em **Android**\r\n- Em desenvolvimento ativo\r\n\r\n---\r\n\r\n## 📦 Instalação\r\n\r\n### 1. Instalar pacote\r\n```bash\r\nnpm install @cacio/react-native-bluetooth-escpos-printer\r\n# ou\r\nyarn add @cacio/react-native-bluetooth-escpos-printer\r\n```\r\n\r\n### 2. Link (apenas RN < 0.60)\r\n```bash\r\nreact-native link @cacio/react-native-bluetooth-escpos-printer\r\n```\r\n\r\nPara **React Native 0.60+**, o autolinking cuida disso automaticamente ✅.\r\n\r\n### 3. Importar no projeto\r\n```ts\r\nimport {\r\n  BluetoothManager,\r\n  BluetoothEscposPrinter,\r\n  BluetoothTscPrinter\r\n} from '@cacio/react-native-bluetooth-escpos-printer';\r\n```\r\n\r\n---\r\n\r\n## 🚀 Uso rápido\r\n\r\n### Verificar se Bluetooth está ativo\r\n```ts\r\nconst enabled = await BluetoothManager.checkBluetoothEnabled();\r\nconsole.log(enabled); // true | false\r\n```\r\n\r\n### Ativar e listar dispositivos pareados\r\n```ts\r\nconst devices = await BluetoothManager.enableBluetooth();\r\n```\r\n\r\n### Escanear novos dispositivos\r\n```ts\r\nconst { found, paired } = JSON.parse(await BluetoothManager.scanDevices());\r\n```\r\n\r\n### Conectar a um dispositivo\r\n```ts\r\nawait BluetoothManager.connect(\"XX:XX:XX:XX:XX:XX\");\r\n```\r\n\r\n### Imprimir texto simples\r\n```ts\r\nawait BluetoothEscposPrinter.printText(\"Olá, mundo!\\n\\r\", {\r\n  encoding: 'GBK',\r\n  widthtimes: 1,\r\n  heigthtimes: 1,\r\n  fonttype: 0,\r\n});\r\n```\r\n\r\n### Imprimir etiqueta TSC\r\n```ts\r\nawait BluetoothTscPrinter.printLabel({\r\n  width: 40,\r\n  height: 30,\r\n  text: [\r\n    {\r\n      text: \"Etiqueta Teste\",\r\n      x: 20,\r\n      y: 20,\r\n      fonttype: BluetoothTscPrinter.FONTTYPE.SIMPLIFIED_CHINESE,\r\n      rotation: BluetoothTscPrinter.ROTATION.ROTATION_0,\r\n      xscal: BluetoothTscPrinter.FONTMUL.MUL_1,\r\n      yscal: BluetoothTscPrinter.FONTMUL.MUL_1,\r\n    }\r\n  ],\r\n});\r\n```\r\n\r\n---\r\n\r\n## 📚 APIs disponíveis\r\n\r\n- [BluetoothManager](#bluetoothmanager) → gerenciamento de Bluetooth\r\n- [BluetoothTscPrinter](#bluetoothtscprinter) → impressão de etiquetas\r\n- [BluetoothEscposPrinter](#bluetoothescposprinter) → impressão de recibos ESC/POS\r\n\r\n---\r\n\r\n## 🔧 BluetoothManager\r\nFunções principais:\r\n- `checkBluetoothEnabled()` → verifica se Bluetooth está ativo\r\n- `enableBluetooth()` → ativa e retorna dispositivos pareados\r\n- `scanDevices()` → procura novos dispositivos\r\n- `connect(address)` → conecta a um dispositivo\r\n- `disconnect(address)` → desconecta\r\n- `getConnectedDeviceAddress()` → retorna o endereço atual\r\n- `unpair(address)` → desfaz pareamento\r\n\r\nEventos emitidos:\r\n`EVENT_DEVICE_ALREADY_PAIRED`, `EVENT_DEVICE_FOUND`, `EVENT_CONNECTED`, `EVENT_CONNECTION_LOST`, etc.\r\n\r\n---\r\n\r\n## 🖨️ BluetoothTscPrinter\r\nUsado para **etiquetas**.\r\nPrincipais métodos:\r\n- `printLabel(options)` → imprime etiqueta (texto, QRCode, imagem, etc.)\r\n\r\n---\r\n\r\n## 🧾 BluetoothEscposPrinter\r\nUsado para **recibos ESC/POS**.\r\nPrincipais métodos:\r\n- `printerInit()`\r\n- `printText(text, options)`\r\n- `printColumn(cols, aligns, texts, options)`\r\n- `printQRCode(content, size, correctionLevel)`\r\n- `printBarCode(...)`\r\n- `printPic(base64, options)`\r\n- `cutOnePoint()`\r\n- `openDrawer(pin, onTime, offTime)`\r\n\r\n---\r\n\r\n## 🐞 Contribuição\r\nAchou um bug ou precisa de uma melhoria?\r\nAbra uma [issue](https://github.com/seu-usuario/react-native-bluetooth-escpos-printer/issues) ou envie um PR 🚀\r\n\r\n---\r\n\r\n## 📜 Licença\r\nMIT © [cacio](https://github.com/seu-usuario)\r\n","readmeFilename":"README.md"}