@uxf/smart-address 11.122.4 → 11.126.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -48,28 +48,28 @@ const options = await loadAddressOptions({ term: "Sovova", level: 2 });
|
|
|
48
48
|
|
|
49
49
|
### Entry points
|
|
50
50
|
|
|
51
|
-
| Import path
|
|
52
|
-
|
|
|
53
|
-
| `@uxf/smart-address/v2`
|
|
54
|
-
| `@uxf/smart-address/v1`
|
|
55
|
-
| `@uxf/smart-address/common` | Shared type definitions only
|
|
51
|
+
| Import path | Exposes |
|
|
52
|
+
| --------------------------- | ----------------------------------------------------------------------------------------- |
|
|
53
|
+
| `@uxf/smart-address/v2` | Individual named functions (below) + all type definitions |
|
|
54
|
+
| `@uxf/smart-address/v1` | The `SmartAddress` namespace object holding the same-named methods, plus type definitions |
|
|
55
|
+
| `@uxf/smart-address/common` | Shared type definitions only |
|
|
56
56
|
|
|
57
57
|
### Functions
|
|
58
58
|
|
|
59
59
|
Signatures below are the v2 named exports. On v1 the same names are accessed as `SmartAddress.<name>`; v1/v2 differences are noted in the last column.
|
|
60
60
|
|
|
61
|
-
| Function
|
|
62
|
-
|
|
|
63
|
-
| `search`
|
|
64
|
-
| `searchZip`
|
|
65
|
-
| `searchCityPart`
|
|
66
|
-
| `loadAddressOptions`
|
|
67
|
-
| `loadZipOptions`
|
|
68
|
-
| `createAddressLoader`
|
|
69
|
-
| `createZipLoader`
|
|
70
|
-
| `getAddress`
|
|
71
|
-
| `getAddressExtended`
|
|
72
|
-
| `getBuildingAddresses` | `(id: number) => Promise<Location[]>`
|
|
61
|
+
| Function | Signature | Notes |
|
|
62
|
+
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
63
|
+
| `search` | `(props: { term: string; level: number; limit?: number; zip?: number; address?: string }) => Promise<Location[]>` | `limit` defaults to `10`. Empty `term` → `[]` (no request). |
|
|
64
|
+
| `searchZip` | `(term: string, limit?: number) => Promise<Location[]>` | Returns `[]` unless `term` is 1–5 digits. |
|
|
65
|
+
| `searchCityPart` | `(term: string, limit?: number) => Promise<CityPart[]>` | **v2 only.** Empty `term` → `[]`. |
|
|
66
|
+
| `loadAddressOptions` | `(params: { term: string; level: number; limit?: number; zip?: number; address?: string; getLabel?: (address: Location) => string }) => Promise<Option[]>` | Maps `search` results to `Option`s. Default label: `` `${ulice ?? ""}, ${obec ?? ""}` ``. |
|
|
67
|
+
| `loadZipOptions` | `(params: { term: string; limit?: number; getLabel?: (address: Location) => string }) => Promise<Option[]>` | Default label: the `psc` (ZIP). |
|
|
68
|
+
| `createAddressLoader` | `(params: { level: number; limit?: number; zip?: number; address?: string; getLabel?: (address: Location) => string }) => (term: string) => Promise<Option[]>` | Curried `loadAddressOptions` for async selects. v1 params omit `address`. |
|
|
69
|
+
| `createZipLoader` | `(params: { limit?: number; getLabel?: (address: Location) => string }) => (term: string) => Promise<Option[]>` | Curried `loadZipOptions`. v1 params omit `limit`. |
|
|
70
|
+
| `getAddress` | `(id: number) => Promise<Location>` | Single address by id. |
|
|
71
|
+
| `getAddressExtended` | `(id: number) => Promise<AddressExtended>` | Extended detail. **v1 returns the flat `LocationExtended` instead.** |
|
|
72
|
+
| `getBuildingAddresses` | `(id: number) => Promise<Location[]>` | **v2 only.** All addresses within a building. |
|
|
73
73
|
|
|
74
74
|
v1-only lookups on `SmartAddress`, each `(id: number) => Promise<Location>`: `getCity`, `getCityPart`, `getMomc`, `getMop`, `getStreet`.
|
|
75
75
|
|
|
@@ -77,16 +77,16 @@ v1-only lookups on `SmartAddress`, each `(id: number) => Promise<Location>`: `ge
|
|
|
77
77
|
|
|
78
78
|
The `level` used by `search` / `loadAddressOptions` / `createAddressLoader` selects the granularity of the returned records (values are Czech RÚIAN terms):
|
|
79
79
|
|
|
80
|
-
| level | Meaning
|
|
81
|
-
|
|
|
82
|
-
| 1
|
|
83
|
-
| 2
|
|
84
|
-
| 3
|
|
85
|
-
| 4
|
|
86
|
-
| 5
|
|
87
|
-
| 6
|
|
88
|
-
| 7
|
|
89
|
-
| 8
|
|
80
|
+
| level | Meaning |
|
|
81
|
+
| ----- | ------------------------------------------------------------------------ |
|
|
82
|
+
| 1 | House number — číslo domovní (číslo orientační, znak čísla orientačního) |
|
|
83
|
+
| 2 | Street — ulice |
|
|
84
|
+
| 3 | Part of municipality — název části obce |
|
|
85
|
+
| 4 | Prague municipal district (MOP) — název MOP |
|
|
86
|
+
| 5 | Municipal district / city ward (MOMC) — název MOMC |
|
|
87
|
+
| 6 | Municipality — název obce |
|
|
88
|
+
| 7 | District — okres _(future)_ |
|
|
89
|
+
| 8 | Region — kraj _(future)_ |
|
|
90
90
|
|
|
91
91
|
### Value model (types)
|
|
92
92
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/smart-address",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.126.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc -P tsconfig.json",
|
|
10
|
-
"typecheck": "
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"author": "UX Fans s.r.o",
|
|
13
13
|
"license": "MIT"
|