@squawk/icao-registry
Advanced tools
| /** | ||
| * @packageDocumentation | ||
| * Browser / edge entry point. Exposes the resolver factory and shared types | ||
| * without pulling in `parseFaaRegistryZip`, which depends on Node's `Buffer` | ||
| * and the `adm-zip` package and is unsuitable for browser bundles. Pair with | ||
| * `@squawk/icao-registry-data/browser` to consume the bundled snapshot. | ||
| * | ||
| * Node consumers should use the default {@link "."} entry point, which also | ||
| * exports `parseFaaRegistryZip` for parsing fresh FAA ReleasableAircraft ZIPs | ||
| * at runtime. | ||
| */ | ||
| export { createIcaoRegistry } from './registry.js'; | ||
| export type { IcaoRegistry, IcaoRegistryOptions } from './registry.js'; | ||
| export type { AircraftRegistration, AircraftType, EngineType } from '@squawk/types'; | ||
| //# sourceMappingURL=browser.d.ts.map |
| {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"} |
| /** | ||
| * @packageDocumentation | ||
| * Browser / edge entry point. Exposes the resolver factory and shared types | ||
| * without pulling in `parseFaaRegistryZip`, which depends on Node's `Buffer` | ||
| * and the `adm-zip` package and is unsuitable for browser bundles. Pair with | ||
| * `@squawk/icao-registry-data/browser` to consume the bundled snapshot. | ||
| * | ||
| * Node consumers should use the default {@link "."} entry point, which also | ||
| * exports `parseFaaRegistryZip` for parsing fresh FAA ReleasableAircraft ZIPs | ||
| * at runtime. | ||
| */ | ||
| export { createIcaoRegistry } from './registry.js'; |
+5
-1
| { | ||
| "name": "@squawk/icao-registry", | ||
| "version": "0.4.0", | ||
| "version": "0.5.0", | ||
| "type": "module", | ||
@@ -24,2 +24,6 @@ "description": "FAA ICAO hex address to aircraft registration and info lookup", | ||
| "import": "./dist/index.js" | ||
| }, | ||
| "./browser": { | ||
| "types": "./dist/browser.d.ts", | ||
| "import": "./dist/browser.js" | ||
| } | ||
@@ -26,0 +30,0 @@ }, |
+14
-0
@@ -55,2 +55,16 @@ <h1><img src="../../../assets/squawk-logo.svg" alt="squawk logo" width="48" height="48" style="vertical-align: middle"> @squawk/icao-registry</h1> | ||
| ## Browser / SPA usage | ||
| For SPAs and edge runtimes, import from the `/browser` subpath. It re-exports `createIcaoRegistry` and the shared types but omits `parseFaaRegistryZip`, which depends on Node's `Buffer` and the `adm-zip` package and is unsuitable for browser bundles. Pair it with `@squawk/icao-registry-data/browser`: | ||
| ```typescript | ||
| import { loadUsBundledRegistry } from '@squawk/icao-registry-data/browser'; | ||
| import { createIcaoRegistry } from '@squawk/icao-registry/browser'; | ||
| const dataset = await loadUsBundledRegistry(); | ||
| const registry = createIcaoRegistry({ data: dataset.records }); | ||
| ``` | ||
| Browser consumers that need fresh FAA data should fetch and parse the ZIP server-side (where `parseFaaRegistryZip` is available) and feed the resulting records into the browser via their own API. | ||
| > Under active development. See the [docs](https://neilcochran.github.io/squawk/modules/_squawk_icao-registry.html) for current API status. |
22369
12.62%20
17.65%425
6.52%70
25%