{"_id":"@angadie/chittie-react-native","_rev":"2-93f49b74e8fffb69f7bb72dfa6d2aa27","name":"@angadie/chittie-react-native","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@angadie/chittie-react-native","version":"0.1.0","keywords":["react-native","nitro","nitro-module","thermal-printer","escpos","chittie"],"author":{"name":"angadie"},"license":"MIT","_id":"@angadie/chittie-react-native@0.1.0","maintainers":[{"name":"octalpixel","email":"mithushancj@gmail.com"}],"homepage":"https://github.com/octalpixel/chittie#readme","bugs":{"url":"https://github.com/octalpixel/chittie/issues"},"dist":{"shasum":"1145f1ea6a548b49123d6fd747ee19167d2dcf74","tarball":"https://registry.npmjs.org/@angadie/chittie-react-native/-/chittie-react-native-0.1.0.tgz","fileCount":60,"integrity":"sha512-pG7vcxaqC9UWYNk7sxm6ffW7nSzbmuD3fjqqbBBQ3yLuX/JdmC/OM/3HL77XrmMZQD4f+ZRI5Kzew9JLVusF5g==","signatures":[{"sig":"MEYCIQCON05wpdhHWAd5hZ5eFJv+qqZHLrSlmfKTNP6XoqR9bgIhAKSV1Bt3SL1a17xd3gOEPOPQOweAiLhWMpWRNit5UfP5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74673},"main":"./lib/commonjs/index.js","_from":"file:angadie-chittie-react-native-0.1.0.tgz","types":"./lib/typescript/src/index.d.ts","module":"./lib/module/index.js","source":"src/index","scripts":{"test":"tsx spikes/adapter.spike.mts","build":"tsc --noEmit && bob build","clean":"rm -rf lib","codegen":"nitrogen --logLevel=\"debug\"","typecheck":"tsc --noEmit"},"_npmUser":{"name":"octalpixel","email":"mithushancj@gmail.com"},"_resolved":"/private/var/folders/j5/7dkmn95d0_9b5fdnfsmpjs580000gn/T/4f555d3945111569530a10714a42fed0/angadie-chittie-react-native-0.1.0.tgz","_integrity":"sha512-pG7vcxaqC9UWYNk7sxm6ffW7nSzbmuD3fjqqbBBQ3yLuX/JdmC/OM/3HL77XrmMZQD4f+ZRI5Kzew9JLVusF5g==","repository":{"url":"git+https://github.com/octalpixel/chittie.git","type":"git"},"_npmVersion":"10.9.7","description":"React Native (Nitro) backend for chittie: native non-Latin text rasterization (CoreText / android.graphics) implementing chittie's TextRasterizer. Dev-client / bare RN — not Expo Go.","directories":{},"_nodeVersion":"22.22.2","react-native":"src/index","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","nitrogen":"0.35.1","typescript":"^5.7.2","@canvas/image-data":"^1.1.0","@angadie/chittie-text":"0.8.0","react-native-builder-bob":"^0.40.18","react-native-nitro-modules":"0.35.1"},"peerDependencies":{"react":"*","react-native":"*","@angadie/chittie-text":">=0.8.0","react-native-nitro-modules":"*"},"_npmOperationalInternal":{"tmp":"tmp/chittie-react-native_0.1.0_1782392273390_0.6099415060290065","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.json"}]]}},"1.0.0":{"name":"@angadie/chittie-react-native","version":"1.0.0","description":"React Native (Nitro) backend for chittie: native non-Latin text rasterization (CoreText / android.graphics) implementing chittie's TextRasterizer. Dev-client / bare RN — not Expo Go.","license":"MIT","author":{"name":"angadie"},"homepage":"https://github.com/octalpixel/chittie#readme","repository":{"type":"git","url":"git+https://github.com/octalpixel/chittie.git"},"main":"./lib/commonjs/index.js","module":"./lib/module/index.js","types":"./lib/typescript/src/index.d.ts","react-native":"src/index","source":"src/index","keywords":["react-native","nitro","nitro-module","thermal-printer","escpos","chittie"],"peerDependencies":{"@angadie/chittie-text":">=0.9.0","react":"*","react-native":"*","react-native-nitro-modules":"*"},"devDependencies":{"@canvas/image-data":"^1.1.0","nitrogen":"0.35.1","react-native-builder-bob":"^0.40.18","react-native-nitro-modules":"0.35.1","tsx":"^4.19.2","typescript":"^5.7.2","@angadie/chittie-text":"0.9.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.json"}]]},"scripts":{"codegen":"nitrogen --logLevel=\"debug\"","build":"tsc --noEmit && bob build","typecheck":"tsc --noEmit","test":"tsx spikes/adapter.spike.mts","clean":"rm -rf lib"},"_id":"@angadie/chittie-react-native@1.0.0","bugs":{"url":"https://github.com/octalpixel/chittie/issues"},"_integrity":"sha512-gFJF2shSegqPKaojLDyAcgm6Q/fGoYn/VH3etEnaFLGChx3PNB8O2IMwIu1wBM4XQ84YCXHzABF4okTCHc1s0w==","_resolved":"/private/var/folders/j5/7dkmn95d0_9b5fdnfsmpjs580000gn/T/2daecf4fe99522aa4256bcf29ccf05ca/angadie-chittie-react-native-1.0.0.tgz","_from":"file:angadie-chittie-react-native-1.0.0.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-gFJF2shSegqPKaojLDyAcgm6Q/fGoYn/VH3etEnaFLGChx3PNB8O2IMwIu1wBM4XQ84YCXHzABF4okTCHc1s0w==","shasum":"597fe6a5d5ff99e468e0960df242916122a1a21b","tarball":"https://registry.npmjs.org/@angadie/chittie-react-native/-/chittie-react-native-1.0.0.tgz","fileCount":60,"unpackedSize":74673,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA8qOpmYbeV+nLyAKPfoUjd/zPMrif7ONRotqNOnQTxkAiEAh5kzUl4nUjidkeGQsV8NL4bTsX8IhkNDRBTr2HmTb4M="}]},"_npmUser":{"name":"octalpixel","email":"mithushancj@gmail.com"},"directories":{},"maintainers":[{"name":"octalpixel","email":"mithushancj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chittie-react-native_1.0.0_1787125178095_0.27067105463095054"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-25T12:57:53.245Z","modified":"2026-08-19T07:39:38.404Z","0.1.0":"2026-06-25T12:57:53.557Z","1.0.0":"2026-08-19T07:39:38.245Z"},"bugs":{"url":"https://github.com/octalpixel/chittie/issues"},"author":{"name":"angadie"},"license":"MIT","homepage":"https://github.com/octalpixel/chittie#readme","keywords":["react-native","nitro","nitro-module","thermal-printer","escpos","chittie"],"repository":{"type":"git","url":"git+https://github.com/octalpixel/chittie.git"},"description":"React Native (Nitro) backend for chittie: native non-Latin text rasterization (CoreText / android.graphics) implementing chittie's TextRasterizer. Dev-client / bare RN — not Expo Go.","maintainers":[{"name":"octalpixel","email":"mithushancj@gmail.com"}],"readme":"# @angadie/chittie-react-native\n\nThe **React Native backend for chittie** — a [Nitro](https://nitro.margelo.com) module that\nrasterizes **non-Latin text** (Sinhala/Tamil/Arabic) natively (**CoreText** on iOS,\n**android.graphics** on Android) and exposes it as chittie's `TextRasterizer`. No Skia.\n\n> **Dev client / bare RN only** — it's a native module, so it can't run in Expo Go. (Your printer\n> transport — BLE/USB — needs a dev client anyway, so this costs you nothing extra.) See the RFC:\n> `docs/rfc/rn-native.md`.\n\n## Install\n\n```sh\nnpm i @angadie/chittie-react-native @angadie/chittie react-native-nitro-modules\ncd ios && pod install     # iOS\n# Android autolinks; rebuild the dev client.\n```\n\nThe Nitro bindings (`nitrogen/`) are **generated and shipped** — you only re-run `npm run codegen`\nif you change the `.nitro.ts` spec. Built with **react-native-builder-bob** (`lib/commonjs|module|\ntypescript`). Requires React Native's **new architecture**.\n\n## Use\n\nPass the native rasterizer to `render()` — everything else is the same chittie API:\n\n```tsx\nimport { render, Printer, Text, Row } from '@angadie/chittie';\nimport { createNativeRasterizer } from '@angadie/chittie-react-native';\n\nconst rasterizer = createNativeRasterizer();\n\nconst bytes = render(\n  <Printer width={32}>\n    <Text align=\"center\" bold>ආයුබෝවන්</Text>\n    <Row left=\"තේ\" right=\"Rs. 250\" />\n  </Printer>,\n  { dotWidth: 384, rasterizer }   // 58mm\n);\n// send `bytes` over your transport (BLE/USB/TCP)\n```\n\nThe native side returns an RGBA bitmap sized to the text (dims padded to /8), which chittie packs\nto ESC/POS raster unchanged.\n\n## Architecture\n\n```\nTS:   createNativeRasterizer()  →  makeRasterizer(native)  →  chittie TextRasterizer\n      (src/index.ts)               (src/adapter.ts, pure)     (ImageData → render())\nNitro spec: src/specs/ChittieRasterizer.nitro.ts  (rasterize → RasterBitmap{data,width,height})\nNative:  ios/HybridChittieRasterizer.swift   (UIKit/CoreText)\n         android/.../HybridChittieRasterizer.kt  (StaticLayout/Canvas)\n```\n\n`makeRasterizer` is pure and dependency-free (no Nitro import) so it's unit-testable off-device;\n`createNativeRasterizer` wires the real Nitro HybridObject.\n\n## What's verified vs gated\n\n- **Verified (off-device):** `nitro-codegen` runs and the bindings are committed under `nitrogen/`;\n  the TS adapter spike (native bitmap → `ImageData` → chittie's `padTo8`, `spikes/adapter.spike.mts`);\n  `bob build` (commonjs/module/typescript) + typecheck in the monorepo gate.\n- **Gated (needs Xcode/Android Studio + a device):** the native **Swift/Kotlin compile** and an\n  on-device snapshot of the rendered glyphs. The iOS/Android build files mirror the proven\n  `react-native-nitro-haptics` template; the device build validates them.\n\n## Roadmap (per the RFC)\n\n- Phase 1 — **rasterizer** (this).\n- Phase 2 — **read-capable BLE transport** (status via `DLE EOT` notify; see `chittie-transport`'s\n  `queryStatus`).\n- Phase 3 — **USB (Android host) + TCP** transports.\n\n## Notes\n\n- Complex shaping + bidi come from the platform engines for free (UIKit/StaticLayout), so Arabic\n  joins and reorders correctly. For RTL *rows*, also pass `rtl` to `<Row>` (see `docs/i18n.md`).\n- For font selection, the native side uses the system font (which has Sinhala/Tamil/Arabic\n  fallbacks); custom-font support is a future option.\n","readmeFilename":"README.md"}