# `TesseractJs.Config`
[🔗](https://github.com/alexdont/tesseract_js/blob/v0.1.0/lib/tesseract_js/config.ex#L1)

Reads `:tesseract_js` Application config with sensible defaults and resolves
the paths the browser needs (workerPath, corePath, langPath) for either CDN
or local mode.

Config keys:

    config :tesseract_js,
      base_path: "/assets/vendor/tesseract",  # where local files live (when source: :local)
      lang: "eng",                            # default language
      source: :cdn,                           # :cdn (default) or :local
      tessdata_repo: :standard,               # :standard | :best | :fast
      core_variant: :simd_lstm                # :simd_lstm | :simd | :basic

# `base_path`

Just the base_path used for local-mode asset URLs.

# `get`

```elixir
@spec get(keyword() | map()) :: map()
```

Returns the merged config map (defaults ← Application env ← overrides).

# `runtime`

```elixir
@spec runtime(keyword() | map()) :: map()
```

Returns the runtime configuration the browser needs:

    %{
      workerPath: "/assets/vendor/tesseract/worker.min.js",
      corePath:   "<cdn or local>/tesseract-core-simd-lstm.wasm.js",
      langPath:   "<cdn or local>",
      lang:       "eng",
      oem:        1
    }

This is what the `<.script />` component serializes into
`window.__tesseractJs`. The JS wrapper reads these defaults at boot.

Notes:

  * `workerPath` is always served from the package's vendored files
    (small, no benefit to CDN).
  * `corePath` and `langPath` flip based on `source`.
  * For CDN mode, `langPath` points at the parent jsDelivr directory so
    tesseract.js's worker can build per-lang URLs from it.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
