@aglyn/shared-data-types 1.0.0-beta.143 → 1.0.0-beta.144
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 +46 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,50 @@
|
|
|
1
1
|
# @aglyn/shared-data-types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript types and interfaces shared across the Aglyn packages: lifecycle and CRUD contracts, a normalized-data shape, semantic-version string types, the serializable host theme document, and a `DoD` namespace of document-database modeling types. It is mainly a dependency of the larger `@aglyn/*` packages.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
npm install @aglyn/shared-data-types@beta
|
|
10
|
+
|
|
11
|
+
No peer dependencies.
|
|
12
|
+
|
|
13
|
+
## What's in it
|
|
14
|
+
|
|
15
|
+
Almost everything here is type-only. The `DoD` namespace also carries a few runtime values (`Eval`, `Sig`, `lbl`, `Persistance`).
|
|
16
|
+
|
|
17
|
+
- `lifecycle` — `LifecycleObserver` (`onInit` / `onDestroy`), `LoadableObserver` (`onLoad` / `onUnload`) and `LoadableLifecycleObserver`.
|
|
18
|
+
- `initializable` — the `Initializable` interface.
|
|
19
|
+
- `crud` — `CrudModel`.
|
|
20
|
+
- `normalized` — `NormalizedData` and `NormalizedModel`.
|
|
21
|
+
- `semantic` — the `Version` namespace of template-literal types for semantic version strings.
|
|
22
|
+
- `host-theme` — `HostTheme` and its parts (`HostThemeScheme`, `HostThemeSchemeColors`, `HostThemePaletteColor`, `HostThemeTypography`, `HostThemeFont`, `HostThemeComponentOverride`, `HostThemeMixins`): a site's theme customization as plain data. `@aglyn/shared-ui-theme` converts it to Material UI theme options.
|
|
23
|
+
- `dod` — exported from the root as the `DoD` namespace: key aliases (`PKey`, `FKey`, `AKey`), the `FT` field-type namespace, `DocumentType` / `CollectionType` / `DatabaseType`, and the `Schema`, `Relation` and `Ref` namespaces.
|
|
24
|
+
|
|
25
|
+
Each module is also importable as `@aglyn/shared-data-types/<module>`.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import type {
|
|
31
|
+
HostTheme,
|
|
32
|
+
LifecycleObserver,
|
|
33
|
+
} from '@aglyn/shared-data-types'
|
|
34
|
+
import { DoD } from '@aglyn/shared-data-types'
|
|
35
|
+
|
|
36
|
+
class Store implements LifecycleObserver {
|
|
37
|
+
onInit() {}
|
|
38
|
+
onDestroy() {}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type Id = DoD.PKey
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## How it fits
|
|
45
|
+
|
|
46
|
+
A `shared` data package with no `@aglyn/*` dependencies. `@aglyn/shared-ui-theme`, `@aglyn/shared-util-tools` and the core, renderer and Besigner packages build on these types. Shared packages are generic: they import only other shared packages and hold no plugin's domain.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/shared/data/types
|