@resistdesign/voltra 3.0.0-alpha.4 → 3.0.0-alpha.40

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 (219) hide show
  1. package/README.md +379 -14
  2. package/api/DBX/DBXAsserts.d.ts +95 -0
  3. package/api/DBX/DBXRequest.d.ts +5 -0
  4. package/api/DBX/DBXRuntime.d.ts +5 -0
  5. package/api/DBX/DBXScenarioConfig.d.ts +9 -0
  6. package/api/DBX/DBXSeed.d.ts +124 -0
  7. package/api/DBX/DBXTypes.d.ts +176 -0
  8. package/api/DBX/index.d.ts +8 -0
  9. package/api/DataAccessControl.d.ts +220 -0
  10. package/api/Indexing/API.d.ts +224 -0
  11. package/api/Indexing/Cursor.d.ts +101 -0
  12. package/api/Indexing/Handler/Config.d.ts +39 -0
  13. package/api/Indexing/Handler.d.ts +166 -0
  14. package/api/Indexing/Trace.d.ts +54 -0
  15. package/api/Indexing/Types.d.ts +204 -0
  16. package/api/Indexing/ddb/AwsSdkV3Adapter.d.ts +8 -0
  17. package/api/Indexing/ddb/Types.d.ts +209 -0
  18. package/api/Indexing/docId.d.ts +27 -0
  19. package/api/Indexing/exact/ExactDdb.d.ts +58 -0
  20. package/api/Indexing/exact/ExactIndex.d.ts +90 -0
  21. package/api/Indexing/exact/ExactS3.d.ts +41 -0
  22. package/api/Indexing/fieldQualification.d.ts +12 -0
  23. package/api/Indexing/fulltext/FullTextDdbBackend.d.ts +212 -0
  24. package/api/Indexing/fulltext/FullTextMemoryBackend.d.ts +93 -0
  25. package/api/Indexing/fulltext/Schema.d.ts +164 -0
  26. package/api/Indexing/hashUniversal.d.ts +13 -0
  27. package/api/Indexing/index.d.ts +45 -0
  28. package/api/Indexing/lossy/LossyDdb.d.ts +43 -0
  29. package/api/Indexing/lossy/LossyIndex.d.ts +72 -0
  30. package/api/Indexing/lossy/LossyS3.d.ts +40 -0
  31. package/api/Indexing/rel/Cursor.d.ts +25 -0
  32. package/api/Indexing/rel/Handlers.d.ts +144 -0
  33. package/api/Indexing/rel/RelationalDdb.d.ts +169 -0
  34. package/api/Indexing/rel/RelationalInMemoryBackend.d.ts +38 -0
  35. package/api/Indexing/rel/Types.d.ts +69 -0
  36. package/api/Indexing/structured/Cursor.d.ts +26 -0
  37. package/api/Indexing/structured/Handlers.d.ts +128 -0
  38. package/api/Indexing/structured/SearchStructured.d.ts +44 -0
  39. package/api/Indexing/structured/StructuredDdb.d.ts +184 -0
  40. package/api/Indexing/structured/StructuredDdbBackend.d.ts +112 -0
  41. package/api/Indexing/structured/StructuredInMemoryBackend.d.ts +40 -0
  42. package/api/Indexing/structured/StructuredInMemoryIndex.d.ts +61 -0
  43. package/api/Indexing/structured/StructuredStringLike.d.ts +54 -0
  44. package/api/Indexing/structured/StructuredWriter.d.ts +74 -0
  45. package/api/Indexing/structured/Types.d.ts +126 -0
  46. package/api/Indexing/structured/index.d.ts +9 -0
  47. package/api/Indexing/tokenize.d.ts +31 -0
  48. package/api/ORM/DACUtils.d.ts +270 -0
  49. package/api/ORM/ListItemUtils.d.ts +40 -0
  50. package/api/ORM/ORMRouteMap.d.ts +55 -0
  51. package/api/ORM/TypeInfoORMService.d.ts +740 -0
  52. package/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +229 -0
  53. package/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +89 -0
  54. package/api/ORM/drivers/InMemoryDataItemDBDriver/ConfigTypes.d.ts +4 -0
  55. package/api/ORM/drivers/InMemoryDataItemDBDriver.d.ts +55 -0
  56. package/api/ORM/drivers/InMemoryFileItemDBDriver/ConfigTypes.d.ts +13 -0
  57. package/api/ORM/drivers/InMemoryFileItemDBDriver.d.ts +98 -0
  58. package/api/ORM/drivers/InMemoryItemRelationshipDBDriver.d.ts +16 -0
  59. package/api/ORM/drivers/IndexingRelationshipDriver.d.ts +123 -0
  60. package/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +322 -0
  61. package/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +118 -0
  62. package/api/ORM/drivers/S3FileItemDBDriver.d.ts +71 -0
  63. package/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +36 -0
  64. package/api/ORM/drivers/common/Types.d.ts +197 -0
  65. package/api/ORM/drivers/common/index.d.ts +2 -0
  66. package/api/ORM/drivers/index.d.ts +8 -0
  67. package/api/ORM/index.d.ts +9 -0
  68. package/api/ORM/indexing/criteriaToStructuredWhere.d.ts +22 -0
  69. package/api/Router/AWS.d.ts +80 -0
  70. package/api/Router/Auth.d.ts +14 -0
  71. package/api/Router/CORS.d.ts +66 -0
  72. package/api/Router/Types.d.ts +138 -0
  73. package/api/Router/index.d.ts +89 -0
  74. package/api/index.d.ts +72 -6
  75. package/api/index.js +3291 -1954
  76. package/app/forms/Engine.d.ts +23 -0
  77. package/app/forms/UI.d.ts +83 -0
  78. package/app/forms/core/createAutoField.d.ts +43 -0
  79. package/app/forms/core/createFormRenderer.d.ts +25 -0
  80. package/app/forms/core/getFieldKind.d.ts +14 -0
  81. package/app/forms/core/index.d.ts +11 -0
  82. package/app/forms/core/mergeSuites.d.ts +23 -0
  83. package/app/forms/core/resolveSuite.d.ts +15 -0
  84. package/app/forms/core/types.d.ts +180 -0
  85. package/app/forms/index.d.ts +9 -0
  86. package/app/forms/types.d.ts +137 -0
  87. package/app/helpers/styled.d.ts +3 -0
  88. package/app/index.d.ts +102 -5
  89. package/app/index.js +98 -327
  90. package/app/utils/ApplicationState.d.ts +167 -0
  91. package/app/utils/ApplicationStateLoader.d.ts +86 -0
  92. package/app/utils/Controller.d.ts +10 -0
  93. package/app/utils/Debug.d.ts +14 -0
  94. package/app/utils/EasyLayout.d.ts +89 -0
  95. package/app/utils/History.d.ts +165 -0
  96. package/app/utils/Route.d.ts +173 -0
  97. package/app/utils/RouteHistory.d.ts +27 -0
  98. package/app/utils/Service.d.ts +45 -0
  99. package/app/utils/TypeInfoORMAPIUtils.d.ts +94 -0
  100. package/app/utils/TypeInfoORMClient.d.ts +103 -0
  101. package/app/utils/UniversalRouteAdapter.d.ts +73 -0
  102. package/app/utils/easy-layout/computeAreaBounds.d.ts +5 -0
  103. package/app/utils/easy-layout/computeTracks.d.ts +16 -0
  104. package/app/utils/easy-layout/index.d.ts +5 -0
  105. package/app/utils/easy-layout/parseTemplate.d.ts +12 -0
  106. package/app/utils/easy-layout/types.d.ts +52 -0
  107. package/app/utils/easy-layout/validateAreas.d.ts +5 -0
  108. package/app/utils/index.d.ts +24 -0
  109. package/build/TypeMapping.d.ts +17 -0
  110. package/build/TypeParsing.d.ts +10 -0
  111. package/build/index.d.ts +15 -0
  112. package/build/index.js +569 -0
  113. package/chunk-2MOLWZMQ.js +71 -0
  114. package/chunk-7AMEFPPP.js +78 -0
  115. package/chunk-ATO2455Q.js +258 -0
  116. package/chunk-DT6WWJUI.js +1185 -0
  117. package/chunk-I2KLQ2HA.js +19 -0
  118. package/chunk-TJFTWPXQ.js +39 -0
  119. package/chunk-WNFRDIBW.js +121 -0
  120. package/chunk-YCTVEW2I.js +546 -0
  121. package/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +9 -0
  122. package/common/CommandLine/index.d.ts +6 -0
  123. package/common/HelperTypes.d.ts +9 -0
  124. package/common/IdGeneration/getSimpleId.d.ts +8 -0
  125. package/common/IdGeneration/index.d.ts +1 -0
  126. package/common/ItemRelationshipInfoTypes.d.ts +64 -0
  127. package/common/ItemRelationships/ItemRelationshipValidation.d.ts +21 -0
  128. package/common/ItemRelationships/index.d.ts +2 -0
  129. package/common/Logging/Utils.d.ts +10 -0
  130. package/common/Logging/index.d.ts +1 -0
  131. package/common/Routing.d.ts +81 -0
  132. package/common/SearchTypes.d.ts +227 -0
  133. package/common/SearchUtils.d.ts +55 -0
  134. package/common/SearchValidation.d.ts +27 -0
  135. package/common/StringTransformers.d.ts +28 -0
  136. package/common/Testing/CLI.d.ts +6 -0
  137. package/common/Testing/Types.d.ts +216 -0
  138. package/common/Testing/Utils.d.ts +112 -0
  139. package/common/Testing/index.d.ts +8 -0
  140. package/common/TypeInfoDataItemUtils.d.ts +39 -0
  141. package/{Types-C7XjUjoF.d.ts → common/TypeInfoORM/Types.d.ts} +117 -15
  142. package/common/TypeInfoORM/index.d.ts +3 -0
  143. package/common/TypeParsing/Constants.d.ts +4 -0
  144. package/common/TypeParsing/ParsingUtils/Constants.d.ts +8 -0
  145. package/common/TypeParsing/ParsingUtils/checkType.d.ts +14 -0
  146. package/common/TypeParsing/ParsingUtils/checkUnionType.d.ts +12 -0
  147. package/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +8 -0
  148. package/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +12 -0
  149. package/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +14 -0
  150. package/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +18 -0
  151. package/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +9 -0
  152. package/common/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +9 -0
  153. package/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +11 -0
  154. package/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +12 -0
  155. package/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +11 -0
  156. package/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +9 -0
  157. package/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +11 -0
  158. package/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +8 -0
  159. package/common/TypeParsing/TypeInfo.d.ts +222 -0
  160. package/common/TypeParsing/Utils.d.ts +47 -0
  161. package/common/TypeParsing/Validation.d.ts +327 -0
  162. package/common/TypeParsing/index.d.ts +8 -0
  163. package/common/index.d.ts +40 -4
  164. package/common/index.js +25 -1737
  165. package/{index-BkFZlfit.d.ts → iac/SimpleCFT.d.ts} +5 -25
  166. package/iac/index.d.ts +40 -2
  167. package/iac/index.js +2 -1661
  168. package/iac/packs/auth.d.ts +131 -0
  169. package/iac/packs/build/utils.d.ts +289 -0
  170. package/iac/packs/build.d.ts +92 -0
  171. package/iac/packs/cdn.d.ts +33 -0
  172. package/iac/packs/cloud-function.d.ts +67 -0
  173. package/iac/packs/database.d.ts +32 -0
  174. package/iac/packs/dns.d.ts +34 -0
  175. package/iac/packs/file-storage.d.ts +46 -0
  176. package/iac/packs/gateway.d.ts +82 -0
  177. package/iac/packs/index.d.ts +60 -1
  178. package/iac/packs/index.js +311 -566
  179. package/iac/packs/repo.d.ts +28 -0
  180. package/iac/packs/ssl-certificate.d.ts +28 -0
  181. package/iac/types/Constants.d.ts +24 -0
  182. package/{index-DcvJOZ_c.d.ts → iac/types/IaCTypes.d.ts} +23 -1018
  183. package/iac/types/Renderers.d.ts +96 -0
  184. package/iac/types/Types.d.ts +131 -0
  185. package/iac/types/Utils.d.ts +9 -0
  186. package/iac/types/generate.d.ts +1 -0
  187. package/iac/utils/index.d.ts +87 -0
  188. package/iac/utils/patch-utils.d.ts +66 -0
  189. package/iac-packs/index.d.ts +6 -0
  190. package/native/forms/UI.d.ts +73 -0
  191. package/native/forms/createNativeFormRenderer.d.ts +21 -0
  192. package/native/forms/index.d.ts +25 -0
  193. package/native/forms/primitives/index.d.ts +38 -0
  194. package/native/forms/suite.d.ts +15 -0
  195. package/native/index.d.ts +19 -0
  196. package/native/index.js +748 -0
  197. package/native/testing/react-native.d.ts +46 -0
  198. package/native/utils/EasyLayout.d.ts +88 -0
  199. package/native/utils/History.d.ts +102 -0
  200. package/native/utils/Route.d.ts +80 -0
  201. package/native/utils/index.d.ts +20 -0
  202. package/package.json +54 -21
  203. package/web/forms/UI.d.ts +74 -0
  204. package/web/forms/createWebFormRenderer.d.ts +21 -0
  205. package/web/forms/index.d.ts +9 -0
  206. package/web/forms/primitives/index.d.ts +21 -0
  207. package/web/forms/suite.d.ts +15 -0
  208. package/web/index.d.ts +15 -0
  209. package/web/index.js +668 -0
  210. package/web/utils/EasyLayout.d.ts +47 -0
  211. package/web/utils/Route.d.ts +16 -0
  212. package/web/utils/index.d.ts +7 -0
  213. package/SearchTypes-DjN6YQzE.d.ts +0 -577
  214. package/Validation-CFP59oIP.d.ts +0 -226
  215. package/index-C3-iD9Mh.d.ts +0 -690
  216. package/index-DZ2BB4iX.d.ts +0 -5357
  217. package/index-IokxSNxm.d.ts +0 -745
  218. package/index.d.ts +0 -13
  219. package/index.js +0 -10973
