From 5ba8541fd2b1342cd349112eed8323369762ae64 Mon Sep 17 00:00:00 2001 From: Mikhail Fedotov Date: Sun, 18 Feb 2024 00:33:46 +0700 Subject: [PATCH] [docs] Add Meta information block --- README.md | 8 ++++---- docs/index.md | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 73a9c02..a99f0e2 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ State management features: * **[Guarded](https://nsk90.github.io/kstatemachine/#guarded-transitions) and [Conditional transitions](https://nsk90.github.io/kstatemachine/#conditional-transitions)** - dynamic target state which is calculated in a moment of event processing depending on application business logic -* **[Nested states](https://nsk90.github.io/kstatemachine/#nested-states)** - build hierarchical state machines ( - statecharts) +* **[Nested states](https://nsk90.github.io/kstatemachine/#nested-states)** - build hierarchical state machines + (statecharts) with [cross-level transitions](https://nsk90.github.io/kstatemachine/#cross-level-transitions) support * **[Composed (nested) state machines.](https://nsk90.github.io/kstatemachine/#composed-(nested)-state-machines)** Use state machines as atomic child states @@ -71,8 +71,8 @@ State management features: stateDiagram-v2 direction LR [*] --> GreenState - GreenState --> YellowState : SwitchEvent - YellowState --> RedState : SwitchEvent + GreenState --> YellowState: SwitchEvent + YellowState --> RedState: SwitchEvent RedState --> [*] ``` diff --git a/docs/index.md b/docs/index.md index 5a4107f..993bcc0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -36,6 +36,7 @@ * [Optional arguments](#optional-arguments) * [Event argument](#event-argument) * [Transition argument](#transition-argument) +* [Meta information](#meta-information) * [Error handling](#error-handling) * [Ignored events](#ignored-events) * [Pending events](#pending-events) @@ -754,6 +755,17 @@ state("first") { > It is up to user to control that argument field is set from one listener. You can use some mutable data structure > and fill it from multiple listeners. +## Meta information + +The library provides `metaInfo` property for `IState` and `Transition` types. +`MetaInfo` is a marker interface allowing to attach some static information to library primitives. +This mechanism is extendable and users may add their own `MetaInfo` sub interfaces/classes if necessary. +Currently the only standard implementation is `UmlMetaInfo` which is useful for export feature. +See [controlling export output](#controlling-export-output). + +> [!NOTE] +> MetaInfo considered to be immutable data by design + ## Error handling ### Ignored events