ueca-react 1.0.5 → 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 (36) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +109 -57
  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 +44 -0
  24. package/package.json +70 -40
  25. package/dist/componentModel.d.ts +0 -127
  26. package/dist/componentModel.js +0 -741
  27. package/dist/dynamicContent.d.ts +0 -22
  28. package/dist/dynamicContent.js +0 -77
  29. package/dist/index.js +0 -29
  30. package/dist/messageBus.d.ts +0 -47
  31. package/dist/messageBus.js +0 -139
  32. package/dist/utils.d.ts +0 -8
  33. package/dist/utils.js +0 -17
  34. package/docs/bindings-overview.md +0 -164
  35. package/docs/introduction.md +0 -56
  36. 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,57 +1,109 @@
1
- ![logo](/docs/logo.png)
2
-
3
- # Unified Encapsulated Component Architecture
4
-
5
- ## From the Author
6
-
7
- The UECA framework was initially developed as a fun pet project to explore the unification of building blocks (components) in React-based applications. The rationale behind this was straightforward: developing large-scale React applications, especially the business logic, using pure React and the recommended React patterns is unequivocally challenging. Even with a well-organized, experienced, and motivated development team, pure React code often appears overly complex, creating unnecessary cognitive load for developers. This complexity usually leads to poor code structure, numerous bugs, tensions among developers, and frequently missed deadlines, ultimately harming the business.
8
-
9
- React, while powerful, is a relatively low-level technology that demands developers not only have substantial React programming experience but also meticulously organize their code to avoid confusion. This approach is labor-intensive during both development and maintenance. Statistically, low-level, non-templated code tends to have more bugs than code built on a foundation of higher-order architectural principles. Ideally, low-level programming patterns should be encapsulated behind a facade of these principles.
10
-
11
- In most cases, UI application development employs a component-based approach. The user interface is constructed from various unified parts called components, and React is built on this model. However, standard React patterns force developers to worry excessively about component interactions. As a result, developers often write different code that serves similar functions. In a team environment, this issue can multiply exponentially. Normalizing such logic is either prohibitively expensive or nearly impossible. Unfortunately, businesses often prioritize enhancements over code refactoring, leaving teams to manage redundant code that becomes increasingly costly to support over time. Statistically, the likelihood of bugs in the system increases with the volume of code.
12
-
13
- UECA addresses this problem by encapsulating routine code, allowing developers to focus on high-level logic and unifying the code structure. Additionally, UECA mitigates the need for highly experienced React developers. The code pattern requires minimal React experience, making the primary technologies TypeScript and JSX. Even a group of junior developers, guided by a UI architect, can perform well using this framework.
14
-
15
- The UECA library has already been successfully employed to develop a large-scale commercial web application. Initially, the project began with pure React, but it gradually became unmanageable. Adopting UECA saved the project from shutdown, preserved developers' jobs, and ultimately allowed the product to be released. This is a true success story.
16
-
17
- Special thanks to *Artem Tsetkhalin, Roman Ilyuchonak, Roman Nekliukov, Andrey Solovyov, and Pavel Borodaev* for their testing and bug reports.
18
-
19
- If you have any questions or comments, please feel free to reach out to me at cranesoft@protonmail.com.
20
-
21
- Thank you very much for your interest in and support of UECA ideas. Happy coding! 😎
22
-
23
- ## UECA Basic Documentation
24
-
25
- Comprehensive documentation detailing UECA aspects, code patterns, and examples will be available soon.
26
-
27
- ### [1. Component Mental Model](/docs/component-mental-model.md)
28
-
29
- ### [2. Component Integration Model](/docs/component-intergation-model.md)
30
-
31
- ### [3. Introduction to UECA](/docs/introduction.md)
32
-
33
- ### [4. Technology of UECA ](/docs/technology.md)
34
-
35
- ### [5. Base Concepts of UECA ](/docs/base-concepts.md)
36
-
37
- ### [6. General Code Structure](/docs/general-code-structure.md)
38
-
39
- ### [7. Property Bindings ](/docs/bindings-overview.md)
40
-
41
- ### [8. Message Bus ](/docs/message-bus.md)
42
-
43
- ### [9. Standard Code Template](/docs/code-template.md)
44
-
45
- ## Code Examples on CodeSandbox
46
- #### [UECA Basics: Application (Code Examples Menu)](https://codesandbox.io/p/sandbox/frosty-banach-jsf84c)
47
-
48
- Additional code examples will be available soon. Check the CodeSandbox UECA project.
49
-
50
- #
51
-
52
- <iframe src="https://codesandbox.io/embed/8x7yst?view=preview&module=%2Fsrc%2Fcomponents%2FappMessages.ts&hidenavigation=1"
53
- style="width:100%; height: 500px; border:0; border-radius: 4px; overflow:hidden;"
54
- title="UECA Basics: Message Bus"
55
- allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
56
- sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
57
- />
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 { }