@@ -0,0 +1,173 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Render-agnostic routing helpers with nested Route contexts.
5
+ * Supply a RouteAdapter via RouteProvider or use root Route provider mode.
6
+ */
7
+ import { PropsWithChildren } from "react";
8
+ import { type UniversalRouteIngress } from "./UniversalRouteAdapter";
9
+ /**
10
+ * Platform adapter that supplies the current path and change notifications.
11
+ */
12
+ export type RouteAdapter = {
13
+ /** Read the current path. */
14
+ getPath: () => string;
15
+ /** Subscribe to path changes. */
16
+ subscribe: (listener: (path: string) => void) => () => void;
17
+ /**
18
+ * Optional navigation helper for adapters that can push state.
19
+ *
20
+ * `push`/`replace` paths are normalized through shared routing utils:
21
+ * absolute (`/x`), relative (`x`, `./x`, `../x`), and empty (`""` => `/`).
22
+ */
23
+ push?: (path: string, title?: string) => void;
24
+ /** Optional navigation helper for adapters that can replace state. */
25
+ replace?: (path: string, title?: string) => void;
26
+ /** Optional navigation helper for adapters that can go backward. */
27
+ back?: () => void;
28
+ /** Optional capability check for backward navigation. */
29
+ canGoBack?: () => boolean;
30
+ };
31
+ /**
32
+ * Optional runtime integration for root Route provider mode.
33
+ *
34
+ * Use this to layer platform-specific side effects (for example, native
35
+ * hardware back wiring) without coupling core app routing to a platform API.
36
+ */
37
+ export type RouteRuntimeIntegration = {
38
+ /**
39
+ * Start integration against the active adapter.
40
+ *
41
+ * Return a cleanup function when teardown is required.
42
+ */
43
+ setup: (adapter: RouteAdapter) => void | (() => void);
44
+ };
45
+ /**
46
+ * Supported query value types for route serialization.
47
+ */
48
+ export type RouteQueryValue = string | number | boolean | null | undefined | Array<string | number | boolean | null | undefined>;
49
+ /**
50
+ * Query string map for route serialization.
51
+ */
52
+ export type RouteQuery = Record<string, RouteQueryValue>;
53
+ /**
54
+ * Create a manual adapter for non-DOM runtimes (e.g., React Native).
55
+ *
56
+ * Call `updatePath` when navigation changes.
57
+ */
58
+ export declare const createManualRouteAdapter: (initialPath?: string) => {
59
+ adapter: RouteAdapter;
60
+ updatePath: (nextPath: string) => void;
61
+ };
62
+ /**
63
+ * Build a query string from a query object.
64
+ *
65
+ * @param query - Query string map.
66
+ * @returns Encoded query string without the leading `?`.
67
+ */
68
+ export declare const buildQueryString: (query?: RouteQuery) => string;
69
+ /**
70
+ * Build a path string from segments and optional query params.
71
+ *
72
+ * @param segments - Ordered route segments.
73
+ * @param query - Optional query parameters.
74
+ * @returns Path string with optional query string.
75
+ */
76
+ export declare const buildRoutePath: (segments: Array<string | number>, query?: RouteQuery) => string;
77
+ /**
78
+ * Access values for the current Route.
79
+ */
80
+ export type RouteContextType = {
81
+ /**
82
+ * Current window pathname (top-level) or inherited path (nested).
83
+ */
84
+ currentWindowPath: string;
85
+ /**
86
+ * The parent path for this route level.
87
+ */
88
+ parentPath: string;
89
+ /**
90
+ * Aggregated route params from parent and current routes.
91
+ */
92
+ params: Record<string, any>;
93
+ /**
94
+ * Whether this route is the top-level router.
95
+ */
96
+ isTopLevel: boolean;
97
+ /**
98
+ * Adapter driving route updates.
99
+ */
100
+ adapter?: RouteAdapter;
101
+ };
102
+ /**
103
+ * React context for route state and parameters.
104
+ */
105
+ export declare const RouteContext: import("react").Context<RouteContextType>;
106
+ export declare const RouteContextProvider: import("react").Provider<RouteContextType>, RouteContextConsumer: import("react").Consumer<RouteContextType>;
107
+ /**
108
+ * Access Route path and parameter information.
109
+ *
110
+ * @returns The current route context.
111
+ */
112
+ export declare const useRouteContext: () => RouteContextType;
113
+ /**
114
+ * Wrap a RouteAdapter so `push` and `replace` resolve relative paths.
115
+ *
116
+ * This preserves existing adapter behavior for subscriptions/back navigation,
117
+ * while normalizing path syntax consistently across web/native/app wrappers.
118
+ *
119
+ * @param adapter - RouteAdapter to normalize.
120
+ * @returns Adapter with relative-aware `push` and `replace`.
121
+ */
122
+ export declare const wrapRouteAdapterWithPathResolver: (adapter: RouteAdapter) => RouteAdapter;
123
+ /**
124
+ * RouteProvider props.
125
+ */
126
+ export type RouteProviderProps = PropsWithChildren<{
127
+ /** Adapter that supplies path updates. */
128
+ adapter: RouteAdapter;
129
+ /** Optional initial path override. */
130
+ initialPath?: string;
131
+ }>;
132
+ /**
133
+ * Provide a RouteAdapter to the routing context.
134
+ *
135
+ * @param props - Provider props with adapter and children.
136
+ */
137
+ export declare const RouteProvider: ({ adapter, initialPath, children, }: RouteProviderProps) => import("react/jsx-runtime").JSX.Element;
138
+ /**
139
+ * Configure the Route.
140
+ */
141
+ export type RouteProps<ParamsType extends Record<string, any>> = {
142
+ /**
143
+ * Route path pattern, using `:` for params.
144
+ */
145
+ path?: string;
146
+ /**
147
+ * Callback when params update for this route.
148
+ *
149
+ * @param params - Resolved params for this route.
150
+ */
151
+ onParamsChange?: (params: ParamsType) => void;
152
+ /**
153
+ * Require an exact match for the route path.
154
+ */
155
+ exact?: boolean;
156
+ /**
157
+ * Optional initial path override for root provider mode only.
158
+ */
159
+ initialPath?: string;
160
+ /**
161
+ * Optional adapter override for root provider mode only.
162
+ */
163
+ adapter?: RouteAdapter;
164
+ /**
165
+ * Optional external URL ingress for root provider mode only.
166
+ */
167
+ ingress?: UniversalRouteIngress;
168
+ /**
169
+ * Optional runtime integration hook for root provider mode only.
170
+ */
171
+ runtimeIntegration?: RouteRuntimeIntegration;
172
+ };
173
+ export declare const Route: <ParamsType extends Record<string, any>>(props: PropsWithChildren<RouteProps<ParamsType>>) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Bridge helpers between HistoryController and RouteAdapter.
5
+ */
6
+ import type { HistoryController } from "./History";
7
+ import type { RouteAdapter } from "./Route";
8
+ /**
9
+ * Create a RouteAdapter from a shared history controller.
10
+ *
11
+ * Route matching is path-based, so this adapter surfaces `location.path`
12
+ * (query/hash are intentionally omitted from Route context matching).
13
+ *
14
+ * Adapter navigation methods call history with `replaceSearch: true` so a
15
+ * path-only navigation does not accidentally retain a previous query string.
16
+ * Relative navigation input is resolved against the current history path.
17
+ *
18
+ * Example:
19
+ * ```ts
20
+ * const history = createMemoryHistory("/app/books/42?tab=summary");
21
+ * const adapter = createRouteAdapterFromHistory(history);
22
+ * adapter.push?.("/app/books/99");
23
+ * // history.location.path === "/app/books/99"
24
+ * // history.location.search === undefined
25
+ * ```
26
+ */
27
+ export declare const createRouteAdapterFromHistory: (history: HistoryController) => RouteAdapter;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The HTTP service configuration, including authorization, to be used for a service call.
3
+ * */
4
+ export type ServiceConfig = {
5
+ /**
6
+ * URL protocol (http or https).
7
+ * */
8
+ protocol: string;
9
+ /**
10
+ * Service domain or host.
11
+ * */
12
+ domain: string;
13
+ /**
14
+ * Optional port override.
15
+ * */
16
+ port?: number;
17
+ /**
18
+ * Base path to prefix all request paths.
19
+ * */
20
+ basePath?: string;
21
+ /**
22
+ * Bearer token for authorization.
23
+ * */
24
+ authorization?: string;
25
+ };
26
+ /**
27
+ * Build the full URL for a service call from config pieces.
28
+ *
29
+ * @param protocol - URL protocol (http or https).
30
+ * @param domain - Service domain or host.
31
+ * @param basePath - Base path to prefix all requests.
32
+ * @param path - Endpoint path to append.
33
+ * @param port - Optional port override.
34
+ * @returns Fully qualified URL string.
35
+ */
36
+ export declare const getFullUrl: (protocol: string, domain: string, basePath?: string, path?: string, port?: number) => string;
37
+ /**
38
+ * Send a POST request to a service endpoint with JSON arguments.
39
+ *
40
+ * @param config - Service configuration for the request.
41
+ * @param path - Endpoint path to call.
42
+ * @param args - JSON-serializable arguments to send.
43
+ * @returns Parsed JSON response.
44
+ */
45
+ export declare const sendServiceRequest: (config: ServiceConfig, path?: string, args?: any[]) => Promise<any>;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Hook utilities that wrap a {@link TypeInfoORMClientAPI} with request state
5
+ * tracking.
6
+ * Each method returns a request id and updates loading/data/error state per method.
7
+ */
8
+ import { TypeInfoORMClientAPI, TypeInfoORMServiceError } from "../../common/TypeInfoORM";
9
+ import type { ExpandComplexType } from "../../common/HelperTypes";
10
+ /**
11
+ * Sync request handler that returns a request id.
12
+ *
13
+ * @param args - Arguments for the API method.
14
+ * @returns Request id for tracking.
15
+ * */
16
+ export type SyncRequestHandler<ArgsType extends any[]> = (...args: ArgsType) => string;
17
+ /**
18
+ * Synchronous wrapper API that returns a request id for each method.
19
+ * */
20
+ export type TypeInfoORMServiceAPI = ExpandComplexType<{
21
+ [K in keyof TypeInfoORMClientAPI]: TypeInfoORMClientAPI[K] extends (...args: infer A) => Promise<any> ? SyncRequestHandler<A> : TypeInfoORMClientAPI[K];
22
+ }>;
23
+ /**
24
+ * Request state for a single TypeInfoORM API method.
25
+ * */
26
+ export type BaseTypeInfoORMAPIRequestState = {
27
+ /**
28
+ * Whether the request is currently loading.
29
+ * */
30
+ loading?: boolean;
31
+ /**
32
+ * Latest successful response data.
33
+ * */
34
+ data?: any;
35
+ /**
36
+ * Latest request error.
37
+ * */
38
+ error?: TypeInfoORMServiceError;
39
+ };
40
+ /**
41
+ * Request state plus tracking of active request ids.
42
+ * */
43
+ export type TypeInfoORMAPIRequestState = ExpandComplexType<BaseTypeInfoORMAPIRequestState & {
44
+ /**
45
+ * Active request ids for this method.
46
+ * */
47
+ activeRequests?: string[];
48
+ }>;
49
+ type RequestStateChangeHandler = (methodName: keyof TypeInfoORMClientAPI, requestId: string, requestState: BaseTypeInfoORMAPIRequestState) => void;
50
+ /**
51
+ * Request state keyed by TypeInfoORM API method.
52
+ */
53
+ export type TypeInfoORMAPIState = Partial<Record<keyof TypeInfoORMClientAPI, TypeInfoORMAPIRequestState>>;
54
+ /**
55
+ * Hook return shape for request state and wrapped API.
56
+ * */
57
+ export type TypeInfoORMAPIController = {
58
+ /**
59
+ * Request state keyed by method name.
60
+ * */
61
+ state: TypeInfoORMAPIState;
62
+ /**
63
+ * Wrapped API that returns request ids.
64
+ * */
65
+ api: TypeInfoORMServiceAPI;
66
+ };
67
+ /**
68
+ * Execute a request and emit request state changes.
69
+ *
70
+ * @param requestId - Unique id for this request.
71
+ * @param args - Arguments to pass to the API method.
72
+ * @param typeInfoORMAPI - API instance to call.
73
+ * @param methodName - Method name to invoke.
74
+ * @param onRequestStateChange - Handler for request state updates.
75
+ * @returns Promise resolved when request state is updated.
76
+ * */
77
+ export declare const handleRequest: (requestId: string, args: any[], typeInfoORMAPI: TypeInfoORMClientAPI, methodName: keyof TypeInfoORMClientAPI, onRequestStateChange: RequestStateChangeHandler) => Promise<void>;
78
+ /**
79
+ * Create a sync handler that dispatches async requests.
80
+ *
81
+ * @param typeInfoORMAPI - API instance to call.
82
+ * @param methodName - Method name to invoke.
83
+ * @param onRequestStateChange - Handler for request state updates.
84
+ * @returns Sync handler that returns a request id.
85
+ * */
86
+ export declare const requestHandlerFactory: (typeInfoORMAPI: TypeInfoORMClientAPI, methodName: keyof TypeInfoORMClientAPI, onRequestStateChange: RequestStateChangeHandler) => SyncRequestHandler<any>;
87
+ /**
88
+ * Wrap a TypeInfoORM API instance with request tracking state.
89
+ *
90
+ * @param typeInfoORMAPI - API instance to wrap.
91
+ * @returns Controller with request state and wrapped API methods.
92
+ * */
93
+ export declare const useTypeInfoORMAPI: (typeInfoORMAPI: TypeInfoORMClientAPI) => TypeInfoORMAPIController;
94
+ export {};
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Client wrapper around the TypeInfoORM API RouteMap. Uses ServiceConfig to
5
+ * route requests to the server-side TypeInfoORM routes.
6
+ */
7
+ import { DeleteRelationshipResults, TypeInfoORMClientAPI, TypeInfoORMAPIRoutePaths } from "../../common/TypeInfoORM";
8
+ import { ServiceConfig } from "./Service";
9
+ import { TypeInfoDataItem } from "../../common/TypeParsing/TypeInfo";
10
+ import { ListItemsConfig, ListItemsResults, ListRelationshipsConfig } from "../../common/SearchTypes";
11
+ import { BaseItemRelationshipInfo, ItemRelationshipInfo } from "../../common/ItemRelationshipInfoTypes";
12
+ /**
13
+ * Client implementation of the client-safe TypeInfoORMClientAPI contract.
14
+ *
15
+ * @param config - The configuration pointing to the Type Info ORM `RouteMap`.
16
+ * */
17
+ export declare class TypeInfoORMClient implements TypeInfoORMClientAPI {
18
+ private config;
19
+ /**
20
+ * Create a client for TypeInfoORM routes.
21
+ *
22
+ * @param config - Service configuration for the API routes.
23
+ */
24
+ constructor(config: ServiceConfig);
25
+ /**
26
+ * Dispatch a request to the configured service.
27
+ *
28
+ * @param path - Route path for the ORM method.
29
+ * @param args - Arguments to send in the request body.
30
+ * @returns Parsed response payload.
31
+ */
32
+ protected makeRequest: (path: TypeInfoORMAPIRoutePaths, args: any[]) => Promise<any>;
33
+ /**
34
+ * Create an item of the provided type.
35
+ *
36
+ * @param typeName - TypeInfo type name.
37
+ * @param item - Item payload to persist.
38
+ * @returns The created item result.
39
+ */
40
+ create: (typeName: string, item: TypeInfoDataItem) => Promise<any>;
41
+ /**
42
+ * Read an item by its primary field value.
43
+ *
44
+ * @param typeName - TypeInfo type name.
45
+ * @param primaryFieldValue - Primary field value to lookup.
46
+ * @returns The retrieved item, if found.
47
+ */
48
+ read: (typeName: string, primaryFieldValue: any, selectedFields?: (keyof TypeInfoDataItem)[]) => Promise<TypeInfoDataItem>;
49
+ /**
50
+ * Update an item by replacing it with the provided payload.
51
+ *
52
+ * @param typeName - TypeInfo type name.
53
+ * @param item - Updated item payload.
54
+ * @returns Whether the update succeeded.
55
+ */
56
+ update: (typeName: string, item: TypeInfoDataItem) => Promise<boolean>;
57
+ /**
58
+ * Delete an item by its primary field value.
59
+ *
60
+ * @param typeName - TypeInfo type name.
61
+ * @param primaryFieldValue - Primary field value to delete.
62
+ * @returns Whether the delete succeeded.
63
+ */
64
+ delete: (typeName: string, primaryFieldValue: any) => Promise<boolean>;
65
+ /**
66
+ * List items for a given type.
67
+ *
68
+ * @param typeName - TypeInfo type name.
69
+ * @param config - List configuration including filters and paging.
70
+ * @param selectedFields - Optional fields to project.
71
+ * @returns List results for the query.
72
+ */
73
+ list: (typeName: string, config: ListItemsConfig, selectedFields?: (keyof TypeInfoDataItem)[]) => Promise<ListItemsResults<TypeInfoDataItem>>;
74
+ /**
75
+ * Create a relationship between items.
76
+ *
77
+ * @param relationshipItem - Relationship payload.
78
+ * @returns Whether the relationship was created.
79
+ */
80
+ createRelationship: (relationshipItem: BaseItemRelationshipInfo) => Promise<boolean>;
81
+ /**
82
+ * Delete a relationship between items.
83
+ *
84
+ * @param relationshipItem - Relationship payload.
85
+ * @returns Results describing the deletion.
86
+ */
87
+ deleteRelationship: (relationshipItem: BaseItemRelationshipInfo) => Promise<DeleteRelationshipResults>;
88
+ /**
89
+ * List relationship records matching the query.
90
+ *
91
+ * @param config - Relationship list query configuration.
92
+ * @returns Relationship list results.
93
+ */
94
+ listRelationships: (config: ListRelationshipsConfig) => Promise<ListItemsResults<ItemRelationshipInfo>>;
95
+ /**
96
+ * List related items for a relationship query.
97
+ *
98
+ * @param config - Relationship list query configuration.
99
+ * @param selectedFields - Optional fields to project on related items.
100
+ * @returns Related item list results.
101
+ */
102
+ listRelatedItems: (config: ListRelationshipsConfig, selectedFields?: (keyof TypeInfoDataItem)[]) => Promise<ListItemsResults<Partial<TypeInfoDataItem>>>;
103
+ }
@@ -0,0 +1,73 @@
1
+ import type { RouteAdapter } from "./Route";
2
+ /**
3
+ * Runtime strategy for universal route adapters.
4
+ */
5
+ export type UniversalRouteStrategy = "auto" | "web" | "native";
6
+ /**
7
+ * Options for {@link createUniversalAdapter}.
8
+ */
9
+ export type CreateUniversalAdapterOptions = {
10
+ /**
11
+ * Runtime strategy selection.
12
+ *
13
+ * - `"auto"`: use web when DOM + History API exist, else native.
14
+ * - `"web"`: force browser history.
15
+ * - `"native"`: force in-memory history.
16
+ *
17
+ * Default: `"auto"`.
18
+ */
19
+ strategy?: UniversalRouteStrategy;
20
+ /**
21
+ * Initial path used by native strategy memory history.
22
+ *
23
+ * Default: `"/"`.
24
+ */
25
+ initialPath?: string;
26
+ /**
27
+ * Optional ingress hook for native strategy.
28
+ *
29
+ * Use this to bridge deep-link systems into the adapter.
30
+ */
31
+ ingress?: UniversalRouteIngress;
32
+ };
33
+ /**
34
+ * Ingress hook for applying external URLs/paths to native strategy.
35
+ */
36
+ export type UniversalRouteIngress = {
37
+ /**
38
+ * Optional initial URL/path provider.
39
+ */
40
+ getInitialURL?: () => Promise<string | null | undefined> | string | null | undefined;
41
+ /**
42
+ * Optional URL/path event subscription.
43
+ */
44
+ subscribe?: (listener: (url: string) => void) => () => void;
45
+ /**
46
+ * Incoming event application mode.
47
+ *
48
+ * Default: `"replace"`.
49
+ */
50
+ onIncomingURL?: "push" | "replace";
51
+ /**
52
+ * Optional mapper converting URL -> route path.
53
+ *
54
+ * Default maps using shared history path parsing.
55
+ */
56
+ mapURLToPath?: (url: string) => string;
57
+ };
58
+ /**
59
+ * Detect whether browser history is available at runtime.
60
+ */
61
+ export declare const canUseBrowserHistory: () => boolean;
62
+ /**
63
+ * Create a browser RouteAdapter backed by the History API.
64
+ */
65
+ export declare const createBrowserRouteAdapter: () => RouteAdapter;
66
+ /**
67
+ * Create an in-memory RouteAdapter for non-DOM runtimes.
68
+ */
69
+ export declare const createNativeRouteAdapter: (initialPath?: string, ingress?: UniversalRouteIngress) => RouteAdapter;
70
+ /**
71
+ * Create a runtime-selected RouteAdapter for web/native environments.
72
+ */
73
+ export declare const createUniversalAdapter: (options?: CreateUniversalAdapterOptions) => RouteAdapter;
@@ -0,0 +1,5 @@
1
+ import type { AreaBounds, EasyLayoutParsed } from "./types";
2
+ /**
3
+ * Compute 1-based row/column bounds for each area name.
4
+ */
5
+ export declare const computeAreaBounds: (parsed: EasyLayoutParsed) => Record<string, AreaBounds>;
@@ -0,0 +1,16 @@
1
+ import type { TrackSpec } from "./types";
2
+ /**
3
+ * Input for converting track specifications into pixels.
4
+ */
5
+ export type ComputeTrackPixelsInput = {
6
+ tracks: TrackSpec[];
7
+ totalPx: number;
8
+ gapPx?: number;
9
+ paddingPx?: number;
10
+ };
11
+ /**
12
+ * Compute pixel sizes for track specs.
13
+ *
14
+ * @category EasyLayout
15
+ */
16
+ export declare const computeTrackPixels: ({ tracks, totalPx, gapPx, paddingPx, }: ComputeTrackPixelsInput) => number[];
@@ -0,0 +1,5 @@
1
+ export * from "./computeAreaBounds";
2
+ export * from "./computeTracks";
3
+ export * from "./parseTemplate";
4
+ export * from "./types";
5
+ export * from "./validateAreas";
@@ -0,0 +1,12 @@
1
+ import type { EasyLayoutParsed, EasyLayoutTemplate } from "./types";
2
+ /**
3
+ * Parse an EasyLayout template into rows, tracks, and area names.
4
+ *
5
+ * @category EasyLayout
6
+ *
7
+ * Supported syntax:
8
+ * - row lines: `<area area ...>, <row-track>`
9
+ * - column line: `\\ <col-track> <col-track> ...`
10
+ * - row track is optional for parity with current behavior.
11
+ */
12
+ export declare const parseTemplate: (template?: EasyLayoutTemplate) => EasyLayoutParsed;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Shared EasyLayout core types.
5
+ */
6
+ /**
7
+ * Raw layout template input.
8
+ */
9
+ export type EasyLayoutTemplate = string;
10
+ /**
11
+ * Supported track units.
12
+ */
13
+ export type TrackUnit = {
14
+ kind: "fr";
15
+ value: number;
16
+ } | {
17
+ kind: "px";
18
+ value: number;
19
+ } | {
20
+ kind: "pct";
21
+ value: number;
22
+ };
23
+ /**
24
+ * Track specification for rows/columns.
25
+ */
26
+ export type TrackSpec = TrackUnit;
27
+ /**
28
+ * Parsed layout representation shared by web/native implementations.
29
+ */
30
+ export type EasyLayoutParsed = {
31
+ areaGrid: string[][];
32
+ rowTracks: TrackSpec[];
33
+ colTracks: TrackSpec[];
34
+ areaNames: string[];
35
+ };
36
+ /**
37
+ * 1-based area bounds in row/column space.
38
+ */
39
+ export type AreaBounds = {
40
+ name: string;
41
+ rowStart: number;
42
+ rowEnd: number;
43
+ colStart: number;
44
+ colEnd: number;
45
+ };
46
+ /**
47
+ * Shared core payload for parsed template + computed bounds.
48
+ */
49
+ export type EasyLayoutCore = {
50
+ parsed: EasyLayoutParsed;
51
+ bounds: Record<string, AreaBounds>;
52
+ };
@@ -0,0 +1,5 @@
1
+ import type { EasyLayoutParsed } from "./types";
2
+ /**
3
+ * Validate that each named area in the parsed grid is a rectangle.
4
+ */
5
+ export declare const validateAreas: (parsed: EasyLayoutParsed) => void;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Utility exports for app helpers. Import directly or via `app/Utils`:
5
+ * ```ts
6
+ * import { useRouteContext } from "./utils";
7
+ * // or
8
+ * import { Utils } from "../app";
9
+ * const { useRouteContext } = Utils;
10
+ * ```
11
+ */
12
+ export * from "./ApplicationState";
13
+ export * from "./ApplicationStateLoader";
14
+ export * from "./Controller";
15
+ export * from "./Debug";
16
+ export * from "./EasyLayout";
17
+ export * from "./easy-layout";
18
+ export * from "./History";
19
+ export * from "./Route";
20
+ export * from "./RouteHistory";
21
+ export * from "./UniversalRouteAdapter";
22
+ export * from "./Service";
23
+ export * from "./TypeInfoORMAPIUtils";
24
+ export * from "./TypeInfoORMClient";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * AST mapping helpers for extracting type aliases from TypeScript sources.
3
+ */
4
+ import { Node, TypeAliasDeclaration } from "typescript";
5
+ /**
6
+ * A map of type aliases in the TypeScript AST.
7
+ */
8
+ export type TypeMap = Record<string, TypeAliasDeclaration>;
9
+ /**
10
+ * Converts a TypeScript AST to a map of type aliases.
11
+ *
12
+ * @param node - AST node to traverse.
13
+ * @param map - Accumulator map of type aliases.
14
+ * @param parentName - Parent module name for nested namespaces.
15
+ * @returns Map of type alias declarations keyed by name.
16
+ */
17
+ export declare const convertASTToMap: (node: Node, map?: Record<string, TypeAliasDeclaration>, parentName?: string) => TypeMap;
@@ -0,0 +1,10 @@
1
+ import { TypeInfoMap } from "../common/TypeParsing/TypeInfo";
2
+ /**
3
+ * Extracts type information from TypeScript content.
4
+ *
5
+ * @category TypeInfo
6
+ *
7
+ * @param source - TypeScript source text to parse.
8
+ * @returns Map of exported type info definitions.
9
+ */
10
+ export declare const getTypeInfoMapFromTypeScript: (source: string) => TypeInfoMap;