baraqex 1.0.74 → 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 (185) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +272 -472
  3. package/bin/baraqex.js +150 -12
  4. package/dist/browser.d.ts +1 -1
  5. package/dist/browser.d.ts.map +1 -1
  6. package/dist/browser.js +2319 -205
  7. package/dist/browser.js.map +4 -4
  8. package/dist/core/batch.d.ts +10 -0
  9. package/dist/core/batch.d.ts.map +1 -0
  10. package/dist/core/component.d.ts +69 -0
  11. package/dist/core/component.d.ts.map +1 -0
  12. package/dist/core/context.d.ts +22 -0
  13. package/dist/core/context.d.ts.map +1 -0
  14. package/dist/core/errors.d.ts +125 -0
  15. package/dist/core/errors.d.ts.map +1 -0
  16. package/dist/core/event-bus.d.ts +29 -0
  17. package/dist/core/event-bus.d.ts.map +1 -0
  18. package/dist/core/forms.d.ts +128 -0
  19. package/dist/core/forms.d.ts.map +1 -0
  20. package/dist/core/hooks.d.ts +84 -0
  21. package/dist/core/hooks.d.ts.map +1 -0
  22. package/dist/core/index.d.ts +23 -0
  23. package/dist/core/index.d.ts.map +1 -0
  24. package/dist/core/jsx-runtime.d.ts +45 -0
  25. package/dist/core/jsx-runtime.d.ts.map +1 -0
  26. package/dist/core/lifecycle-events.d.ts +71 -0
  27. package/dist/core/lifecycle-events.d.ts.map +1 -0
  28. package/dist/core/renderer.d.ts +39 -0
  29. package/dist/core/renderer.d.ts.map +1 -0
  30. package/dist/core/router.d.ts +108 -0
  31. package/dist/core/router.d.ts.map +1 -0
  32. package/dist/core/server-renderer.d.ts +26 -0
  33. package/dist/core/server-renderer.d.ts.map +1 -0
  34. package/dist/core/store.d.ts +102 -0
  35. package/dist/core/store.d.ts.map +1 -0
  36. package/dist/core/types.d.ts +66 -0
  37. package/dist/core/types.d.ts.map +1 -0
  38. package/dist/core/utils.d.ts +153 -0
  39. package/dist/core/utils.d.ts.map +1 -0
  40. package/dist/core/vdom.d.ts +29 -0
  41. package/dist/core/vdom.d.ts.map +1 -0
  42. package/dist/index.d.ts +39 -35
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +2592 -508
  45. package/dist/index.js.map +4 -4
  46. package/dist/server/auth.d.ts +8 -3
  47. package/dist/server/auth.d.ts.map +1 -1
  48. package/dist/server/index.d.ts +2 -2
  49. package/dist/server/index.d.ts.map +1 -1
  50. package/dist/server/index.js +173 -112
  51. package/dist/server/index.js.map +4 -4
  52. package/dist/server/middleware.d.ts +10 -1
  53. package/dist/server/middleware.d.ts.map +1 -1
  54. package/package.json +224 -124
  55. package/templates/basic-app/src/main.jsx +336 -0
  56. package/templates/complete-app/api/hello.js +0 -0
  57. package/templates/complete-app/client.js +58 -0
  58. package/templates/complete-app/lib/frontend-hamroun.js +182 -0
  59. package/templates/complete-app/package.json +18 -0
  60. package/templates/complete-app/pages/about.js +119 -0
  61. package/templates/complete-app/pages/about.jsx +0 -0
  62. package/templates/complete-app/pages/index.js +157 -0
  63. package/templates/complete-app/pages/index.jsx +0 -0
  64. package/templates/complete-app/pages/wasm-demo.js +290 -0
  65. package/templates/complete-app/pages/wasm-demo.jsx +0 -0
  66. package/templates/complete-app/public/client.js +89 -0
  67. package/templates/complete-app/public/index.html +118 -0
  68. package/templates/complete-app/public/styles.css +76 -0
  69. package/templates/complete-app/readme.md +188 -0
  70. package/templates/complete-app/server.js +226 -0
  71. package/templates/complete-app/server.ts +275 -0
  72. package/templates/complete-app/src/App.tsx +59 -0
  73. package/templates/complete-app/src/client.ts +61 -0
  74. package/templates/complete-app/src/client.tsx +18 -0
  75. package/templates/complete-app/src/pages/index.tsx +51 -0
  76. package/templates/complete-app/src/server.ts +218 -0
  77. package/templates/complete-app/tsconfig.json +22 -0
  78. package/templates/complete-app/tsconfig.server.json +19 -0
  79. package/templates/complete-app/vite.config.js +57 -0
  80. package/templates/complete-app/vite.config.ts +30 -0
  81. package/templates/complete-app/wasm/build.bat +0 -0
  82. package/templates/complete-app/wasm/build.sh +0 -0
  83. package/templates/complete-app/wasm/example.go +0 -0
  84. package/templates/fullstack-app/README.md +37 -0
  85. package/templates/fullstack-app/api/hello.js +11 -0
  86. package/templates/fullstack-app/api/hello.ts +18 -0
  87. package/templates/fullstack-app/api/users/[id].ts +73 -0
  88. package/templates/fullstack-app/api/users/index.ts +32 -0
  89. package/templates/fullstack-app/build/main.css +874 -0
  90. package/templates/fullstack-app/build/main.css.map +7 -0
  91. package/templates/fullstack-app/build/main.js +967 -0
  92. package/templates/fullstack-app/build/main.js.map +7 -0
  93. package/templates/fullstack-app/build.ts +210 -0
  94. package/templates/fullstack-app/index.html +36 -0
  95. package/templates/fullstack-app/package.json +35 -0
  96. package/templates/fullstack-app/postcss.config.js +6 -0
  97. package/templates/fullstack-app/process-tailwind.js +45 -0
  98. package/templates/fullstack-app/public/_redirects +1 -0
  99. package/templates/fullstack-app/public/route-handler.js +47 -0
  100. package/templates/fullstack-app/public/spa-fix.html +17 -0
  101. package/templates/fullstack-app/public/styles.css +975 -0
  102. package/templates/fullstack-app/public/tailwind.css +15 -0
  103. package/templates/fullstack-app/server.js +267 -0
  104. package/templates/fullstack-app/server.ts +474 -0
  105. package/templates/fullstack-app/src/README.md +55 -0
  106. package/templates/fullstack-app/src/client.js +87 -0
  107. package/templates/fullstack-app/src/components/ClientHome.tsx +0 -0
  108. package/templates/fullstack-app/src/components/ErrorBoundary.tsx +36 -0
  109. package/templates/fullstack-app/src/components/Layout.tsx +42 -0
  110. package/templates/fullstack-app/src/components/StateDemo.tsx +207 -0
  111. package/templates/fullstack-app/src/components/UserList.tsx +44 -0
  112. package/templates/fullstack-app/src/config.ts +42 -0
  113. package/templates/fullstack-app/src/data/api.ts +206 -0
  114. package/templates/fullstack-app/src/main.tsx +155 -0
  115. package/templates/fullstack-app/src/middleware.ts +28 -0
  116. package/templates/fullstack-app/src/pages/404.tsx +28 -0
  117. package/templates/fullstack-app/src/pages/[id].tsx +0 -0
  118. package/templates/fullstack-app/src/pages/_app.tsx +11 -0
  119. package/templates/fullstack-app/src/pages/_document.tsx +25 -0
  120. package/templates/fullstack-app/src/pages/_error.tsx +45 -0
  121. package/templates/fullstack-app/src/pages/about/index.tsx +67 -0
  122. package/templates/fullstack-app/src/pages/about.tsx +71 -0
  123. package/templates/fullstack-app/src/pages/api/users/[id].ts +73 -0
  124. package/templates/fullstack-app/src/pages/api/users/index.ts +43 -0
  125. package/templates/fullstack-app/src/pages/index.tsx +110 -0
  126. package/templates/fullstack-app/src/pages/users/[id].tsx +153 -0
  127. package/templates/fullstack-app/src/pages/users.tsx +60 -0
  128. package/templates/fullstack-app/src/pages/wasm-demo.tsx +1 -0
  129. package/templates/fullstack-app/src/router.ts +255 -0
  130. package/templates/fullstack-app/src/styles.css +5 -0
  131. package/templates/fullstack-app/tailwind.config.js +11 -0
  132. package/templates/fullstack-app/tsconfig.json +18 -0
  133. package/templates/fullstack-app/vite.config.js +87 -0
  134. package/templates/go/build.bat +36 -0
  135. package/templates/go/build.sh +43 -0
  136. package/templates/go/example.go +205 -0
  137. package/templates/go-wasm-app/README.md +38 -0
  138. package/templates/go-wasm-app/babel.config.js +21 -0
  139. package/templates/go-wasm-app/build-client.js +49 -0
  140. package/templates/go-wasm-app/build-wasm.js +237 -0
  141. package/templates/go-wasm-app/build.config.js +62 -0
  142. package/templates/go-wasm-app/build.js +218 -0
  143. package/templates/go-wasm-app/package.json +32 -0
  144. package/templates/go-wasm-app/public/index.html +128 -0
  145. package/templates/go-wasm-app/public/styles.css +197 -0
  146. package/templates/go-wasm-app/public/wasm/example.wasm +0 -0
  147. package/templates/go-wasm-app/public/wasm/wasm_exec.js +561 -0
  148. package/templates/go-wasm-app/public/wasm/wasm_exec_node.js +39 -0
  149. package/templates/go-wasm-app/server.js +70 -0
  150. package/templates/go-wasm-app/src/App.jsx +38 -0
  151. package/templates/go-wasm-app/src/app.js +173 -0
  152. package/templates/go-wasm-app/src/client.js +57 -0
  153. package/templates/go-wasm-app/src/components/Footer.jsx +13 -0
  154. package/templates/go-wasm-app/src/components/Header.jsx +19 -0
  155. package/templates/go-wasm-app/src/components/WasmDemo.jsx +120 -0
  156. package/templates/go-wasm-app/src/main.jsx +12 -0
  157. package/templates/go-wasm-app/src/wasm/example.go +75 -0
  158. package/templates/go-wasm-app/tsconfig.server.json +18 -0
  159. package/templates/go-wasm-app/vite.config.js +45 -0
  160. package/templates/ssr-template/package.json +16 -10
  161. package/templates/wasm/package.json +43 -43
  162. package/templates/wasm/src/App.tsx +2 -2
  163. package/dist/forms/index.d.ts +0 -2
  164. package/dist/forms/index.d.ts.map +0 -1
  165. package/dist/forms/types.d.ts +0 -2
  166. package/dist/forms/types.d.ts.map +0 -1
  167. package/dist/frontend/components/WasmLoader.d.ts +0 -2
  168. package/dist/frontend/components/WasmLoader.d.ts.map +0 -1
  169. package/dist/frontend/hooks/useWasm.d.ts +0 -2
  170. package/dist/frontend/hooks/useWasm.d.ts.map +0 -1
  171. package/dist/frontend/index.d.ts +0 -2
  172. package/dist/frontend/index.d.ts.map +0 -1
  173. package/dist/router/index.d.ts +0 -2
  174. package/dist/router/index.d.ts.map +0 -1
  175. package/dist/router/types.d.ts +0 -2
  176. package/dist/router/types.d.ts.map +0 -1
  177. package/dist/store/index.d.ts +0 -2
  178. package/dist/store/index.d.ts.map +0 -1
  179. package/dist/store/types.d.ts +0 -2
  180. package/dist/store/types.d.ts.map +0 -1
  181. package/templates/basic-app/package-lock.json +0 -7173
  182. package/templates/fullstack-template/package-lock.json +0 -3558
  183. package/templates/ssr-template/package-lock.json +0 -5380
  184. package/templates/wasm/package-lock.json +0 -5347
  185. package/templates/wasm/public/example.wasm +0 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Context API for passing data through the component tree
