ueca-react 1.0.7 → 2.0.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.
Files changed (39) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +109 -119
  3. package/dist/index.d.ts +266 -4
  4. package/dist/ueca-react.js +1453 -0
  5. package/docs/Arrays and Reactivity in UECA-React.md +158 -0
  6. package/docs/Automatic onChange Events in UECA-React.md +142 -0
  7. package/docs/Automatic onChanging Events in UECA-React.md +157 -0
  8. package/docs/Automatic onPropChange and onPropChanging Events in UECA-React.md +112 -0
  9. package/docs/Component Extension in UECA-React.md +275 -0
  10. package/docs/Component IDs in UECA-React.md +181 -0
  11. package/docs/{component-intergation-model.md → Component Integration Model in UECA-React.md } +4 -3
  12. package/docs/{component-mental-model.md → Component Mental Model in UECA-React.md } +4 -3
  13. package/docs/Introduction to UECA-React Components.md +190 -0
  14. package/docs/Introduction to UECA-React.md +24 -0
  15. package/docs/Lifecycle Hooks in UECA-React.md +237 -0
  16. package/docs/Message Bus in UECA-React.md +260 -0
  17. package/docs/Model Caching in UECA-React.md +144 -0
  18. package/docs/Property Bindings in UECA-React.md +191 -0
  19. package/docs/State Management in UECA-React.md +128 -0
  20. package/docs/Technology of UECA-React.md +45 -0
  21. package/docs/Tracing in UECA-React.md +110 -0
  22. package/docs/code-template.md +53 -27
  23. package/docs/index.md +31 -11
  24. package/package.json +68 -72
  25. package/dist/componentModel.d.ts +0 -127
  26. package/dist/componentModel.js +0 -772
  27. package/dist/dynamicContent.d.ts +0 -22
  28. package/dist/dynamicContent.js +0 -80
  29. package/dist/index.js +0 -29
  30. package/dist/messageBus.d.ts +0 -46
  31. package/dist/messageBus.js +0 -141
  32. package/dist/utils.d.ts +0 -8
  33. package/dist/utils.js +0 -52
  34. package/docs/base-concepts.md +0 -192
  35. package/docs/bindings-overview.md +0 -164
  36. package/docs/general-code-structure.md +0 -177
  37. package/docs/introduction.md +0 -56
  38. package/docs/message-bus.md +0 -177
  39. package/docs/technology.md +0 -45
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  ISC License
2
2
 
