{"_id":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","_rev":"4-59b232149b9f693418ff8427276022e5","name":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","version":"0.0.1","keywords":["ecosystem:cordova","cordova-android","mlkit","document-scanner"],"author":{"name":"Daniel Macedo"},"license":"Apache-2.0","_id":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner@0.0.1","maintainers":[{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"}],"homepage":"https://github.com/yourusername/cordova-plugin-mlkit-doc-scanner#readme","bugs":{"url":"https://github.com/yourusername/cordova-plugin-mlkit-doc-scanner/issues"},"dist":{"shasum":"f7cfdd7617855bd94f7dcd466a72653ebc3ea0f1","tarball":"https://registry.npmjs.org/@dani.dev.pm/cordova-plugin-mlkit-doc-scanner/-/cordova-plugin-mlkit-doc-scanner-0.0.1.tgz","fileCount":5,"integrity":"sha512-CKl4LTGVNlW+8PT+d567to8m1JbdJ94RHIchwETmePpYb9RkkA3rraaroO2nIhZS5P17R8FHAeKQXzRjc1ySzw==","signatures":[{"sig":"MEQCIG7qNzS0RI0OIeZPHXap0hANHfnmmL5VhE7nqviI+e0RAiAeBWrYT4+xS7ANIJ/TOk0atYWDpjZ+hyFcn8SSyzkheA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6869},"main":"plugin.xml","cordova":{"id":"cordova-plugin-mlkit-doc-scanner","platforms":["android"]},"gitHead":"6ee38a0567e6a588073b3a40c5dc8ead765d8bf0","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"},"repository":{"url":"git+https://github.com/yourusername/cordova-plugin-mlkit-doc-scanner.git","type":"git"},"_npmVersion":"10.2.4","description":"Cordova plugin for ML Kit Document Scanner","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cordova-plugin-mlkit-doc-scanner_0.0.1_1727468047949_0.80943619667424","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","version":"0.0.2","keywords":["ecosystem:cordova","cordova-android","mlkit","document-scanner"],"author":{"name":"Daniel Macedo"},"license":"Apache-2.0","_id":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner@0.0.2","maintainers":[{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"}],"homepage":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner#readme","bugs":{"url":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner/issues"},"dist":{"shasum":"779422d007b437a3c6aaa00d2329d89812712754","tarball":"https://registry.npmjs.org/@dani.dev.pm/cordova-plugin-mlkit-doc-scanner/-/cordova-plugin-mlkit-doc-scanner-0.0.2.tgz","fileCount":5,"integrity":"sha512-nvEq8uRMD+Lct9k9/dbyVFC/RpU3XUvOv9nKGW6e0Yzo+sXZwx3ijP83os9p/sq7156sAKP3j9iZcMzLtrLgNA==","signatures":[{"sig":"MEUCIQDCXrlEKBFpsDLrrlo9n5Se02HxFPtop/GrJLqQV+6JaQIgGwhJid3dC9n9YI1wWvrYupLeSZdsKEok+SOh6FzU1hU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6963},"main":"plugin.xml","cordova":{"id":"cordova-plugin-mlkit-doc-scanner","platforms":["android"]},"gitHead":"88c596265598e817fcddbfa3e2d45ffc830981f6","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"},"repository":{"url":"git+https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner.git","type":"git"},"_npmVersion":"10.2.4","description":"A Cordova plugin for ML Kit Document Scanner","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cordova-plugin-mlkit-doc-scanner_0.0.2_1727468621055_0.03492384405327065","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","version":"0.0.3","keywords":["ecosystem:cordova","cordova-android","mlkit","document-scanner"],"author":{"name":"Daniel Macedo"},"license":"Apache-2.0","_id":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner@0.0.3","maintainers":[{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"}],"homepage":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner#readme","bugs":{"url":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner/issues"},"dist":{"shasum":"8ce5a7df5c93729da45e44588c0e65262410b7fa","tarball":"https://registry.npmjs.org/@dani.dev.pm/cordova-plugin-mlkit-doc-scanner/-/cordova-plugin-mlkit-doc-scanner-0.0.3.tgz","fileCount":7,"integrity":"sha512-wb+EODSJYF02wV+oFJe7Puwhm8/P8dPx3KNXmu45n9hSjvgVwRXwQgsa+0wan9fB1EHzMoUN3vIB3bJtQdT0jQ==","signatures":[{"sig":"MEUCIE1hDTosun5oqR5j11MVkdgFqecnU6SEaRDuTGK0k6qpAiEAkV8+Vj1FVONhstzVX3QssYu+zaVefQZ2VrWeligCwSQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12213},"main":"index.js","types":"types.d.ts","cordova":{"id":"cordova-plugin-mlkit-doc-scanner","platforms":["android"]},"gitHead":"2030c7ed80fd0bdc6a8325a1b87934d444260d0f","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"},"repository":{"url":"git+https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner.git","type":"git"},"_npmVersion":"9.2.0","description":"A Cordova plugin for ML Kit Document Scanner","directories":{},"_nodeVersion":"14.20.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cordova-plugin-mlkit-doc-scanner_0.0.3_1727489697967_0.6654976958985666","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","version":"0.0.4","keywords":["ecosystem:cordova","cordova-android","mlkit","document-scanner"],"author":{"name":"Daniel Macedo"},"license":"MIT","_id":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner@0.0.4","maintainers":[{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"}],"homepage":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner#readme","bugs":{"url":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner/issues"},"dist":{"shasum":"28c397c655b2d8798d943174102f92b1f12ab18c","tarball":"https://registry.npmjs.org/@dani.dev.pm/cordova-plugin-mlkit-doc-scanner/-/cordova-plugin-mlkit-doc-scanner-0.0.4.tgz","fileCount":7,"integrity":"sha512-iEOhQ94R8yP8o4hDS1K6/JcnSNKvq/hXZ34GII84dTL8qLOiKI0uRV7qjmrsWVO6hNw+P6/kiqdDhv4jlvhGcQ==","signatures":[{"sig":"MEUCIQDvvtK2cjwoV8kTMGUudn5tRgF6SvN81AprdqqFTTDbCQIgHe30YO+YKwrqJFBtPCwx998iF9DZLxPOm07Wtlu5S60=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16081},"main":"index.js","types":"types.d.ts","cordova":{"id":"cordova-plugin-mlkit-doc-scanner","platforms":["android"]},"gitHead":"3cd3e68fffd1e63ec18cb5fb3605c93700619d92","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"},"repository":{"url":"git+https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner.git","type":"git"},"_npmVersion":"9.2.0","description":"A Cordova plugin for ML Kit Document Scanner","directories":{},"_nodeVersion":"14.20.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cordova-plugin-mlkit-doc-scanner_0.0.4_1727520024269_0.9053977598148766","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","version":"0.0.5","description":"A Cordova plugin for ML Kit Document Scanner","cordova":{"id":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner","platforms":["android"]},"keywords":["document-scanner","mlkit","ecosystem:cordova","cordova-android","ionic"],"author":{"name":"Daniel Macedo"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner.git"},"bugs":{"url":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner/issues"},"homepage":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner#readme","main":"index.js","types":"types.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"94b58941fcdbad5117be28796cb2c08d91b1fbfe","_id":"@dani.dev.pm/cordova-plugin-mlkit-doc-scanner@0.0.5","_nodeVersion":"14.20.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-F7Qix8NQcPg5iwif1aTd3OxHbddXBAjEjF5B/XR6N/xCLkpswZjD+BHuqkSZS7O2gmF0lt2HAX1JgIRieb7dbg==","shasum":"de366764cdb2a0ed9448257cf375db27c32b9305","tarball":"https://registry.npmjs.org/@dani.dev.pm/cordova-plugin-mlkit-doc-scanner/-/cordova-plugin-mlkit-doc-scanner-0.0.5.tgz","fileCount":7,"unpackedSize":16126,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEFc0rjyILJZL81JbyHkmVxqIDXJ2zu2dCVcssaKM9B9AiEAwuHGq3jRv8jdrQlFR2SZq0P7kwdDkbLzVJ2sE5mdook="}]},"_npmUser":{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"},"directories":{},"maintainers":[{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cordova-plugin-mlkit-doc-scanner_0.0.5_1727521812015_0.4069952428104211"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-27T20:14:07.832Z","modified":"2024-09-28T11:10:12.452Z","0.0.1":"2024-09-27T20:14:08.160Z","0.0.2":"2024-09-27T20:23:41.309Z","0.0.3":"2024-09-28T02:14:58.213Z","0.0.4":"2024-09-28T10:40:24.463Z","0.0.5":"2024-09-28T11:10:12.274Z"},"bugs":{"url":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner/issues"},"author":{"name":"Daniel Macedo"},"license":"MIT","homepage":"https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner#readme","keywords":["document-scanner","mlkit","ecosystem:cordova","cordova-android","ionic"],"repository":{"type":"git","url":"git+https://github.com/danidevpm/cordova-plugin-mlkit-doc-scanner.git"},"description":"A Cordova plugin for ML Kit Document Scanner","maintainers":[{"name":"dani.dev.pm","email":"dani.dev.pm@gmail.com"}],"readme":"# Cordova Plugin: ML Kit Document Scanner\n\nAn Android plugin that implements Google's ML Kit Document Scanner in a Cordova/Ionic app.\n\nCheck [here](https://developers.google.com/ml-kit/vision/doc-scanner) the documentation for MLKit document scanner.\n\n\n## Installation\n\nTo install the plugin in Ionic:\n\n```bash\nionic cordova plugin add @dani.dev.pm/cordova-plugin-mlkit-doc-scanner\n```\n\n## Usage\n\n```typescript\nimport MLKitDocScanner from '@dani.dev.pm/cordova-plugin-mlkit-doc-scanner';\nMLKitDocScanner.scanDocument(options)\n.then((result) => {\n// Handle the scan result\n})\n.catch((error) => {\n// Handle any errors\n});\n\n// OR\n\nconst result: ScanResult = await MLKitDocScanner.scanDocument(options);\n```\n\n## API Reference\n\n### MLKitDocScanner\n\nThe main interface for the ML Kit Document Scanner.\n\n#### Methods\n\n##### `scanDocument(options: ScanOptions): Promise<ScanResult>`\n\nScans a document with the given options.\n\n- `options`: Options for scanning the document (see `ScanOptions` interface).\n- Returns: A promise that resolves to the scan result (see `ScanResult` interface).\n\n### Interfaces\n\n#### ScanOptions\n\nOptions for scanning documents.\n\n| Property | Type | Description | Default |\n|----------|------|-------------|---------|\n| `pageLimit?` | `number` | The maximum number of pages to scan. | No limit |\n| `includeJpeg?` | `boolean` | Whether to include JPEG images in the scan result. | `true` |\n| `includePdf?` | `boolean` | Whether to include a PDF in the scan result. | `true` |\n\n#### ScanError\n\nInterface representing an error that occurred during document scanning.\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `code` | `ScanErrorCode` | The error code. |\n| `message` | `string` | The error message. |\n\n#### ScanResult\n\nResult of a document scan.\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `images?` | `string[]` | Array of image URIs if JPEG format is included. |\n| `pdf?` | `string` | URI of the PDF if PDF format is included. |\n\n### Error Codes\n\nThe following error codes are defined in the `ScanErrorCode` enum:\n\n| Error Code | Description |\n|------------|-------------|\n| `SCANNING_RESULT_NULL` | The scanning result is null. |\n| `NO_PAGES_SCANNED` | No pages were scanned. |\n| `JSON_PROCESSING_ERROR` | An error occurred while processing JSON data. |\n| `SCANNER_START_FAILED` | The scanner failed to start. |\n| `SCANNING_CANCELLED` | The scanning process was cancelled by the user. |\n| `SCANNING_FAILED` | The scanning process failed for an unknown reason. |\n\n\n## Example\n\n```typescript\nimport MLKitDocScanner from '@dani.dev.pm/cordova-plugin-mlkit-doc-scanner';\nconst scanOptions: ScanOptions = {\n    pageLimit: 5,\n    includeJpeg: true,\n    includePdf: true\n};\n\ntry {\n    const { images, pdf } = await MLKitDocScanner.scanDocument(scanOptions);\n    console.log('Scanned jpeg of each page URIs:', images);\n    console.log('Scanned PDF uri:', pdf);\n} catch (error) {\n    const scanError = error as ScanError;\n    switch (scanError.code) {\n        case ScanErrorCode.SCANNING_CANCELLED:\n            console.log('User cancelled the scanning process');\n            break;\n        case ScanErrorCode.NO_PAGES_SCANNED:\n            console.log('No pages were scanned');\n            break;\n    }\n}\n```\n","readmeFilename":"README.md"}