3
+ *
4
+ * Uses a context stack to support nested providers of the same context.
5
+ * Each Provider pushes its value onto the stack; useContext reads from the top.
6
+ */
7
+ export interface Context<T> {
8
+ Provider: (props: {
9
+ value: T;
10
+ children?: any;
11
+ }) => any;
12
+ Consumer: (props: {
13
+ children: (value: T) => any;
14
+ }) => any;
15
+ _id: symbol;
16
+ _defaultValue: T;
17
+ useSelector: <S>(selector: (state: T) => S) => S;
18
+ }
19
+ export declare function createContext<T>(defaultValue: T): Context<T>;
20
+ export declare function useContext<T>(context: Context<T>): T;
21
+ export declare function getContextValue<T>(context: Context<T>): T;
22
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/core/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE,KAAK,GAAG,CAAC;IACvD,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAA;KAAE,KAAK,GAAG,CAAC;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,CAAC,CAAC;IACjB,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;CAClD;AAKD,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CA6B5D;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAMpD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAEzD"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Baraqex Error Classes
3
+ *
4
+ * Custom error types for better debugging and error handling.
5
+ * Each error type provides specific context and helpful messages.
6
+ */
7
+ /**
8
+ * Base error class for all Baraqex errors
9
+ */
10
+ export declare class BaraqexError extends Error {
11
+ readonly code: string;
12
+ readonly hint?: string;
13
+ readonly docs?: string;
14
+ readonly originalCause?: Error;
15
+ constructor(message: string, options: {
16
+ code: string;
17
+ hint?: string;
18
+ docs?: string;
19
+ cause?: Error;
20
+ });
21
+ /**
22
+ * Format error for console output with helpful hints
23
+ */
24
+ format(): string;
25
+ }
26
+ /**
27
+ * Configuration-related errors
28
+ */
29
+ export declare class ConfigError extends BaraqexError {
30
+ constructor(message: string, options?: {
31
+ hint?: string;
32
+ cause?: Error;
33
+ });
34
+ }
35
+ /**
36
+ * Database connection and query errors
37
+ */
38
+ export declare class DatabaseError extends BaraqexError {
39
+ readonly dbType?: string;
40
+ constructor(message: string, options?: {
41
+ dbType?: string;
42
+ hint?: string;
43
+ cause?: Error;
44
+ });
45
+ }
46
+ /**
47
+ * Authentication and authorization errors
48
+ */
49
+ export declare class AuthError extends BaraqexError {
50
+ constructor(message: string, options?: {
51
+ hint?: string;
52
+ cause?: Error;
53
+ });
54
+ }
55
+ /**
56
+ * WASM loading and execution errors
57
+ */
58
+ export declare class WasmError extends BaraqexError {
59
+ constructor(message: string, options?: {
60
+ hint?: string;
61
+ cause?: Error;
62
+ });
63
+ }
64
+ /**
65
+ * Router and routing errors
66
+ */
67
+ export declare class RouterError extends BaraqexError {
68
+ constructor(message: string, options?: {
69
+ hint?: string;
70
+ cause?: Error;
71
+ });
72
+ }
73
+ /**
74
+ * Server lifecycle errors
75
+ */
76
+ export declare class ServerError extends BaraqexError {
77
+ constructor(message: string, options?: {
78
+ hint?: string;
79
+ cause?: Error;
80
+ });
81
+ }
82
+ /**
83
+ * Validation errors for user input
84
+ */
85
+ export declare class ValidationError extends BaraqexError {
86
+ readonly field?: string;
87
+ readonly value?: unknown;
88
+ constructor(message: string, options?: {
89
+ field?: string;
90
+ value?: unknown;
91
+ hint?: string;
92
+ cause?: Error;
93
+ });
94
+ }
95
+ /**
96
+ * HTTP-related errors with status codes
97
+ */
98
+ export declare class HttpError extends BaraqexError {
99
+ readonly statusCode: number;
100
+ constructor(statusCode: number, message: string, options?: {
101
+ hint?: string;
102
+ });
103
+ static badRequest(message?: string, hint?: string): HttpError;
104
+ static unauthorized(message?: string, hint?: string): HttpError;
105
+ static forbidden(message?: string, hint?: string): HttpError;
106
+ static notFound(message?: string, hint?: string): HttpError;
107
+ static tooManyRequests(message?: string, hint?: string): HttpError;
108
+ static internal(message?: string, hint?: string): HttpError;
109
+ }
110
+ /**
111
+ * Dependency missing errors
112
+ */
113
+ export declare class DependencyError extends BaraqexError {
114
+ readonly packageName: string;
115
+ constructor(packageName: string, feature: string);
116
+ }
117
+ /**
118
+ * Error handler for consistent error logging
119
+ */
120
+ export declare function formatError(error: unknown): string;
121
+ /**
122
+ * Wrap async functions with error handling
123
+ */
124
+ export declare function withErrorHandling<T extends (...args: any[]) => Promise<any>>(fn: T, errorHandler?: (error: Error) => void): T;
125
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAgB,aAAa,CAAC,EAAE,KAAK,CAAC;gBAE1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QACpC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;KACf;IAUD;;OAEG;IACH,MAAM,IAAI,MAAM;CAWjB;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,OAAO,EAAE,MAAM,EAAE,OA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,IAAI,GACpC,CAAC,CAaH"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Event Bus for cross-component communication
3
+ */
4
+ export type EventHandler = (...args: any[]) => void;
5
+ export interface EventBus {
6
+ on(event: string, handler: EventHandler): () => void;
7
+ once(event: string, handler: EventHandler): () => void;
8
+ off(event: string, handler?: EventHandler): void;
9
+ emit(event: string, ...args: any[]): void;
10
+ clear(event?: string): void;
11
+ }
12
+ /**
13
+ * Create a new event bus instance
14
+ */
15
+ export declare function createEventBus(): EventBus;
16
+ export declare const eventBus: EventBus;
17
+ /**
18
+ * Hook to subscribe to events in components
19
+ */
20
+ export declare function useEvent(event: string, handler: EventHandler, options?: {
21
+ once?: boolean;
22
+ }): () => void;
23
+ declare const _default: {
24
+ createEventBus: typeof createEventBus;
25
+ eventBus: EventBus;
26
+ useEvent: typeof useEvent;
27
+ };
28
+ export default _default;
29
+ //# sourceMappingURL=event-bus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../src/core/event-bus.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAEpD,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI,CAAC;IACrD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI,CAAC;IACvD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC1C,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAwEzC;AAGD,eAAO,MAAM,QAAQ,UAAmB,CAAC;AAEzC;;GAEG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,IAAI,CAIZ;;;;;;AAED,wBAIE"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Form handling utilities
3
+ */
4
+ export interface FormField {
5
+ value: any;
6
+ error?: string;
7
+ touched: boolean;
8
+ dirty: boolean;
9
+ }
10
+ export interface FormState {
11
+ fields: Record<string, FormField>;
12
+ isValid: boolean;
13
+ isDirty: boolean;
14
+ isSubmitting: boolean;
15
+ submitCount: number;
16
+ }
17
+ export interface ValidationRule {
18
+ required?: boolean | string;
19
+ minLength?: number | {
20
+ value: number;
21
+ message: string;
22
+ };
23
+ maxLength?: number | {
24
+ value: number;
25
+ message: string;
26
+ };
27
+ min?: number | {
28
+ value: number;
29
+ message: string;
30
+ };
31
+ max?: number | {
32
+ value: number;
33
+ message: string;
34
+ };
35
+ pattern?: RegExp | {
36
+ value: RegExp;
37
+ message: string;
38
+ };
39
+ validate?: (value: any, values: any) => string | undefined | boolean;
40
+ }
41
+ export interface FormOptions<T extends Record<string, any>> {
42
+ initialValues: T;
43
+ validate?: (values: T) => Record<string, string>;
44
+ validationRules?: Record<keyof T, ValidationRule>;
45
+ onSubmit?: (values: T, form: FormConfig<T>) => void | Promise<void>;
46
+ validateOnChange?: boolean;
47
+ validateOnBlur?: boolean;
48
+ }
49
+ export interface FormConfig<T extends Record<string, any>> {
50
+ values: T;
51
+ errors: Record<string, string>;
52
+ touched: Record<string, boolean>;
53
+ dirty: Record<string, boolean>;
54
+ isValid: boolean;
55
+ isDirty: boolean;
56
+ isSubmitting: boolean;
57
+ submitCount: number;
58
+ handleChange: (e: any) => void;
59
+ handleBlur: (e: any) => void;
60
+ handleSubmit: (e?: any) => Promise<void>;
61
+ setFieldValue: (field: keyof T, value: any) => void;
62
+ setFieldError: (field: keyof T, error: string) => void;
63
+ setFieldTouched: (field: keyof T, touched?: boolean) => void;
64
+ setValues: (values: Partial<T>) => void;
65
+ setErrors: (errors: Record<string, string>) => void;
66
+ resetForm: (nextValues?: Partial<T>) => void;
67
+ validateField: (field: keyof T) => string | undefined;
68
+ validateForm: () => Record<string, string>;
69
+ getFieldProps: (field: keyof T) => {
70
+ name: string;
71
+ value: any;
72
+ onChange: (e: any) => void;
73
+ onBlur: (e: any) => void;
74
+ };
75
+ register: (field: keyof T) => {
76
+ name: string;
77
+ value: any;
78
+ onChange: (e: any) => void;
79
+ onBlur: (e: any) => void;
80
+ };
81
+ }
82
+ /**
83
+ * useForm hook - comprehensive form state management
84
+ */
85
+ export declare function useForm<T extends Record<string, any>>(options: FormOptions<T>): FormConfig<T>;
86
+ /**
87
+ * useField hook - for individual field management
88
+ */
89
+ export declare function useField<T = any>(name: string, form: FormConfig<any>): {
90
+ field: {
91
+ name: string;
92
+ value: T;
93
+ onChange: (e: any) => void;
94
+ onBlur: (e: any) => void;
95
+ };
96
+ meta: {
97
+ touched: boolean;
98
+ error?: string;
99
+ dirty: boolean;
100
+ };
101
+ helpers: {
102
+ setValue: (value: T) => void;
103
+ setError: (error: string) => void;
104
+ setTouched: (touched: boolean) => void;
105
+ };
106
+ };
107
+ export declare const patterns: {
108
+ email: RegExp;
109
+ phone: RegExp;
110
+ url: RegExp;
111
+ alphanumeric: RegExp;
112
+ numeric: RegExp;
113
+ password: RegExp;
114
+ };
115
+ declare const _default: {
116
+ useForm: typeof useForm;
117
+ useField: typeof useField;
118
+ patterns: {
119
+ email: RegExp;
120
+ phone: RegExp;
121
+ url: RegExp;
122
+ alphanumeric: RegExp;
123
+ numeric: RegExp;
124
+ password: RegExp;
125
+ };
126
+ };
127
+ export default _default;
128
+ //# sourceMappingURL=forms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.d.ts","s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MAAM,EACZ,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,GACpB;IACD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;QAAC,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;KAAE,CAAC;IACxF,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3D,OAAO,EAAE;QAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;QAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,CAAC;CACtH,CAcA;AAGD,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAC;;;;;;;;;;;;;AAEF,wBAIE"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Hooks Implementation
3
+ *
4
+ * Each render root maintains its own isolated state via a RootState object.
5
+ * The module-level currentRoot/currentComponentId/hookIndex are set before
6
+ * each render call so hooks can find their data.
7
+ */
8
+ import { createContext, useContext } from './context.js';
9
+ export interface ComponentState {
10
+ states: any[];
11
+ effects: {
12
+ callback: () => void | (() => void);
13
+ deps?: any[];
14
+ cleanup?: () => void;
15
+ }[];
16
+ memos: {
17
+ value: any;
18
+ deps?: any[];
19
+ }[];
20
+ refs: {
21
+ current: any;
22
+ }[];
23
+ }
24
+ export interface RootState {
25
+ id: number;
26
+ components: Map<number, ComponentState>;
27
+ nextComponentId: number;
28
+ renderCallback: ((element: any, container: HTMLElement) => Promise<void>) | null;
29
+ container: HTMLElement | null;
30
+ currentElement: any;
31
+ }
32
+ export declare function createRootState(): RootState;
33
+ export declare function prepareRender(root?: RootState, componentId?: number): number;
34
+ export declare function finishRender(): void;
35
+ export declare function getCurrentRoot(): RootState | null;
36
+ export declare function setCurrentRoot(root: RootState | null): void;
37
+ export declare function getComponentState(root: RootState, compId: number): ComponentState;
38
+ export declare function setRenderCallback(callback: (element: any, container: HTMLElement) => Promise<void>, element: any, container: HTMLElement): void;
39
+ export declare function getCurrentRender(): number;
40
+ /**
41
+ * useState — manages component state
42
+ */
43
+ export declare function useState<T>(initial: T): [T, (newValue: T | ((prev: T) => T)) => void];
44
+ /**
45
+ * useEffect — handles side effects, runs after render
46
+ */
47
+ export declare function useEffect(callback: () => void | (() => void), deps?: any[]): void;
48
+ /**
49
+ * useLayoutEffect — runs synchronously after DOM mutations (client only)
50
+ */
51
+ export declare function useLayoutEffect(callback: () => void | (() => void), deps?: any[]): void;
52
+ /**
53
+ * useMemo — memoizes expensive computations
54
+ */
55
+ export declare function useMemo<T>(factory: () => T, deps?: any[]): T;
56
+ /**
57
+ * useCallback — memoizes callbacks
58
+ */
59
+ export declare function useCallback<T extends (...args: any[]) => any>(callback: T, deps: any[]): T;
60
+ /**
61
+ * useRef — creates a mutable ref object
62
+ */
63
+ export declare function useRef<T>(initial: T): {
64
+ current: T;
65
+ };
66
+ /**
67
+ * useReducer — manages complex state with a reducer
68
+ */
69
+ export declare function useReducer<S, A>(reducer: (state: S, action: A) => S, initialState: S): [S, (action: A) => void];
70
+ /**
71
+ * useErrorBoundary — catches errors in child components
72
+ */
73
+ export declare function useErrorBoundary(): [Error | null, () => void];
74
+ export declare function useId(): string;
75
+ /**
76
+ * Cleanup all hook state for a component within a root
77
+ */
78
+ export declare function cleanupHooks(root: RootState, compId: number): void;
79
+ /**
80
+ * Cleanup all state for an entire root
81
+ */
82
+ export declare function cleanupRoot(root: RootState): void;
83
+ export { createContext, useContext };
84
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/core/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,CAAC,EAC7B,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EACnC,YAAY,EAAE,CAAC,GACd,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC,CAQ1B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,MAAM,IAAI,CAAC,CAI7D;AAMD,wBAAgB,KAAK,IAAI,MAAM,CAM9B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAQlE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAOjD;AAGD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Baraqex Core — Standalone Frontend Framework
3
+ *
4
+ * A reactive framework with virtual DOM, hooks, SSR, and routing.
5
+ */
6
+ export { VNode, Component as ComponentType, FC, RefObject, Props, PropsWithChildren } from './types.js';
7
+ export { batchUpdates, getIsBatching } from './batch.js';
8
+ export { createContext, useContext, getContextValue, Context } from './context.js';
9
+ export { useState, useEffect, useMemo, useCallback, useRef, useReducer, useLayoutEffect, useErrorBoundary, useId, prepareRender, finishRender, cleanupHooks, cleanupRoot, createRootState, setCurrentRoot, getCurrentRoot, type RootState } from './hooks.js';
10
+ export { jsx, jsxs, jsxDEV, Fragment, createElement, createElementSync } from './jsx-runtime.js';
11
+ export { render, hydrate, createRoot, hasRoot } from './renderer.js';
12
+ export { renderToString, renderToStringWithData, renderToStream } from './server-renderer.js';
13
+ export { diff, shouldComponentUpdate, calculatePatches, applyPatches, Patch } from './vdom.js';
14
+ export { Component, PureComponent, createClassComponent } from './component.js';
15
+ export { createEventBus, eventBus, useEvent, EventBus } from './event-bus.js';
16
+ export { RouterProvider, Router, Route, Switch, Link, NavLink, Redirect, useRouter, useLocation, useParams, useNavigate, useSearchParams, useMatch, RouterContext } from './router.js';
17
+ export { useForm, useField, patterns, FormConfig, FormField, FormState, FormOptions, ValidationRule } from './forms.js';
18
+ export { createStore, combineReducers, StoreProvider, useSelector, useDispatch, useStore, logger, thunk, devTools, createAction, createSlice, StoreContext, Store, Action, Reducer, Dispatch, Selector, Middleware } from './store.js';
19
+ export { LifecycleEvents, emitAppInit, emitAppMounted, emitAppUpdated, emitAppError, emitAppDestroyed, emitComponentCreated, emitComponentMounted, emitComponentUpdated, emitComponentError, emitComponentUnmounted, emitRouterBeforeChange, emitRouterAfterChange, emitRouterError, emitStoreInitialized, emitStoreBeforeAction, emitStoreAfterAction, emitStoreError, onAppInit, onAppMounted, onAppUpdated, onAppError, onAppDestroyed, onComponentCreated, onComponentMounted, onComponentUpdated, onComponentError, onComponentUnmounted, onRouterBeforeChange, onRouterAfterChange, onRouterError, onStoreInitialized, onStoreBeforeAction, onStoreAfterAction, onStoreError } from './lifecycle-events.js';
20
+ export { debounce, throttle, deepClone, deepMerge, memoize, uuid, formatDate, shallowEqual, deepEqual, escapeHtml, unescapeHtml, capitalize, camelCase, kebabCase, sleep, retry, deferred, pick, omit, groupBy, isEmpty, clamp, get, set } from './utils.js';
21
+ export { BaraqexError, ConfigError, DatabaseError, AuthError, RouterError, WasmError, ValidationError, withErrorHandling } from './errors.js';
22
+ export * from './types.js';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,EACL,SAAS,IAAI,aAAa,EAC1B,EAAE,EACF,SAAS,EACT,KAAK,EACL,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,eAA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AY,EACZ,WAAW,EACX,YAAY,EACZ,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe,EACf,WAAW,EACX,cAAc,EACd,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACb,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,YAAY,EACZ,UAAU,EACV,SAAS,EACT,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,KAAK,EACL,GAAG,EACH,GAAG,EACJ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,aAAa,EACb,SAAS,EACT,WAAW,EACX,SAAS,EACT,eAAe,EACf,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAGrB,cAAc,YAAY,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * JSX Runtime — transforms JSX syntax into virtual DOM nodes
3
+ *
4
+ * jsx() and jsxs() produce VNode objects (universal).
5
+ * createElement() produces real DOM nodes (browser-only).
6
+ */
7
+ import { VNode } from './types.js';
8
+ /**
9
+ * Create a virtual DOM node from JSX
10
+ */
11
+ export declare function jsx(type: string | Function, props: any, key?: string | number): VNode;
12
+ /**
13
+ * JSX with static children (optimization for multiple children)
14
+ */
15
+ export declare const jsxs: typeof jsx;
16
+ /**
17
+ * JSX development version with additional debugging info
18
+ */
19
+ export declare function jsxDEV(type: string | Function, props: any, key?: string | number, _isStaticChildren?: boolean, _source?: any, _self?: any): VNode;
20
+ /**
21
+ * Fragment — renders children without a wrapper element
22
+ */
23
+ export declare const Fragment: ({ children }: {
24
+ children: any;
25
+ }) => any;
26
+ /**
27
+ * Create a DOM element from a virtual node (async for component support)
28
+ */
29
+ export declare function createElement(vnode: VNode | any): Promise<Node>;
30
+ /**
31
+ * Synchronous createElement (browser-only, no async component support)
32
+ */
33
+ export declare function createElementSync(vnode: VNode | any): Node;
34
+ declare const _default: {
35
+ jsx: typeof jsx;
36
+ jsxs: typeof jsx;
37
+ jsxDEV: typeof jsxDEV;
38
+ Fragment: ({ children }: {
39
+ children: any;
40
+ }) => any;
41
+ createElement: typeof createElement;
42
+ createElementSync: typeof createElementSync;
43
+ };
44
+ export default _default;
45
+ //# sourceMappingURL=jsx-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/core/jsx-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AASnC;;GAEG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAarF;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,YAAM,CAAC;AAExB;;GAEG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,GAAG,QAAQ,EACvB,KAAK,EAAE,GAAG,EACV,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EACrB,iBAAiB,CAAC,EAAE,OAAO,EAC3B,OAAO,CAAC,EAAE,GAAG,EACb,KAAK,CAAC,EAAE,GAAG,GACV,KAAK,CAEP;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,cAAc;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,QAAa,CAAC;AAqDtE;;GAEG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CA+DrE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,IAAI,CA6C1D;;;;;6BAzKsC;QAAE,QAAQ,EAAE,GAAG,CAAA;KAAE;;;;AA4KxD,wBAOE"}
@@ -0,0 +1,71 @@
1
+ export declare enum LifecycleEvents {
2
+ APP_INIT = "app:init",
3
+ APP_MOUNTED = "app:mounted",
4
+ APP_UPDATED = "app:updated",
5
+ APP_ERROR = "app:error",
6
+ APP_DESTROYED = "app:destroyed",
7
+ COMPONENT_CREATED = "component:created",
8
+ COMPONENT_MOUNTED = "component:mounted",
9
+ COMPONENT_UPDATED = "component:updated",
10
+ COMPONENT_ERROR = "component:error",
11
+ COMPONENT_UNMOUNTED = "component:unmounted",
12
+ ROUTER_BEFORE_CHANGE = "router:before-change",
13
+ ROUTER_AFTER_CHANGE = "router:after-change",
14
+ ROUTER_ERROR = "router:error",
15
+ STORE_INITIALIZED = "store:initialized",
16
+ STORE_BEFORE_ACTION = "store:before-action",
17
+ STORE_AFTER_ACTION = "store:after-action",
18
+ STORE_ERROR = "store:error"
19
+ }
20
+ export interface ComponentInfo {
21
+ id: string;
22
+ name: string;
23
+ props: Record<string, any>;
24
+ path?: string;
25
+ }
26
+ export interface RouteChangeInfo {
27
+ from: string;
28
+ to: string;
29
+ params: Record<string, string>;
30
+ }
31
+ export interface StoreActionInfo {
32
+ type: string;
33
+ payload: any;
34
+ prevState: any;
35
+ nextState: any;
36
+ }
37
+ export declare function emitAppInit(data: any): void;
38
+ export declare function emitAppMounted(rootElement: HTMLElement): void;
39
+ export declare function emitAppUpdated(): void;
40
+ export declare function emitAppError(error: Error): void;
41
+ export declare function emitAppDestroyed(): void;
42
+ export declare function emitComponentCreated(info: ComponentInfo): void;
43
+ export declare function emitComponentMounted(info: ComponentInfo, element: HTMLElement): void;
44
+ export declare function emitComponentUpdated(info: ComponentInfo, prevProps: Record<string, any>, newProps: Record<string, any>): void;
45
+ export declare function emitComponentError(info: ComponentInfo, error: Error): void;
46
+ export declare function emitComponentUnmounted(info: ComponentInfo): void;
47
+ export declare function emitRouterBeforeChange(info: RouteChangeInfo): Promise<boolean>;
48
+ export declare function emitRouterAfterChange(info: RouteChangeInfo): void;
49
+ export declare function emitRouterError(error: Error, info?: Partial<RouteChangeInfo>): void;
50
+ export declare function emitStoreInitialized(state: any): void;
51
+ export declare function emitStoreBeforeAction(actionType: string, payload: any, state: any): void;
52
+ export declare function emitStoreAfterAction(info: StoreActionInfo): void;
53
+ export declare function emitStoreError(error: Error, actionType: string, payload: any): void;
54
+ export declare function onAppInit(handler: (data: any) => void): () => void;
55
+ export declare function onAppMounted(handler: (rootElement: HTMLElement) => void): () => void;
56
+ export declare function onAppUpdated(handler: () => void): () => void;
57
+ export declare function onAppError(handler: (error: Error) => void): () => void;
58
+ export declare function onAppDestroyed(handler: () => void): () => void;
59
+ export declare function onComponentCreated(handler: (info: ComponentInfo) => void): () => void;
60
+ export declare function onComponentMounted(handler: (info: ComponentInfo, element: HTMLElement) => void): () => void;
61
+ export declare function onComponentUpdated(handler: (info: ComponentInfo, prevProps: Record<string, any>, newProps: Record<string, any>) => void): () => void;
62
+ export declare function onComponentError(handler: (info: ComponentInfo, error: Error) => void): () => void;
63
+ export declare function onComponentUnmounted(handler: (info: ComponentInfo) => void): () => void;
64
+ export declare function onRouterBeforeChange(handler: (info: RouteChangeInfo, prevent: () => void) => void): () => void;
65
+ export declare function onRouterAfterChange(handler: (info: RouteChangeInfo) => void): () => void;
66
+ export declare function onRouterError(handler: (error: Error, info?: Partial<RouteChangeInfo>) => void): () => void;
67
+ export declare function onStoreInitialized(handler: (state: any) => void): () => void;
68
+ export declare function onStoreBeforeAction(handler: (actionType: string, payload: any, state: any) => void): () => void;
69
+ export declare function onStoreAfterAction(handler: (info: StoreActionInfo) => void): () => void;
70
+ export declare function onStoreError(handler: (error: Error, actionType: string, payload: any) => void): () => void;
71
+ //# sourceMappingURL=lifecycle-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-events.d.ts","sourceRoot":"","sources":["../../src/core/lifecycle-events.ts"],"names":[],"mappings":"AAKA,oBAAY,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAE/B,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAE3C,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,YAAY,iBAAiB;IAE7B,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,WAAW,gBAAgB;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CA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AC,KAAK,IAAI,cAE7F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,cAE/D;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,cAElG;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,cAE1E;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,cAE7F"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Client-side renderer
3
+ *
4
+ * Each render call creates a RootState that holds all hook state for that
5
+ * render tree. The renderer tracks the previous VNode so we can diff on
6
+ * re-renders instead of tearing down the entire DOM.
7
+ */
8
+ import { VNode } from './types.js';
9
+ /**
10
+ * Render a virtual DOM tree into a container element.
11
+ */
12
+ export declare function render(element: VNode, container: HTMLElement): Promise<void>;
13
+ /**
14
+ * Hydrate server-rendered HTML.
15
+ *
16
+ * In this initial implementation, hydration re-renders the component tree
17
+ * and replaces the server HTML. A production implementation would walk the
18
+ * existing DOM, attach event listeners, and reconcile without full replace.
19
+ */
20
+ export declare function hydrate(element: VNode, container: HTMLElement): Promise<void>;
21
+ /**
22
+ * Create a root for React 18+ compatible API.
23
+ */
24
+ export declare function createRoot(container: HTMLElement): {
25
+ render: (element: VNode) => Promise<void>;
26
+ unmount: () => void;
27
+ };
28
+ /**
29
+ * Check if a container has an active root.
30
+ */
31
+ export declare function hasRoot(container: HTMLElement): boolean;
32
+ declare const _default: {
33
+ render: typeof render;
34
+ hydrate: typeof hydrate;
35
+ createRoot: typeof createRoot;
36
+ hasRoot: typeof hasRoot;
37
+ };
38
+ export default _default;
39
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/core/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAcnC;;GAEG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BlF;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,WAAW;sBAK3B,KAAK;;EAO1B;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAEvD;;;;;;;AAED,wBAKE"}