3
- Copyright (c) Aleksey Suvorov, CraneSoft LLC
3
+ Copyright (c) 2022-2026 Aleksey Suvorov
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
package/README.md CHANGED
@@ -1,119 +1,109 @@
1
- ![logo](/docs/logo.png)
2
- # UECA-React
3
-
4
- ## Why UECA?
5
-
6
- Building large-scale React apps can be a mess—complex code, bug-prone patterns, and endless refactoring. UECA (Unified Encapsulated Component Architecture) changes that. Born as a pet project, it simplifies React development by hiding the low-level chaos behind a clean, unified structure.
7
-
8
- Curious about easier React development? Here’s what UECA brings to the table:
9
-
10
- **Simple Learning Curve**: No React or MobX expertise needed—just plain TypeScript and JSX.
11
- ```typescript
12
- const struct = {
13
- props: {text: "" },
14
- View: () => <div>{model.text}</div>
15
- };
16
- ```
17
-
18
- **Single Principle**: Model-View approach keeps code predictable.
19
- ```typescript
20
- View: () => <button onClick={() => model.onClick?.()}>{model.text}</button>
21
- ```
22
-
23
- **Strong Typing Everywhere**: Full TypeScript support ensures safety and clarity across all components.
24
- ```typescript
25
- // 'API.getTime' is literal type
26
- model.time = await model.bus.getAsync("API.getTime");
27
-
28
- // 'onChangeTemperature' is auto-event for property 'temperature'
29
- onChangeTemperature={() => { console.log("Temperature changed"); }}
30
- ```
31
-
32
- **Homogeneous Structure**: Every component looks the same—easy to read, review, and test.
33
- ```typescript
34
- type ButtonStruct = UEC.ComponentStruct<{
35
- props: {
36
- caption: string;
37
- clickMode: "click" | "toggle";
38
- active: boolean;
39
- disabled: boolean;
40
- };
41
-
42
- events: {
43
- onClick: () => void;
44
- };
45
-
46
- methods: {
47
- click: () => void;
48
- };
49
- }>;
50
- ```
51
-
52
- **Stateful Simplicity**: State (MobX) and React are hidden, freeing you for business logic.
53
- ```typescript
54
- model.value = "new text"; // Fires onChangeValue event and auto-updates UI
55
- ```
56
-
57
- **Powerful Bindings**: Link properties effortlessly.
58
- ```typescript
59
- lastNameInput: useInput({
60
- label: "Last Name:",
61
- value: UEC.bindProp(() => model.lastName, "lastName"), // two-ways binding
62
- disabled: () => !model.allowEditing // one-way binding
63
- }),
64
- ```
65
-
66
- **Built-in Events**: Automatic `onChange`/`onChanging` events when property changes.
67
- ```typescript
68
- onChangeTemperature={() => { model.pressure = model.calcPressure(model.temperature); }}
69
- ```
70
-
71
- **Message Bus**: Async communication between components.
72
- ```typescript
73
- messages: {
74
- "API.getItemName": async (id) => await model.apiClient.get("get-item-name?id:", { id })
75
- },
76
- ```
77
-
78
- **Lifecycle Hooks**: `init`, `mount`, `unmount` out of the box.
79
- ```typescript
80
- init: async () => {
81
- model.itemName = await model.bus.getAsync("API.getItemName", { id: model.itemId }),
82
- }
83
- ```
84
-
85
- **Large Scale**: Perfect for large-scale apps, proven in production.
86
-
87
- **Easier Project Management**: Team leads and architects breathe easier with UECA.
88
- Its uniform component structure and strong typing mean predictable code—no wild variations or guesswork. Onboarding is fast, reviews are straightforward, and scaling doesn’t spiral out of control. Spend less time micromanaging and more on steering the project.
89
-
90
- UECA saved a real-world project from collapse, turning chaos into a shipped product. Ready to simplify your React journey? Try it out!
91
-
92
- Questions? Reach me at [cranesoft@protonmail.com](mailto:cranesoft@protonmail.com). Happy coding!
93
-
94
- ## Current Version: 1.0.7
95
-
96
- The latest stable release of `ueca-react` is version 1.0.7. This version provides a solid UECA foundation for building React applications.
97
-
98
- ### Installation
99
- ```bash
100
- npm install ueca-react
101
- ```
102
- Dependency npm packages (react, react-dom, lodash) should be installed separately in your React project. Compatible React versions: 16.8.0–19.1.0. Ensure your react-dom version matches your react version.
103
-
104
- ## Upcoming Version: 2.0
105
-
106
- Version 2.0 of `ueca-react` is in development and testing, bringing a major upgrade:
107
-
108
- - **Fresh Core**: Rewritten from scratch for rock-solid consistency.
109
- - **Dynamic Content**: Seamless support for functional components in JSX.
110
- - **Model Cache**: Models persist through unmounts, reused on remount.
111
- - **New Lifecycle**: `constr`, `init`, `deinit`, `mount`, `unmount`, `draw`, `erase` hooks for finer control.
112
- - **Async Power**: Better async handling with centralized error management.
113
- - **Advanced Messaging**: `broadcast`, `castTo`, and `unicast` for flexible communication.
114
- - **Richer Event Log**: Enhanced component model logging.
115
-
116
- Stay tuned—2.0 will turbocharge your UECA projects! Meanwhile, 1.0.7 keeps things steady.
117
-
118
- ## Getting Started
119
- Check out the [examples](https://codesandbox.io/p/sandbox/frosty-banach-jsf84c) and [documentation](/docs/index.md) to start building with `ueca-react`. For questions or contributions, feel free to reach out at [cranesoft@protonmail.com](mailto:cranesoft@protonmail.com).
1
+ ![logo](./docs/logo.png)
2
+ # UECA-React
3
+
4
+ > **⚠️ NOTICE: This is a test publication for early testing and feedback. The API may change before the stable release. Not recommended for production use yet.**
5
+
6
+ UECA-React is a framework for building scalable React applications with a unified and encapsulated component architecture. It simplifies development by hiding the complexities of React and MobX behind a consistent component pattern.
7
+
8
+ ## Installation
9
+
10
+ To install UECA-React, run the following command:
11
+
12
+ ```bash
13
+ npm install ueca-react
14
+ ```
15
+
16
+ Ensure that your project also has the following dependencies installed:
17
+
18
+ - react
19
+ - react-dom
20
+ - mobx
21
+ - mobx-react
22
+
23
+ Compatible React versions: 16.8.0–19.1.0. Make sure your react-dom version matches your react version.
24
+
25
+ ## Usage
26
+
27
+ Here's a simple example of a UECA component:
28
+
29
+ ```typescript
30
+ import * as UECA from "ueca-react";
31
+
32
+ type ButtonStruct = UECA.ComponentStruct<{
33
+ props: {
34
+ caption: string;
35
+ disabled: boolean;
36
+ };
37
+
38
+ events: {
39
+ onClick: () => void;
40
+ };
41
+ }>;
42
+
43
+ type ButtonParams = UECA.ComponentParams<ButtonStruct>;
44
+ type ButtonModel = UECA.ComponentModel<ButtonStruct>;
45
+
46
+ function useButton(params?: ButtonParams): ButtonModel {
47
+ const struct: ButtonStruct = {
48
+ props: {
49
+ caption: "MyButton",
50
+ disabled: false
51
+ },
52
+
53
+ events: {
54
+ onChangeDisabled: (value) => {
55
+ console.log(`Button id=${model.fullId()} disabled=${value}`);
56
+ }
57
+ },
58
+
59
+ View: () => (
60
+ <button id={model.htmlId()} disabled={model.disabled} onClick={() => model.onClick?.()}>
61
+ {model.caption}
62
+ </button>
63
+ )
64
+ };
65
+
66
+ const model = UECA.useComponent(struct, params);
67
+ return model;
68
+ }
69
+
70
+ const Button = UECA.getFC(useButton);
71
+ export { ButtonModel, useButton, Button };
72
+ ```
73
+
74
+ For more detailed information, check out the [full documentation](./docs/index.md).
75
+
76
+ ## Features
77
+
78
+ - **Unified Component Pattern**: Consistent structure for all components
79
+ - **Type-Safe**: Full TypeScript support with comprehensive type definitions
80
+ - **MobX Integration**: Automatic reactivity without manual state management
81
+ - **Automatic onChange Events**: Auto-generated event handlers for every property (e.g., `onChangeCaption` for `caption` prop)
82
+ - **Lifecycle Hooks**: Built-in lifecycle management (constr, init, mount, draw, erase, unmount, deinit)
83
+ - **Message Bus**: Decoupled inter-component communication
84
+ - **Property Bindings**: Bidirectional data binding between components
85
+ - **AI-Friendly**: Designed for easy code generation and AI assistance
86
+
87
+ ## Documentation
88
+
89
+ Comprehensive documentation is available in the [docs](./docs) folder:
90
+ - [Introduction to UECA-React](./docs/Introduction%20to%20UECA-React.md)
91
+ - [Component Guide](./docs/Introduction%20to%20UECA-React%20Components.md)
92
+ - [State Management](./docs/State%20Management%20in%20UECA-React.md)
93
+ - [Message Bus](./docs/Message%20Bus%20in%20UECA-React.md)
94
+ - [Lifecycle Hooks](./docs/Lifecycle%20Hooks%20in%20UECA-React.md)
95
+ - [Property Bindings](./docs/Property%20Bindings%20in%20UECA-React.md)
96
+
97
+ ## Support
98
+
99
+ For questions, issues, or feature requests, please use the [GitHub issue tracker](https://github.com/nekutuzov/ueca-react-npm/issues).
100
+
101
+ ## License
102
+
103
+ This project is licensed under the ISC License - see the [LICENSE](./LICENSE) file for details.
104
+
105
+ ## Author
106
+
107
+ **Aleksey Suvorov**
108
+ Email: cranesoft@protonmail.com
109
+ GitHub: [nekutuzov/ueca-react-npm](https://github.com/nekutuzov/ueca-react-npm)
package/dist/index.d.ts CHANGED
@@ -1,4 +1,266 @@
1
- export { ComponentModel, AnyComponentModel, ComponentTemplate, ComponentStruct, ComponentProps, ComponentMethods, ComponentEvents, ComponentMessages, ComponentParams, ComponentView, DynamicChildren, ComponentModelTrap, ComponentModelTrapRegistry, useComponentModelTrap, newComponentModelTrapRegistry, useComponent, mergeStruct, blankView, bind, bindProp, componentModelDebug, getFC, $ } from "./componentModel";
2
- export { IMessageBus, Messages, AsyncMethod, AnyMessage, MessageBusEvent, AnyName, Messaging, messageBusEventPost, useMessaging, useCustomMessaging, createMessageBus, defaultMessageBus } from "./messageBus";
3
- export { DynamicContentModel, DynamicContent, useDynamicContent } from "./dynamicContent";
4
- export { IF, renderNode, isSimpleNode } from "./utils";
1
+ import * as React_2 from 'react';
2
+
3
+ export declare const $: unique symbol;
4
+
5
+ export declare const $name = "$";
6
+
7
+ export declare type AnyComponentModel = ComponentModel<AnyComponentStruct>;
8
+
9
+ export declare type AnyComponentParams = ComponentParams<AnyComponentStruct>;
10
+
11
+ export declare type AnyComponentStruct = ComponentStruct<ComponentStructBase<BusMessages>>;
12
+
13
+ export declare function bind<T extends NonNullable<unknown>, P extends keyof T>(obj: () => T, prop: P): Bond<T[P]>;
14
+
15
+ export declare function bind<T>(get: () => T, set: ((value: T) => void) | undefined): Bond<T>;
16
+
17
+ /**
18
+ * @deprecated Use the `bind` function instead.
19
+ */
20
+ export declare function bindProp<T extends NonNullable<unknown>, P extends keyof T>(obj: () => T, prop: P): Bond<T[P]>;
21
+
22
+ export declare type Bond<T> = [(() => T) | undefined, ((value: T) => void) | undefined];
23
+
24
+ export declare type BusMessageHandlers<TMsg extends BusMessages> = {
25
+ [Msg in keyof TMsg]?: ParamIn<TMsg, Msg> extends undefined ? MessageHandlerNoPar<TMsg, Msg> : MessageHandler<TMsg, Msg>;
26
+ };
27
+
28
+ export declare type BusMessages = Record<MessageID, InParam | OutParam | InParam & OutParam> | EmptyObject;
29
+
30
+ export declare function clone<T>(obj: T): T | undefined;
31
+
32
+ declare type ComponentChildren<TStruct extends GeneralComponentStruct> = NonNullable<TStruct["children"]>;
33
+
34
+ declare type ComponentEvents<TStruct extends GeneralComponentStruct> = Partial<NonNullable<TStruct["events"]>>;
35
+
36
+ declare type ComponentMessages<TStruct extends ComponentStructBase<TMsg>, TMsg extends BusMessages> = NonNullable<TStruct["messages"]>;
37
+
38
+ declare type ComponentMethods<TStruct extends GeneralComponentStruct> = NonNullable<TStruct["methods"]>;
39
+
40
+ export declare type ComponentModel<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends BusMessages = BusMessages> = ComponentProps<NonNullable<TStruct["__struct"]>> & Readonly<ComponentChildren<NonNullable<TStruct["__struct"]>>> & Readonly<ComponentMethods<NonNullable<TStruct["__struct"]>>> & ComponentStructEvents<ComponentProps<NonNullable<TStruct["__struct"]>>> & ComponentEvents<NonNullable<TStruct["__struct"]>> & {
41
+ readonly $: ComponentPrivateMembers;
42
+ readonly bus: MessageBus<TMsg>;
43
+ readonly View: ComponentView;
44
+ readonly BaseView: ComponentView;
45
+ readonly disableOnChange: () => void;
46
+ readonly enableOnChange: () => void;
47
+ readonly changeNotifyDisabled: () => boolean;
48
+ readonly fullId: () => string;
49
+ readonly htmlId: () => string | undefined;
50
+ readonly birthMark: () => string;
51
+ readonly clearModelCache: () => void;
52
+ readonly getChildrenModels: GetChildrenModels;
53
+ readonly invalidateView: () => void;
54
+ };
55
+
56
+ export declare type ComponentParams<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends BusMessages = BusMessages> = ComponentProps<TStruct> & ComponentEvents<TStruct> & {
57
+ constr?: (model: ComponentModel<TStruct, TMsg>) => void;
58
+ init?: (model: ComponentModel<TStruct, TMsg>) => void;
59
+ deinit?: (model: ComponentModel<TStruct, TMsg>) => void;
60
+ mount?: (model: ComponentModel<TStruct, TMsg>) => void;
61
+ unmount?: (model: ComponentModel<TStruct, TMsg>) => void;
62
+ draw?: (model: ComponentModel<TStruct, TMsg>) => void;
63
+ erase?: (model: ComponentModel<TStruct, TMsg>) => void;
64
+ };
65
+
66
+ declare type ComponentPrivateMembers = {
67
+ __status: {
68
+ initPhase?: "constructing" | "constructed" | "initializing" | "initialized" | "unmount-deinit" | "deinitializing";
69
+ mountPhase?: "init-mount" | "mounting" | "mounted" | "unmounting";
70
+ cached: boolean;
71
+ initCount: number;
72
+ mountCount: number;
73
+ baseResult: unknown;
74
+ };
75
+ __settersInProgress: string[];
76
+ __owner: AnyComponentModel;
77
+ __struct: AnyComponentStruct;
78
+ __params: AnyComponentParams;
79
+ __assignParams: (params: AnyComponentParams) => void;
80
+ __dynamicChildrenIds: string[];
81
+ __staticChildrenCache: AnyComponentModel[];
82
+ __proxy: AnyComponentModel;
83
+ __initializeModel: (params?: AnyComponentParams) => void;
84
+ };
85
+
86
+ declare type ComponentProps<TStruct extends GeneralComponentStruct> = Partial<NonNullable<TStruct["props"]>>;
87
+
88
+ export declare type ComponentStruct<TStruct extends GeneralComponentStruct, TMsg extends BusMessages = BusMessages> = PartialGeneralComponentStruct<ComponentStructBase<TMsg>, TMsg> & Omit<TStruct & ComponentStructBase<TMsg>, "props" | "children" | "methods" | "events" | "messages"> & PartialGeneralComponentStruct<TStruct, TMsg> & {
89
+ __struct?: TStruct;
90
+ };
91
+
92
+ declare type ComponentStructBase<TMsg extends BusMessages> = GeneralComponentStruct & {
93
+ props?: {
94
+ id?: string;
95
+ cacheable?: boolean;
96
+ };
97
+ messages?: BusMessageHandlers<TMsg>;
98
+ View?: ComponentView;
99
+ BaseView?: ComponentView;
100
+ constr?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => MaybePromise;
101
+ init?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => MaybePromise;
102
+ deinit?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => MaybePromise;
103
+ mount?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => MaybePromise;
104
+ unmount?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => MaybePromise;
105
+ draw?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => MaybePromise;
106
+ erase?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => MaybePromise;
107
+ } & {
108
+ __struct?: ComponentStructBase<TMsg>;
109
+ };
110
+
111
+ declare type ComponentStructEvents<TProps> = {
112
+ onPropChanging?: (prop: keyof TProps | string, newValue: unknown, oldValue: unknown) => unknown;
113
+ onPropChange?: (prop: keyof TProps | string, value: unknown, oldValue: unknown) => void;
114
+ } & {
115
+ [Evt in keyof TProps as `onChanging${Capitalize<Evt & string>}`]?: (newValue: TProps[Evt], oldValue: TProps[Evt]) => TProps[Evt];
116
+ } & {
117
+ [Evt in keyof TProps as `onChange${Capitalize<Evt & string>}`]?: (value: TProps[Evt], oldValue: TProps[Evt]) => void;
118
+ };
119
+
120
+ export declare type ComponentView = (params?: ViewParams) => ReactElement;
121
+
122
+ export declare function defaultMessageBus<TMsg extends BusMessages>(): MessageBus<TMsg>;
123
+
124
+ export declare type DynamicChildren = Record<string, AnyComponentModel>;
125
+
126
+ export declare type EmptyObject = Record<never, never>;
127
+
128
+ export declare type ErrorHandler = (error: Error) => void;
129
+
130
+ export declare function errorIf(condition: boolean, errorMessage?: string): void;
131
+
132
+ export declare function errorIfNot(condition: boolean, errorMessage?: string): void;
133
+
134
+ export declare type GeneralComponentStruct = {
135
+ props?: EmptyObject;
136
+ children?: EmptyObject;
137
+ methods?: EmptyObject;
138
+ events?: EmptyObject;
139
+ };
140
+
141
+ declare type GetChildrenModels = (childrenTypeFilter?: ModelType) => AnyComponentModel[];
142
+
143
+ export declare function getFC<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends BusMessages>(modelHook: (params: ComponentParams<TStruct, TMsg>) => ComponentModel<TStruct, TMsg>): (params: ComponentParams<TStruct, TMsg>) => React_2.JSX.Element;
144
+
145
+ declare type GlobalSettings = {
146
+ traceLog: boolean;
147
+ hashHtmlId: boolean;
148
+ modelCacheMode: "no-cache" | "cache" | "auto-cache";
149
+ errorHandler?: ErrorHandler;
150
+ };
151
+
152
+ export declare const globalSettings: GlobalSettings;
153
+
154
+ export declare function IF(props: {
155
+ condition: boolean;
156
+ children: React_2.ReactNode;
157
+ }): React_2.JSX.Element;
158
+
159
+ declare type InParam = {
160
+ in: unknown;
161
+ };
162
+
163
+ export declare function intersection(a: unknown[], b: unknown[]): unknown[];
164
+
165
+ export declare function isArray(value: unknown): value is unknown[];
166
+
167
+ export declare function isBoolean(value: unknown): value is boolean;
168
+
169
+ export declare function isComponentModel(obj: unknown): boolean;
170
+
171
+ export declare function isEqual(a: unknown, b: unknown): boolean;
172
+
173
+ export declare function isFunction(value: unknown): value is () => unknown;
174
+
175
+ export declare function isMap(value: unknown): value is Map<unknown, unknown>;
176
+
177
+ export declare function isNull(value: unknown): value is null;
178
+
179
+ export declare function isNumber(value: unknown): value is number;
180
+
181
+ export declare function isObject(value: unknown): value is Record<string, unknown>;
182
+
183
+ export declare function isString(value: unknown): value is string;
184
+
185
+ export declare function isSymbol(value: unknown): value is symbol;
186
+
187
+ export declare function isUndefined(value: unknown): value is undefined;
188
+
189
+ export declare type MaybePromise = void | Promise<void>;
190
+
191
+ export declare type MessageBus<TMsg extends BusMessages> = {
192
+ readonly name?: string;
193
+ subscribe(subscriber: Subscriber<TMsg>): void;
194
+ unsubscribe(subscriber: Subscriber<TMsg>): void;
195
+ broadcast<Msg extends keyof TMsg>(modelId: string | RegExp | null, message: Msg, param: ParamIn<TMsg, Msg>): Promise<ParamOut<TMsg, Msg>[]>;
196
+ castTo<Msg extends keyof TMsg>(modelId: string, message: Msg, param: ParamIn<TMsg, Msg>): Promise<ParamOut<TMsg, Msg>>;
197
+ unicast<Msg extends keyof TMsg>(message: Msg, param: ParamIn<TMsg, Msg>): Promise<ParamOut<TMsg, Msg>>;
198
+ /**
199
+ * @deprecated Use the `unicast` function instead.
200
+ */
201
+ getAsync<Msg extends keyof TMsg>(message: Msg, param: ParamIn<TMsg, Msg>): Promise<ParamOut<TMsg, Msg>>;
202
+ /**
203
+ * @deprecated Use the `unicast` function instead.
204
+ */
205
+ postAsync<Msg extends keyof TMsg>(message: Msg, param: ParamIn<TMsg, Msg>): Promise<ParamOut<TMsg, Msg>>;
206
+ };
207
+
208
+ declare type MessageHandler<TMsg extends BusMessages, Msg extends keyof TMsg> = (param: ParamIn<TMsg, Msg>) => Promise<ParamOut<TMsg, Msg> extends undefined ? void : ParamOut<TMsg, Msg>>;
209
+
210
+ declare type MessageHandlerNoPar<TMsg extends BusMessages, Msg extends keyof TMsg> = () => Promise<ParamOut<TMsg, Msg> extends undefined ? void : ParamOut<TMsg, Msg>>;
211
+
212
+ declare type MessageID = string;
213
+
214
+ declare type ModelType = "static" | "dynamic";
215
+
216
+ export declare function observe<T extends object>(value: T): T;
217
+
218
+ declare type OutParam = {
219
+ out: unknown;
220
+ };
221
+
222
+ declare type ParamIn<TMsg extends BusMessages, Msg extends keyof TMsg> = TMsg[Msg] extends InParam ? TMsg[Msg][keyof InParam] : undefined;
223
+
224
+ declare type ParamOut<TMsg extends BusMessages, Msg extends keyof TMsg> = TMsg[Msg] extends OutParam ? TMsg[Msg][keyof OutParam] : void;
225
+
226
+ declare type PartialGeneralComponentStruct<TStruct extends GeneralComponentStruct, TMsg extends BusMessages> = {
227
+ props?: Partial<StructProps<ComponentProps<TStruct>>>;
228
+ children?: Partial<ComponentChildren<TStruct>>;
229
+ methods?: Partial<ComponentMethods<TStruct>>;
230
+ events?: Partial<ComponentStructEvents<ComponentProps<TStruct>>> & Partial<ComponentEvents<TStruct>>;
231
+ messages?: Partial<ComponentMessages<TStruct, TMsg>>;
232
+ };
233
+
234
+ export declare type ReactCSS = React_2.CSSProperties;
235
+
236
+ export declare type ReactElement = React_2.JSX.Element;
237
+
238
+ export declare const RenderNode: (props: {
239
+ node: React_2.ReactNode | React_2.ComponentType;
240
+ render?: boolean;
241
+ }) => React_2.JSX.Element;
242
+
243
+ export declare function renderNode(node: React_2.ReactNode | React_2.ComponentType): React_2.ReactNode;
244
+
245
+ export declare function sleep(ms: number): Promise<void>;
246
+
247
+ declare type StructProp<T> = T | (() => T) | Bond<T>;
248
+
249
+ declare type StructProps<TProps extends object> = {
250
+ [Prop in keyof TProps]: StructProp<TProps[Prop]>;
251
+ };
252
+
253
+ declare type Subscriber<TMsg extends BusMessages> = ComponentModel<ComponentStructBase<TMsg>, TMsg>;
254
+
255
+ export declare function useComponent<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends BusMessages>(struct: TStruct, params?: ComponentParams<TStruct, TMsg>): ComponentModel<TStruct, TMsg>;
256
+
257
+ export declare function useExtendedComponent<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends BusMessages>(struct: ComponentStruct<ComponentStructBase<TMsg>, TMsg>, extStruct: TStruct, params?: ComponentParams<TStruct, TMsg>, modelHook?: (struct: TStruct, params?: ComponentParams<TStruct, TMsg>) => ComponentModel<TStruct, TMsg>): ComponentModel<TStruct, TMsg>;
258
+
259
+ export declare function useMessaging<TMsg extends BusMessages>(model: Subscriber<TMsg>): MessageBus<TMsg>;
260
+
261
+ declare type ViewParams = {
262
+ render?: boolean;
263
+ children?: React_2.ReactNode;
264
+ };
265
+
266
+ export { }