Skip to content

feat: model status API, useDataDetector hook, and Android language selection#4

Merged
pablogdcr merged 1 commit into
mainfrom
feat/data-detector-api
Jun 6, 2026
Merged

feat: model status API, useDataDetector hook, and Android language selection#4
pablogdcr merged 1 commit into
mainfrom
feat/data-detector-api

Conversation

@pablogdcr

@pablogdcr pablogdcr commented Jun 5, 2026

Copy link
Copy Markdown
Owner

What

  • Rename downloadModel()prepareModel({ language? }). downloadModel() stays as a deprecated alias (non-breaking).
  • Model status: getModelStatus()'ready' | 'notDownloaded' and isModelReady(). iOS always reports ready.
  • useDataDetector() hook: tracks status (notDownloaded | downloading | ready | error), exposes detect/prepare/isReady/error, and auto-downloads the model on Android (opt out via autoPrepare: false).
  • Android multi-language: detect, prepareModel, getModelStatus, isModelReady, and the hook accept a language option — 15 ISO 639-1 codes mapped to ML Kit models. Default 'en'. iOS is language-agnostic and ignores it.
  • Adds @types/react + react devDependencies (the package now ships a hook), updates README, and reworks the example app to use the hook + a language picker.

- Rename downloadModel() -> prepareModel({ language? }); keep downloadModel as a
  deprecated alias.
- Add getModelStatus()/isModelReady() to query model availability (iOS always ready).
- Add useDataDetector() hook: tracks status (notDownloaded/downloading/ready/error),
  auto-downloads on Android, exposes detect/prepare.
- Android multi-language: detect/prepareModel/getModelStatus/useDataDetector accept a
  language option (15 ISO 639-1 codes -> ML Kit models); default 'en'. iOS is
  language-agnostic and ignores it.
- Add @types/react + react devDependencies; document the new API and update the example.

Version bump and changelog cut are intentionally left for release time.
@pablogdcr pablogdcr merged commit bec549d into main Jun 6, 2026
4 checks passed
@pablogdcr pablogdcr deleted the feat/data-detector-api branch June 6, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant