@real-router/core 0.79.0 → 0.80.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 (338) hide show
  1. package/dist/cjs/Router-DGUed2F4.js +2 -0
  2. package/dist/cjs/{Router-BRuC-daj.js.map → Router-DGUed2F4.js.map} +1 -1
  3. package/dist/cjs/{Router-BG5yNYUG.d.ts → Router.d.ts} +5 -4
  4. package/dist/cjs/Router.d.ts.map +1 -0
  5. package/dist/cjs/Router.js +2 -0
  6. package/dist/cjs/Router.js.map +1 -0
  7. package/dist/cjs/RouterError.d.ts +182 -0
  8. package/dist/cjs/RouterError.d.ts.map +1 -0
  9. package/dist/cjs/RouterError.js +2 -0
  10. package/dist/cjs/RouterError.js.map +1 -0
  11. package/dist/cjs/api/cloneRouter.d.ts +86 -0
  12. package/dist/cjs/api/cloneRouter.d.ts.map +1 -0
  13. package/dist/cjs/api/cloneRouter.js +2 -0
  14. package/dist/cjs/api/cloneRouter.js.map +1 -0
  15. package/dist/cjs/api/getDependenciesApi.d.ts +7 -0
  16. package/dist/cjs/api/getDependenciesApi.d.ts.map +1 -0
  17. package/dist/cjs/api/getDependenciesApi.js +2 -0
  18. package/dist/cjs/api/getDependenciesApi.js.map +1 -0
  19. package/dist/cjs/api/getLifecycleApi.d.ts +7 -0
  20. package/dist/cjs/api/getLifecycleApi.d.ts.map +1 -0
  21. package/dist/cjs/api/getLifecycleApi.js +2 -0
  22. package/dist/cjs/api/getLifecycleApi.js.map +1 -0
  23. package/dist/cjs/api/getPluginApi.d.ts +7 -0
  24. package/dist/cjs/api/getPluginApi.d.ts.map +1 -0
  25. package/dist/cjs/api/getPluginApi.js +2 -0
  26. package/dist/cjs/api/getPluginApi.js.map +1 -0
  27. package/dist/cjs/api/getRoutesApi.d.ts +7 -0
  28. package/dist/cjs/api/getRoutesApi.d.ts.map +1 -0
  29. package/dist/cjs/api/getRoutesApi.js +2 -0
  30. package/dist/cjs/api/getRoutesApi.js.map +1 -0
  31. package/dist/cjs/api/helpers.js +2 -0
  32. package/dist/cjs/api/helpers.js.map +1 -0
  33. package/dist/cjs/api/types.d.ts +9 -0
  34. package/dist/cjs/api/types.d.ts.map +1 -0
  35. package/dist/cjs/api.d.ts +8 -105
  36. package/dist/cjs/api.js +1 -2
  37. package/dist/cjs/api.js.map +1 -1
  38. package/dist/cjs/buildParamMeta-DniluAIV.js.map +1 -1
  39. package/dist/cjs/constants.d.ts +25 -0
  40. package/dist/cjs/constants.d.ts.map +1 -0
  41. package/dist/cjs/constants.js +2 -0
  42. package/dist/cjs/constants.js.map +1 -0
  43. package/dist/cjs/createRouter.d.ts +23 -0
  44. package/dist/cjs/createRouter.d.ts.map +1 -0
  45. package/dist/cjs/createRouter.js +2 -0
  46. package/dist/cjs/createRouter.js.map +1 -0
  47. package/dist/cjs/engine/builder/buildTree.js +2 -0
  48. package/dist/cjs/engine/builder/buildTree.js.map +1 -0
  49. package/dist/cjs/engine/builder/computeCaches.js +2 -0
  50. package/dist/cjs/engine/builder/computeCaches.js.map +1 -0
  51. package/dist/cjs/engine/builder/createRouteTree.js +2 -0
  52. package/dist/cjs/engine/builder/createRouteTree.js.map +1 -0
  53. package/dist/cjs/engine/builder/types.d.ts +48 -0
  54. package/dist/cjs/engine/builder/types.d.ts.map +1 -0
  55. package/dist/cjs/engine/createMatcher.d.ts +29 -0
  56. package/dist/cjs/engine/createMatcher.d.ts.map +1 -0
  57. package/dist/cjs/engine/createMatcher.js +2 -0
  58. package/dist/cjs/engine/createMatcher.js.map +1 -0
  59. package/dist/cjs/engine/operations/routeTreeToDefinitions.js +2 -0
  60. package/dist/cjs/engine/operations/routeTreeToDefinitions.js.map +1 -0
  61. package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts +16 -0
  62. package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts.map +1 -0
  63. package/dist/cjs/engine/path-matcher/SegmentMatcher.js +2 -0
  64. package/dist/cjs/engine/path-matcher/SegmentMatcher.js.map +1 -0
  65. package/dist/cjs/engine/path-matcher/buildParamMeta.js +2 -0
  66. package/dist/cjs/engine/path-matcher/buildParamMeta.js.map +1 -0
  67. package/dist/cjs/engine/path-matcher/encoding.js +2 -0
  68. package/dist/cjs/engine/path-matcher/encoding.js.map +1 -0
  69. package/dist/cjs/engine/path-matcher/parseSegment.js +2 -0
  70. package/dist/cjs/engine/path-matcher/parseSegment.js.map +1 -0
  71. package/dist/cjs/engine/path-matcher/pathUtils.js +2 -0
  72. package/dist/cjs/engine/path-matcher/pathUtils.js.map +1 -0
  73. package/dist/cjs/engine/path-matcher/percentEncoding.js +2 -0
  74. package/dist/cjs/engine/path-matcher/percentEncoding.js.map +1 -0
  75. package/dist/cjs/engine/path-matcher/registration/buildParts.js +2 -0
  76. package/dist/cjs/engine/path-matcher/registration/buildParts.js.map +1 -0
  77. package/dist/cjs/engine/path-matcher/registration/context.js +2 -0
  78. package/dist/cjs/engine/path-matcher/registration/context.js.map +1 -0
  79. package/dist/cjs/engine/path-matcher/registration/errors.js +2 -0
  80. package/dist/cjs/engine/path-matcher/registration/errors.js.map +1 -0
  81. package/dist/cjs/engine/path-matcher/registration/index.js +2 -0
  82. package/dist/cjs/engine/path-matcher/registration/index.js.map +1 -0
  83. package/dist/cjs/engine/path-matcher/registration/trie.js +2 -0
  84. package/dist/cjs/engine/path-matcher/registration/trie.js.map +1 -0
  85. package/dist/cjs/engine/path-matcher/registration/trieNodes.js +2 -0
  86. package/dist/cjs/engine/path-matcher/registration/trieNodes.js.map +1 -0
  87. package/dist/cjs/{types-DaXCTxi1.d.ts → engine/path-matcher/types.d.ts} +2 -47
  88. package/dist/cjs/engine/path-matcher/types.d.ts.map +1 -0
  89. package/dist/cjs/engine/search-params/decode.js +2 -0
  90. package/dist/cjs/engine/search-params/decode.js.map +1 -0
  91. package/dist/cjs/engine/search-params/encode.js +2 -0
  92. package/dist/cjs/engine/search-params/encode.js.map +1 -0
  93. package/dist/cjs/engine/search-params/searchParams.js +2 -0
  94. package/dist/cjs/engine/search-params/searchParams.js.map +1 -0
  95. package/dist/cjs/engine/search-params/strategies/array.js +2 -0
  96. package/dist/cjs/engine/search-params/strategies/array.js.map +1 -0
  97. package/dist/cjs/engine/search-params/strategies/boolean.js +2 -0
  98. package/dist/cjs/engine/search-params/strategies/boolean.js.map +1 -0
  99. package/dist/cjs/engine/search-params/strategies/index.js +2 -0
  100. package/dist/cjs/engine/search-params/strategies/index.js.map +1 -0
  101. package/dist/cjs/engine/search-params/strategies/null.js +2 -0
  102. package/dist/cjs/engine/search-params/strategies/null.js.map +1 -0
  103. package/dist/cjs/engine/search-params/strategies/number.js +2 -0
  104. package/dist/cjs/engine/search-params/strategies/number.js.map +1 -0
  105. package/dist/cjs/engine/search-params/types.d.ts +72 -0
  106. package/dist/cjs/engine/search-params/types.d.ts.map +1 -0
  107. package/dist/cjs/engine/search-params/utils.js +2 -0
  108. package/dist/cjs/engine/search-params/utils.js.map +1 -0
  109. package/dist/cjs/engine/validation/route-batch.d.ts +38 -0
  110. package/dist/cjs/engine/validation/route-batch.d.ts.map +1 -0
  111. package/dist/cjs/engine/validation/route-batch.js +2 -0
  112. package/dist/cjs/engine/validation/route-batch.js.map +1 -0
  113. package/dist/cjs/engine/validation/routes.js +2 -0
  114. package/dist/cjs/engine/validation/routes.js.map +1 -0
  115. package/dist/cjs/foundation/event-emitter/EventEmitter.js +2 -0
  116. package/dist/cjs/foundation/event-emitter/EventEmitter.js.map +1 -0
  117. package/dist/cjs/foundation/fsm/fsm.js +2 -0
  118. package/dist/cjs/foundation/fsm/fsm.js.map +1 -0
  119. package/dist/cjs/foundation/logger/RouterLogger.js +2 -0
  120. package/dist/cjs/foundation/logger/RouterLogger.js.map +1 -0
  121. package/dist/cjs/foundation/logger/constants.js +2 -0
  122. package/dist/cjs/foundation/logger/constants.js.map +1 -0
  123. package/dist/cjs/getNavigator.d.ts +6 -0
  124. package/dist/cjs/getNavigator.d.ts.map +1 -0
  125. package/dist/cjs/getNavigator.js +2 -0
  126. package/dist/cjs/getNavigator.js.map +1 -0
  127. package/dist/cjs/guards.js +2 -0
  128. package/dist/cjs/guards.js.map +1 -0
  129. package/dist/cjs/helpers.js +2 -0
  130. package/dist/cjs/helpers.js.map +1 -0
  131. package/dist/cjs/index.d.ts +17 -239
  132. package/dist/cjs/index.js +1 -2
  133. package/dist/cjs/internals.d.ts +98 -0
  134. package/dist/cjs/internals.d.ts.map +1 -0
  135. package/dist/cjs/internals.js +2 -0
  136. package/dist/cjs/internals.js.map +1 -0
  137. package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.d.ts +10 -0
  138. package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.d.ts.map +1 -0
  139. package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.js +2 -0
  140. package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.js.map +1 -0
  141. package/dist/cjs/namespaces/EventBusNamespace/EventBusNamespace.js +2 -0
  142. package/dist/cjs/namespaces/EventBusNamespace/EventBusNamespace.js.map +1 -0
  143. package/dist/cjs/namespaces/NavigationNamespace/NavigationNamespace.js +2 -0
  144. package/dist/cjs/namespaces/NavigationNamespace/NavigationNamespace.js.map +1 -0
  145. package/dist/cjs/namespaces/NavigationNamespace/constants.js +2 -0
  146. package/dist/cjs/namespaces/NavigationNamespace/constants.js.map +1 -0
  147. package/dist/cjs/namespaces/NavigationNamespace/transition/completeTransition.js +2 -0
  148. package/dist/cjs/namespaces/NavigationNamespace/transition/completeTransition.js.map +1 -0
  149. package/dist/cjs/namespaces/NavigationNamespace/transition/errorHandling.js +2 -0
  150. package/dist/cjs/namespaces/NavigationNamespace/transition/errorHandling.js.map +1 -0
  151. package/dist/cjs/namespaces/NavigationNamespace/transition/guardPhase.js +2 -0
  152. package/dist/cjs/namespaces/NavigationNamespace/transition/guardPhase.js.map +1 -0
  153. package/dist/cjs/namespaces/OptionsNamespace/OptionsNamespace.js +2 -0
  154. package/dist/cjs/namespaces/OptionsNamespace/OptionsNamespace.js.map +1 -0
  155. package/dist/cjs/namespaces/OptionsNamespace/constants.js +2 -0
  156. package/dist/cjs/namespaces/OptionsNamespace/constants.js.map +1 -0
  157. package/dist/cjs/namespaces/OptionsNamespace/helpers.js +2 -0
  158. package/dist/cjs/namespaces/OptionsNamespace/helpers.js.map +1 -0
  159. package/dist/cjs/namespaces/OptionsNamespace/validators.js +2 -0
  160. package/dist/cjs/namespaces/OptionsNamespace/validators.js.map +1 -0
  161. package/dist/cjs/namespaces/PluginsNamespace/PluginsNamespace.js +2 -0
  162. package/dist/cjs/namespaces/PluginsNamespace/PluginsNamespace.js.map +1 -0
  163. package/dist/cjs/namespaces/PluginsNamespace/constants.js +2 -0
  164. package/dist/cjs/namespaces/PluginsNamespace/constants.js.map +1 -0
  165. package/dist/cjs/namespaces/PluginsNamespace/validators.js +2 -0
  166. package/dist/cjs/namespaces/PluginsNamespace/validators.js.map +1 -0
  167. package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts +174 -0
  168. package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts.map +1 -0
  169. package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.js +2 -0
  170. package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.js.map +1 -0
  171. package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts +17 -0
  172. package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts.map +1 -0
  173. package/dist/cjs/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.js +2 -0
  174. package/dist/cjs/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.js.map +1 -0
  175. package/dist/cjs/namespaces/RouterLifecycleNamespace/constants.js +2 -0
  176. package/dist/cjs/namespaces/RouterLifecycleNamespace/constants.js.map +1 -0
  177. package/dist/cjs/namespaces/RoutesNamespace/RoutesNamespace.js +2 -0
  178. package/dist/cjs/namespaces/RoutesNamespace/RoutesNamespace.js.map +1 -0
  179. package/dist/cjs/namespaces/RoutesNamespace/constants.js +2 -0
  180. package/dist/cjs/namespaces/RoutesNamespace/constants.js.map +1 -0
  181. package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts +5 -0
  182. package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts.map +1 -0
  183. package/dist/cjs/namespaces/RoutesNamespace/forwardChain.js +2 -0
  184. package/dist/cjs/namespaces/RoutesNamespace/forwardChain.js.map +1 -0
  185. package/dist/cjs/namespaces/RoutesNamespace/helpers.js +2 -0
  186. package/dist/cjs/namespaces/RoutesNamespace/helpers.js.map +1 -0
  187. package/dist/cjs/namespaces/RoutesNamespace/routeGuards.js +2 -0
  188. package/dist/cjs/namespaces/RoutesNamespace/routeGuards.js.map +1 -0
  189. package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts +42 -0
  190. package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts.map +1 -0
  191. package/dist/cjs/namespaces/RoutesNamespace/routesStore.js +2 -0
  192. package/dist/cjs/namespaces/RoutesNamespace/routesStore.js.map +1 -0
  193. package/dist/cjs/namespaces/RoutesNamespace/types.d.ts +57 -0
  194. package/dist/cjs/namespaces/RoutesNamespace/types.d.ts.map +1 -0
  195. package/dist/cjs/namespaces/StateNamespace/StateNamespace.js +2 -0
  196. package/dist/cjs/namespaces/StateNamespace/StateNamespace.js.map +1 -0
  197. package/dist/cjs/namespaces/StateNamespace/helpers.js +2 -0
  198. package/dist/cjs/namespaces/StateNamespace/helpers.js.map +1 -0
  199. package/dist/cjs/routerFSM.js +2 -0
  200. package/dist/cjs/routerFSM.js.map +1 -0
  201. package/dist/cjs/stateMetaStore.js +2 -0
  202. package/dist/cjs/stateMetaStore.js.map +1 -0
  203. package/dist/cjs/transitionPath.js +2 -0
  204. package/dist/cjs/transitionPath.js.map +1 -0
  205. package/dist/cjs/{RouterValidator-CZ8kPkrI.d.ts → types/RouterValidator.d.ts} +2 -2
  206. package/dist/cjs/types/RouterValidator.d.ts.map +1 -0
  207. package/dist/cjs/types/api.d.ts +184 -0
  208. package/dist/cjs/types/api.d.ts.map +1 -0
  209. package/dist/cjs/types/base.d.ts +95 -0
  210. package/dist/cjs/types/base.d.ts.map +1 -0
  211. package/dist/cjs/types/constants.d.ts +72 -0
  212. package/dist/cjs/types/constants.d.ts.map +1 -0
  213. package/dist/cjs/types/internal.d.ts +9 -0
  214. package/dist/cjs/types/internal.d.ts.map +1 -0
  215. package/dist/cjs/types/limits.d.ts +45 -0
  216. package/dist/cjs/types/limits.d.ts.map +1 -0
  217. package/dist/cjs/types/route-node-types.d.ts +46 -0
  218. package/dist/cjs/types/route-node-types.d.ts.map +1 -0
  219. package/dist/cjs/types/router.d.ts +313 -0
  220. package/dist/cjs/types/router.d.ts.map +1 -0
  221. package/dist/cjs/types/tree-changed.d.ts +55 -0
  222. package/dist/cjs/types/tree-changed.d.ts.map +1 -0
  223. package/dist/cjs/types.d.ts +208 -2
  224. package/dist/cjs/types.d.ts.map +1 -0
  225. package/dist/cjs/validation.d.ts +6 -518
  226. package/dist/cjs/validation.js +1 -2
  227. package/dist/cjs/wiring/wireNamespaces.js +2 -0
  228. package/dist/cjs/wiring/wireNamespaces.js.map +1 -0
  229. package/dist/esm/Router-Bk6PfSE8.mjs +2 -0
  230. package/dist/esm/{Router-DikzugaD.mjs.map → Router-Bk6PfSE8.mjs.map} +1 -1
  231. package/dist/esm/{Router-Cy75qbgU.d.mts → Router.d.mts} +5 -4
  232. package/dist/esm/Router.d.mts.map +1 -0
  233. package/dist/esm/RouterError.d.mts +182 -0
  234. package/dist/esm/RouterError.d.mts.map +1 -0
  235. package/dist/esm/api/cloneRouter.d.mts +86 -0
  236. package/dist/esm/api/cloneRouter.d.mts.map +1 -0
  237. package/dist/esm/api/getDependenciesApi.d.mts +7 -0
  238. package/dist/esm/api/getDependenciesApi.d.mts.map +1 -0
  239. package/dist/esm/api/getLifecycleApi.d.mts +7 -0
  240. package/dist/esm/api/getLifecycleApi.d.mts.map +1 -0
  241. package/dist/esm/api/getPluginApi.d.mts +7 -0
  242. package/dist/esm/api/getPluginApi.d.mts.map +1 -0
  243. package/dist/esm/api/getRoutesApi.d.mts +7 -0
  244. package/dist/esm/api/getRoutesApi.d.mts.map +1 -0
  245. package/dist/esm/api/types.d.mts +9 -0
  246. package/dist/esm/api/types.d.mts.map +1 -0
  247. package/dist/esm/api.d.mts +8 -105
  248. package/dist/esm/api.mjs +1 -1
  249. package/dist/esm/api.mjs.map +1 -1
  250. package/dist/esm/buildParamMeta-bOLhLF9h.mjs.map +1 -1
  251. package/dist/esm/constants.d.mts +25 -0
  252. package/dist/esm/constants.d.mts.map +1 -0
  253. package/dist/esm/createRouter.d.mts +23 -0
  254. package/dist/esm/createRouter.d.mts.map +1 -0
  255. package/dist/esm/engine/builder/types.d.mts +48 -0
  256. package/dist/esm/engine/builder/types.d.mts.map +1 -0
  257. package/dist/esm/engine/createMatcher.d.mts +29 -0
  258. package/dist/esm/engine/createMatcher.d.mts.map +1 -0
  259. package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts +16 -0
  260. package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts.map +1 -0
  261. package/dist/esm/{types-DaXCTxi1.d.mts → engine/path-matcher/types.d.mts} +2 -47
  262. package/dist/esm/engine/path-matcher/types.d.mts.map +1 -0
  263. package/dist/esm/engine/search-params/types.d.mts +72 -0
  264. package/dist/esm/engine/search-params/types.d.mts.map +1 -0
  265. package/dist/esm/engine/validation/route-batch.d.mts +38 -0
  266. package/dist/esm/engine/validation/route-batch.d.mts.map +1 -0
  267. package/dist/esm/getNavigator.d.mts +6 -0
  268. package/dist/esm/getNavigator.d.mts.map +1 -0
  269. package/dist/esm/index.d.mts +17 -239
  270. package/dist/esm/index.mjs +1 -1
  271. package/dist/esm/internals.d.mts +98 -0
  272. package/dist/esm/internals.d.mts.map +1 -0
  273. package/dist/esm/namespaces/DependenciesNamespace/dependenciesStore.d.mts +10 -0
  274. package/dist/esm/namespaces/DependenciesNamespace/dependenciesStore.d.mts.map +1 -0
  275. package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts +174 -0
  276. package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts.map +1 -0
  277. package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts +17 -0
  278. package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts.map +1 -0
  279. package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts +5 -0
  280. package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts.map +1 -0
  281. package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts +42 -0
  282. package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts.map +1 -0
  283. package/dist/esm/namespaces/RoutesNamespace/types.d.mts +57 -0
  284. package/dist/esm/namespaces/RoutesNamespace/types.d.mts.map +1 -0
  285. package/dist/esm/{RouterValidator-CZ8kPkrI.d.mts → types/RouterValidator.d.mts} +2 -2
  286. package/dist/esm/types/RouterValidator.d.mts.map +1 -0
  287. package/dist/esm/types/api.d.mts +184 -0
  288. package/dist/esm/types/api.d.mts.map +1 -0
  289. package/dist/esm/types/base.d.mts +95 -0
  290. package/dist/esm/types/base.d.mts.map +1 -0
  291. package/dist/esm/types/constants.d.mts +72 -0
  292. package/dist/esm/types/constants.d.mts.map +1 -0
  293. package/dist/esm/types/internal.d.mts +9 -0
  294. package/dist/esm/types/internal.d.mts.map +1 -0
  295. package/dist/esm/types/limits.d.mts +45 -0
  296. package/dist/esm/types/limits.d.mts.map +1 -0
  297. package/dist/esm/types/route-node-types.d.mts +46 -0
  298. package/dist/esm/types/route-node-types.d.mts.map +1 -0
  299. package/dist/esm/types/router.d.mts +313 -0
  300. package/dist/esm/types/router.d.mts.map +1 -0
  301. package/dist/esm/types/tree-changed.d.mts +55 -0
  302. package/dist/esm/types/tree-changed.d.mts.map +1 -0
  303. package/dist/esm/types.d.mts +208 -2
  304. package/dist/esm/types.d.mts.map +1 -0
  305. package/dist/esm/validation.d.mts +6 -518
  306. package/package.json +5 -14
  307. package/dist/cjs/Router-BG5yNYUG.d.ts.map +0 -1
  308. package/dist/cjs/Router-BRuC-daj.js +0 -2
  309. package/dist/cjs/RouterValidator-CZ8kPkrI.d.ts.map +0 -1
  310. package/dist/cjs/api.d.ts.map +0 -1
  311. package/dist/cjs/cloneRouter-3AOUeQ8M.js +0 -2
  312. package/dist/cjs/cloneRouter-3AOUeQ8M.js.map +0 -1
  313. package/dist/cjs/index-CAnGQpnz.d.ts +0 -974
  314. package/dist/cjs/index-CAnGQpnz.d.ts.map +0 -1
  315. package/dist/cjs/index-DDrryY2U.d.ts +0 -309
  316. package/dist/cjs/index-DDrryY2U.d.ts.map +0 -1
  317. package/dist/cjs/index.d.ts.map +0 -1
  318. package/dist/cjs/types-DaXCTxi1.d.ts.map +0 -1
  319. package/dist/cjs/utils.d.ts +0 -2
  320. package/dist/cjs/utils.js +0 -2
  321. package/dist/cjs/utils.js.map +0 -1
  322. package/dist/cjs/validation.d.ts.map +0 -1
  323. package/dist/esm/Router-Cy75qbgU.d.mts.map +0 -1
  324. package/dist/esm/Router-DikzugaD.mjs +0 -2
  325. package/dist/esm/RouterValidator-CZ8kPkrI.d.mts.map +0 -1
  326. package/dist/esm/api.d.mts.map +0 -1
  327. package/dist/esm/cloneRouter-CAh5vA3l.mjs +0 -2
  328. package/dist/esm/cloneRouter-CAh5vA3l.mjs.map +0 -1
  329. package/dist/esm/index-CAnGQpnz.d.mts +0 -974
  330. package/dist/esm/index-CAnGQpnz.d.mts.map +0 -1
  331. package/dist/esm/index-DnSU6huX.d.mts +0 -309
  332. package/dist/esm/index-DnSU6huX.d.mts.map +0 -1
  333. package/dist/esm/index.d.mts.map +0 -1
  334. package/dist/esm/types-DaXCTxi1.d.mts.map +0 -1
  335. package/dist/esm/utils.d.mts +0 -2
  336. package/dist/esm/utils.mjs +0 -2
  337. package/dist/esm/utils.mjs.map +0 -1
  338. package/dist/esm/validation.d.mts.map +0 -1
@@ -0,0 +1,29 @@
1
+ import { Options } from "./search-params/types.mjs";
2
+ import { SegmentMatcher } from "./path-matcher/SegmentMatcher.mjs";
3
+ //#region src/engine/createMatcher.d.ts
4
+ /**
5
+ * Query string formatting options.
6
+ *
7
+ * Controls how arrays, booleans, nulls, and numbers are serialized in query strings.
8
+ */
9
+ type QueryParamsConfig = Readonly<Options>;
10
+ /**
11
+ * Options for creating a path matcher.
12
+ */
13
+ interface CreateMatcherOptions {
14
+ readonly caseSensitive?: boolean;
15
+ readonly strictTrailingSlash?: boolean;
16
+ readonly strictQueryParams?: boolean;
17
+ readonly urlParamsEncoding?: "default" | "uri" | "uriComponent" | "none";
18
+ readonly queryParams?: QueryParamsConfig;
19
+ }
20
+ /**
21
+ * Path matcher instance type.
22
+ *
23
+ * Opaque type — consumers use methods (match, buildPath, hasRoute, etc.)
24
+ * without knowing the underlying SegmentMatcher implementation.
25
+ */
26
+ type Matcher = SegmentMatcher;
27
+ //#endregion
28
+ export { CreateMatcherOptions, Matcher, QueryParamsConfig };
29
+ //# sourceMappingURL=createMatcher.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMatcher.d.mts","names":[],"sources":["../../../src/engine/createMatcher.ts"],"mappings":";;;;;;;;KAwBY,oBAAoB,SAAS;;;;UAKxB;WACN;WACA;WACA;WACA;WACA,cAAc;;;;;;;;KASb,UAAU"}
@@ -0,0 +1,16 @@
1
+ import { BuildPathOptions, MatchResult, MatcherInputNode, ResolvedMatcherOptions, SegmentMatcherOptions } from "./types.mjs";
2
+ //#region src/engine/path-matcher/SegmentMatcher.d.ts
3
+ declare class SegmentMatcher {
4
+ #private;
5
+ get options(): ResolvedMatcherOptions;
6
+ constructor(options: SegmentMatcherOptions);
7
+ registerTree(node: MatcherInputNode): void;
8
+ match(path: string): MatchResult | undefined;
9
+ buildPath(name: string, params?: Record<string, unknown>, options?: BuildPathOptions): string;
10
+ getSegmentsByName(name: string): readonly MatcherInputNode[] | undefined;
11
+ getMetaByName(name: string): Readonly<Record<string, Record<string, "url" | "query">>> | undefined;
12
+ hasRoute(name: string): boolean;
13
+ }
14
+ //#endregion
15
+ export { SegmentMatcher };
16
+ //# sourceMappingURL=SegmentMatcher.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SegmentMatcher.d.mts","names":[],"sources":["../../../../src/engine/path-matcher/SegmentMatcher.ts"],"mappings":";;cA6Da;;MACP,WAAW;EA2BH,YAAA,SAAS;EAiBrB,aAAa,MAAM;EAiBnB,MAAM,eAAe;EAqDrB,UACE,cACA,SAAS,yBACT,UAAU;EAmBZ,kBAAkB,wBAAwB;EAO1C,cACE,eACC,SAAS,eAAe;EAI3B,SAAS"}
@@ -89,50 +89,5 @@ interface ResolvedMatcherOptions {
89
89
  readonly buildQueryString: (params: Record<string, unknown>) => string;
90
90
  }
91
91
  //#endregion
92
- //#region src/engine/builder/types.d.ts
93
- /**
94
- * Definition of a route for configuration.
95
- */
96
- interface RouteDefinition {
97
- [key: string]: unknown;
98
- name: string;
99
- path: string;
100
- children?: RouteDefinition[] | undefined;
101
- }
102
- /**
103
- * Immutable route tree node.
104
- *
105
- * This is the core data structure of the new route-tree architecture.
106
- * It contains only data (no methods) and is created by the builder.
107
- *
108
- * All caches are pre-computed at build time:
109
- * - nonAbsoluteChildren: filtered children without absolute paths
110
- * - fullName: pre-computed "users.profile" instead of runtime join
111
- */
112
- interface RouteTree {
113
- /** Route segment name (e.g., "users" in "users.profile") */
114
- readonly name: string;
115
- /** Route path pattern (e.g., "/users/:id") */
116
- readonly path: string;
117
- /** Whether this route uses absolute path matching (path starts with "~") */
118
- readonly absolute: boolean;
119
- /** Child route nodes (Map for O(1) lookup by name) */
120
- readonly children: ReadonlyMap<string, RouteTree>;
121
- /** Parameter metadata extracted from path pattern (replaces parser dependency) */
122
- readonly paramMeta: ParamMeta;
123
- /** Parent node (null for root) */
124
- readonly parent: RouteTree | null;
125
- /** Children without absolute paths (for regular matching) */
126
- readonly nonAbsoluteChildren: readonly RouteTree[];
127
- /** Pre-computed full name (e.g., "users.profile") */
128
- readonly fullName: string;
129
- /**
130
- * Pre-computed parameter type map for this segment.
131
- * Cached to avoid recomputing on every navigation.
132
- * Maps param name → "url" | "query".
133
- */
134
- readonly paramTypeMap: Readonly<Record<string, "url" | "query">>;
135
- }
136
- //#endregion
137
- export { MatcherInputNode as a, MatchResult as i, RouteTree as n, ResolvedMatcherOptions as o, BuildPathOptions as r, SegmentMatcherOptions as s, RouteDefinition as t };
138
- //# sourceMappingURL=types-DaXCTxi1.d.mts.map
92
+ export { BuildPathOptions, MatchResult, MatcherInputNode, ParamMeta, ResolvedMatcherOptions, SegmentMatcherOptions, URLParamsEncodingType };
93
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../../../src/engine/path-matcher/types.ts"],"mappings":";;;;;;;;;;;UAWiB;;;;;;WAMN;;;;;;WAOA;;;;;;WAOA;;;;;;WAOA,cAAc,SAAS;;;;;;WAOvB;;;;;;;;;;KAeC;UAMK;WACN;WACA;WACA;WACA;WACA,UAAU,oBAAoB;WAC9B,8BAA8B;WAC9B,WAAW;WACX,cAAc,SAAS;;;;;UAqCjB;WACN;WACA;;UA0BM;WACN,mBAAmB;WACnB,QAAQ,SAAS;WACjB,MAAM,SAAS,eAAe;;UAOxB;EACf;EACA;EACA;EACA,oBAAoB;EACpB,mBAAmB,wBAAwB;EAC3C,mBAAmB,QAAQ;;UAGZ;WACN;WACA;WACA;WACA,mBAAmB;WACnB,mBAAmB,wBAAwB;WAC3C,mBAAmB,QAAQ"}
@@ -0,0 +1,72 @@
1
+ //#region src/engine/search-params/types.d.ts
2
+ /**
3
+ * Search Params Type Definitions.
4
+ *
5
+ * Consolidated interfaces and type aliases for the search-params module.
6
+ *
7
+ * @module search-params/types
8
+ */
9
+ /**
10
+ * Array parameter encoding format.
11
+ *
12
+ * @remarks
13
+ * - `none` - repeated keys: `a=1&a=2`
14
+ * - `brackets` - bracket notation: `a[]=1&a[]=2`
15
+ * - `index` - indexed notation: `a[0]=1&a[1]=2`
16
+ * - `comma` - comma-separated: `a=1,2`
17
+ */
18
+ type ArrayFormat = "none" | "brackets" | "index" | "comma";
19
+ /**
20
+ * Boolean parameter encoding format.
21
+ *
22
+ * @remarks
23
+ * - `none` - no special handling
24
+ * - `auto` - auto-detect "true"/"false" strings as boolean values
25
+ * - `empty-true` - true values have no value: `?flag` instead of `?flag=true`
26
+ *
27
+ * @remarks
28
+ * Under `empty-true` the bare-key wire form (`?flag`) is reserved for `true`, so
29
+ * a `null` value with `nullFormat: "default"` (which also encodes to a bare key)
30
+ * is **not representable**: it round-trips back as `true`, not `null`. Both null
31
+ * and true collapse to the same token and only `true` decodes back. Pair
32
+ * `empty-true` with `nullFormat: "hidden"`, or avoid null query values.
33
+ */
34
+ type BooleanFormat = "none" | "auto" | "empty-true";
35
+ /**
36
+ * Null parameter encoding format.
37
+ *
38
+ * @remarks
39
+ * - `default` - key only: `?key` (collides with `booleanFormat: "empty-true"`,
40
+ * which reserves the bare-key form for `true` — null then decodes as `true`)
41
+ * - `hidden` - omit from query string
42
+ */
43
+ type NullFormat = "default" | "hidden";
44
+ /**
45
+ * Number parameter encoding format.
46
+ *
47
+ * @remarks
48
+ * - `none` - no special handling
49
+ * - `auto` - decode canonical decimal numbers (`/^-?(0|[1-9]\d*)(\.\d+)?$/`) to
50
+ * `Number()`. Recognizes negatives so the parsed type matches what
51
+ * `build`/`navigate` produce; rejects leading zeros (`"007"`), exponent
52
+ * notation, unsafe integers, and negative zero (`"-0"` — the grammar matches
53
+ * it, but an `Object.is` guard rejects it since `build(-0)` emits `"0"`, #898)
54
+ * — those keep their exact text as strings.
55
+ */
56
+ type NumberFormat = "none" | "auto";
57
+ /**
58
+ * Options for search-params parsing and building.
59
+ */
60
+ interface Options {
61
+ /** Array parameter encoding format. @default "none" */
62
+ arrayFormat?: ArrayFormat;
63
+ /** Boolean parameter encoding format. @default "auto" */
64
+ booleanFormat?: BooleanFormat;
65
+ /** Null parameter encoding format. @default "default" */
66
+ nullFormat?: NullFormat;
67
+ /** Number parameter encoding format. @default "auto" */
68
+ numberFormat?: NumberFormat;
69
+ }
70
+ //#endregion
71
+ export { ArrayFormat, BooleanFormat, NullFormat, NumberFormat, Options };
72
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../../../src/engine/search-params/types.ts"],"mappings":";;;;;;;;;;;;;;;;;KAqBY;;;;;;;;;;;;;;;;KAiBA;;;;;;;;;KAUA;;;;;;;;;;;;;KAcA;;;;UASK;;EAEf,cAAc;;EAEd,gBAAgB;;EAEhB,aAAa;;EAEb,eAAe"}
@@ -0,0 +1,38 @@
1
+ import { RouteDefinition, RouteTree } from "../builder/types.mjs";
2
+ //#region src/engine/validation/route-batch.d.ts
3
+ /**
4
+ * Validates route structure for add operations.
5
+ *
6
+ * Performs comprehensive validation including:
7
+ * - Type check (must be object)
8
+ * - Name validation
9
+ * - Path validation
10
+ * - Duplicate name detection (in tree and batch)
11
+ * - Duplicate path detection (in tree and batch)
12
+ * - Recursive children validation
13
+ *
14
+ * @param route - Route to validate
15
+ * @param methodName - Calling method for error context
16
+ * @param rootNode - Optional root node for duplicate checking
17
+ * @param parentName - Parent route name for building full path (used in recursion)
18
+ * @param seenNames - Set of names already seen in this batch
19
+ * @param seenPathsByParent - Map of paths by parent for path duplicate detection
20
+ * @throws {TypeError} If route structure is invalid
21
+ * @throws {Error} If route already exists (duplicate)
22
+ * @throws {Error} If path already defined (duplicate)
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const seenNames = new Set<string>();
27
+ * const seenPaths = new Map<string, Set<string>>();
28
+ *
29
+ * // Validate routes before adding
30
+ * for (const route of routes) {
31
+ * validateRoute(route, "add", rootNode, "", seenNames, seenPaths);
32
+ * }
33
+ * ```
34
+ */
35
+ declare function validateRoute(route: unknown, methodName: string, rootNode?: RouteTree, parentName?: string, seenNames?: Set<string>, seenPathsByParent?: Map<string, Set<string>>): asserts route is RouteDefinition;
36
+ //#endregion
37
+ export { validateRoute };
38
+ //# sourceMappingURL=route-batch.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-batch.d.mts","names":[],"sources":["../../../../src/engine/validation/route-batch.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0YgB,cACd,gBACA,oBACA,WAAW,WACX,qBACA,YAAY,aACZ,oBAAoB,YAAY,uBACvB,SAAS"}
@@ -0,0 +1,6 @@
1
+ import { DefaultDependencies, Navigator, Router } from "./types/router.mjs";
2
+ //#region src/getNavigator.d.ts
3
+ declare const getNavigator: <Dependencies extends DefaultDependencies = DefaultDependencies>(router: Router<Dependencies>) => Navigator;
4
+ //#endregion
5
+ export { getNavigator };
6
+ //# sourceMappingURL=getNavigator.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNavigator.d.mts","names":[],"sources":["../../src/getNavigator.ts"],"mappings":";;cAIa,eACX,qBAAqB,sBAAsB,qBAE3C,QAAQ,OAAO,kBACd"}
@@ -1,239 +1,17 @@
1
- import { n as RouteTree } from "./types-DaXCTxi1.mjs";
2
- import { $ as State, A as LeaveFn, B as PluginFactory, C as PluginMethod, D as ForwardToCallback, E as DefaultRouteCallback, F as LogLevelConfig, G as SubscribeFn, H as RouteConfigUpdate, I as LoggerConfig, J as LimitsConfig, K as SubscribeState, L as Navigator, M as Listener, N as LogCallback, O as GuardFn, P as LogLevel, Q as SimpleState, R as Options, S as EventsKeys, T as DefaultParamsCallback, U as Router$1, V as Route, W as RouterLogger, X as Params, Y as NavigationOptions, _ as ErrorCodeValues, a as LifecycleApi, at as Unsubscribe, b as EventToNameMap, c as TreeChangedAdd, ct as RouteParams, d as TreeChangedRemove, et as StateContext, f as TreeChangedReplace, g as ErrorCodeToValueMap, h as ErrorCodeKeys, i as InterceptorFn, it as TransitionReason, j as LeaveState, k as GuardFnFactory, l as TreeChangedClear, lt as RouteTreeState, m as TreeStructuralPatch, n as DependenciesApi, nt as TransitionMeta, o as PluginApi, ot as QueryParamsMode, p as TreeChangedUpdate, q as Subscription, r as InterceptableMethodMap, rt as TransitionPhase, s as RoutesApi, st as QueryParamsOptions, t as ContextNamespaceClaim, tt as StateMetaInput, u as TreeChangedEvent, v as EventMethodMap, w as DefaultDependencies, x as EventToPluginMap, y as EventName, z as Plugin } from "./index-CAnGQpnz.mjs";
3
- import { t as Router } from "./Router-Cy75qbgU.mjs";
4
- import { t as RouterValidator } from "./RouterValidator-CZ8kPkrI.mjs";
5
-
6
- //#region src/constants.d.ts
7
- type ConstantsKeys = "UNKNOWN_ROUTE";
8
- type Constants = Record<ConstantsKeys, string>;
9
- type ErrorCodes = Record<ErrorCodeKeys, ErrorCodeValues>;
10
- /**
11
- * Error codes for router operations.
12
- * Used to identify specific failure scenarios in navigation and lifecycle.
13
- * Frozen to prevent accidental modifications.
14
- */
15
- declare const errorCodes: ErrorCodeToValueMap;
16
- /**
17
- * General router constants.
18
- * Special route names and identifiers.
19
- */
20
- declare const UNKNOWN_ROUTE = "@@router/UNKNOWN_ROUTE";
21
- declare const constants: Constants;
22
- /**
23
- * Event names for router event system.
24
- * Used with addEventListener/removeEventListener for reactive subscriptions.
25
- */
26
- declare const events: EventToNameMap;
27
- //#endregion
28
- //#region src/RouterError.d.ts
29
- declare class RouterError extends Error {
30
- [key: string]: unknown;
31
- readonly segment: string | undefined;
32
- readonly path: string | undefined;
33
- code: string;
34
- /**
35
- * Creates a new RouterError instance.
36
- *
37
- * The options object accepts built-in fields (message, segment, path)
38
- * and any additional custom fields, which will all be attached to the error instance.
39
- *
40
- * @param code - The error code (e.g., "ROUTE_NOT_FOUND", "CANNOT_ACTIVATE")
41
- * @param options - Optional configuration object
42
- * @param options.message - Custom error message (defaults to code if not provided)
43
- * @param options.segment - The route segment where the error occurred
44
- * @param options.path - The full path where the error occurred
45
- *
46
- * @example
47
- * ```typescript
48
- * // Basic error
49
- * const err1 = new RouterError("ROUTE_NOT_FOUND");
50
- *
51
- * // Error with custom message
52
- * const err2 = new RouterError("ERR", { message: "Something went wrong" });
53
- *
54
- * // Error with context and custom fields
55
- * const err3 = new RouterError("CANNOT_ACTIVATE", {
56
- * message: "Insufficient permissions",
57
- * segment: "admin",
58
- * path: "/admin/users",
59
- * userId: "123" // custom field
60
- * });
61
- * ```
62
- */
63
- constructor(code: string, {
64
- message,
65
- segment,
66
- path,
67
- ...rest
68
- }?: {
69
- [key: string]: unknown;
70
- message?: string | undefined;
71
- segment?: string | undefined;
72
- path?: string | undefined;
73
- });
74
- /**
75
- * Updates the error code and conditionally updates the message.
76
- *
77
- * If the current message is one of the standard error code values
78
- * (e.g., "ROUTE_NOT_FOUND", "SAME_STATES"), it will be replaced with the new code.
79
- * This allows keeping error messages in sync with codes when using standard error codes.
80
- *
81
- * If the message is custom (not a standard error code), it will be preserved.
82
- *
83
- * @param newCode - The new error code to set
84
- *
85
- * @example
86
- * // Message follows code (standard error code as message)
87
- * const err = new RouterError("ROUTE_NOT_FOUND", { message: "ROUTE_NOT_FOUND" });
88
- * err.setCode("CUSTOM_ERROR"); // message becomes "CUSTOM_ERROR"
89
- *
90
- * @example
91
- * // Custom message is preserved
92
- * const err = new RouterError("ERR", { message: "Custom error message" });
93
- * err.setCode("NEW_CODE"); // message stays "Custom error message"
94
- */
95
- setCode(newCode: string): void;
96
- /**
97
- * Copies properties from another Error instance to this RouterError.
98
- *
99
- * This method updates the message, cause, and stack trace from the provided error.
100
- * Useful for wrapping native errors while preserving error context.
101
- *
102
- * @param err - The Error instance to copy properties from
103
- * @throws {TypeError} If err is null or undefined
104
- *
105
- * @example
106
- * ```typescript
107
- * const routerErr = new RouterError("TRANSITION_ERR");
108
- * try {
109
- * // some operation that might fail
110
- * } catch (nativeErr) {
111
- * routerErr.setErrorInstance(nativeErr);
112
- * throw routerErr;
113
- * }
114
- * ```
115
- */
116
- setErrorInstance(err: Error): void;
117
- /**
118
- * Adds custom fields to the error object.
119
- *
120
- * This method allows attaching arbitrary data to the error for debugging or logging purposes.
121
- * All fields become accessible as properties on the error instance and are included in JSON serialization.
122
- *
123
- * Reserved method names (setCode, setErrorInstance, setAdditionalFields, hasField, getField, toJSON)
124
- * are automatically filtered out to prevent accidental overwriting of class methods.
125
- *
126
- * @param fields - Object containing custom fields to add to the error
127
- *
128
- * @example
129
- * ```typescript
130
- * const err = new RouterError("CANNOT_ACTIVATE");
131
- * err.setAdditionalFields({
132
- * userId: "123",
133
- * attemptedRoute: "/admin",
134
- * reason: "insufficient permissions"
135
- * });
136
- *
137
- * console.log(err.userId); // "123"
138
- * console.log(JSON.stringify(err)); // includes all custom fields
139
- * ```
140
- */
141
- setAdditionalFields(fields: Record<string, unknown>): void;
142
- /**
143
- * Checks if a custom field exists on the error object.
144
- *
145
- * This method checks for both custom fields added via setAdditionalFields()
146
- * and built-in fields (code, message, segment, etc.).
147
- *
148
- * @param key - The field name to check
149
- * @returns `true` if the field exists, `false` otherwise
150
- *
151
- * @example
152
- * ```typescript
153
- * const err = new RouterError("ERR", { segment: "users" });
154
- * err.setAdditionalFields({ userId: "123" });
155
- *
156
- * err.hasField("userId"); // true
157
- * err.hasField("segment"); // true
158
- * err.hasField("unknown"); // false
159
- * ```
160
- */
161
- hasField(key: string): boolean;
162
- /**
163
- * Retrieves a custom field value from the error object.
164
- *
165
- * This method can access both custom fields and built-in fields.
166
- * Returns `undefined` if the field doesn't exist.
167
- *
168
- * @param key - The field name to retrieve
169
- * @returns The field value, or `undefined` if it doesn't exist
170
- *
171
- * @example
172
- * ```typescript
173
- * const err = new RouterError("ERR");
174
- * err.setAdditionalFields({ userId: "123", role: "admin" });
175
- *
176
- * err.getField("userId"); // "123"
177
- * err.getField("role"); // "admin"
178
- * err.getField("code"); // "ERR" (built-in field)
179
- * err.getField("unknown"); // undefined
180
- * ```
181
- */
182
- getField(key: string): unknown;
183
- /**
184
- * Serializes the error to a JSON-compatible object.
185
- *
186
- * This method is automatically called by JSON.stringify() and includes:
187
- * - Built-in fields: code, message, segment (if set), path (if set)
188
- * - All custom fields added via setAdditionalFields() or constructor
189
- * - Excludes: stack trace (for security/cleanliness)
190
- *
191
- * @returns A plain object representation of the error, suitable for JSON serialization
192
- *
193
- * @example
194
- * ```typescript
195
- * const err = new RouterError("ROUTE_NOT_FOUND", {
196
- * message: "Route not found",
197
- * path: "/admin/users/123"
198
- * });
199
- * err.setAdditionalFields({ userId: "123" });
200
- *
201
- * JSON.stringify(err);
202
- * // {
203
- * // "code": "ROUTE_NOT_FOUND",
204
- * // "message": "Route not found",
205
- * // "path": "/admin/users/123",
206
- * // "userId": "123"
207
- * // }
208
- * ```
209
- */
210
- toJSON(): Record<string, unknown>;
211
- }
212
- //#endregion
213
- //#region src/createRouter.d.ts
214
- /**
215
- * Creates a new router instance.
216
- *
217
- * @param routes - Array of route definitions
218
- * @param options - Router configuration options
219
- * @param dependencies - Dependencies to inject into the router
220
- * @returns A new Router instance
221
- *
222
- * @example
223
- * const router = createRouter([
224
- * { name: 'home', path: '/' },
225
- * { name: 'users', path: '/users' },
226
- * ]);
227
- *
228
- * router.start('/');
229
- */
230
- declare const createRouter: <Dependencies extends DefaultDependencies = DefaultDependencies>(routes?: Route<Dependencies>[], options?: Partial<Options>, dependencies?: Dependencies) => Router<Dependencies>;
231
- //#endregion
232
- //#region src/getNavigator.d.ts
233
- declare const getNavigator: <Dependencies extends DefaultDependencies = DefaultDependencies>(router: Router$1<Dependencies>) => Navigator;
234
- //#endregion
235
- //#region src/namespaces/RoutesNamespace/forwardChain.d.ts
236
- declare function resolveForwardChain(startRoute: string, forwardMap: Record<string, string>, maxDepth?: number): string;
237
- //#endregion
238
- export { type Constants, type ContextNamespaceClaim, type DefaultDependencies, type DefaultParamsCallback, type DefaultRouteCallback, type DependenciesApi, type ErrorCodeKeys, type ErrorCodeToValueMap, type ErrorCodeValues, type ErrorCodes, type EventMethodMap, type EventName, type EventToNameMap, type EventToPluginMap, type EventsKeys, type ForwardToCallback, type GuardFn, type GuardFnFactory, type InterceptableMethodMap, type InterceptorFn, type LeaveFn, type LeaveState, type LifecycleApi, type LimitsConfig, type Listener, type LogCallback, type LogLevel, type LogLevelConfig, type LoggerConfig, type NavigationOptions, type Navigator, type Options, type Params, type Plugin, type PluginApi, type PluginFactory, type PluginMethod, type QueryParamsMode, type QueryParamsOptions, type Route, type RouteConfigUpdate, type RouteParams, type RouteTree, type RouteTreeState, Router, RouterError, type RouterLogger, type RouterValidator, type RoutesApi, type SimpleState, type State, type StateContext, type StateMetaInput, type SubscribeFn, type SubscribeState, type Subscription, type TransitionMeta, type TransitionPhase, type TransitionReason, type TreeChangedAdd, type TreeChangedClear, type TreeChangedEvent, type TreeChangedRemove, type TreeChangedReplace, type TreeChangedUpdate, type TreeStructuralPatch, UNKNOWN_ROUTE, type Unsubscribe, constants, createRouter, errorCodes, events, getNavigator, resolveForwardChain };
239
- //# sourceMappingURL=index.d.mts.map
1
+ import { RouteTree } from "./engine/builder/types.mjs";
2
+ import { QueryParamsMode, QueryParamsOptions, RouteParams, RouteTreeState } from "./types/route-node-types.mjs";
3
+ import { Params, SerializedRouterState, SimpleState, State, StateMetaInput, TransitionMeta, TransitionPhase, TransitionReason, Unsubscribe } from "./types/base.mjs";
4
+ import { LimitsConfig } from "./types/limits.mjs";
5
+ import { DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, ForwardToCallback, GuardFn, GuardFnFactory, LeaveFn, LeaveState, Listener, LogCallback, LogLevel, LogLevelConfig, LoggerConfig, Navigator, Options, Plugin, PluginFactory, Route, RouteConfigUpdate, RouterLogger, SubscribeFn, SubscribeState, Subscription } from "./types/router.mjs";
6
+ import { ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, PluginMethod } from "./types/constants.mjs";
7
+ import { TreeChangedAdd, TreeChangedClear, TreeChangedEvent, TreeChangedRemove, TreeChangedReplace, TreeChangedUpdate, TreeStructuralPatch } from "./types/tree-changed.mjs";
8
+ import { ContextNamespaceClaim, DependenciesApi, InterceptableMethodMap, InterceptorFn, LifecycleApi, PluginApi, RoutesApi } from "./types/api.mjs";
9
+ import { NavigationOptions, StateContext } from "./types.mjs";
10
+ import { Router } from "./Router.mjs";
11
+ import { RouterValidator } from "./types/RouterValidator.mjs";
12
+ import { Constants, ErrorCodes, UNKNOWN_ROUTE, constants, errorCodes, events } from "./constants.mjs";
13
+ import { RouterError } from "./RouterError.mjs";
14
+ import { createRouter } from "./createRouter.mjs";
15
+ import { getNavigator } from "./getNavigator.mjs";
16
+ import { resolveForwardChain } from "./namespaces/RoutesNamespace/forwardChain.mjs";
17
+ export { type Constants, type ContextNamespaceClaim, type DefaultDependencies, type DefaultParamsCallback, type DefaultRouteCallback, type DependenciesApi, type ErrorCodeKeys, type ErrorCodeToValueMap, type ErrorCodeValues, type ErrorCodes, type EventMethodMap, type EventName, type EventToNameMap, type EventToPluginMap, type EventsKeys, type ForwardToCallback, type GuardFn, type GuardFnFactory, type InterceptableMethodMap, type InterceptorFn, type LeaveFn, type LeaveState, type LifecycleApi, type LimitsConfig, type Listener, type LogCallback, type LogLevel, type LogLevelConfig, type LoggerConfig, type NavigationOptions, type Navigator, type Options, type Params, type Plugin, type PluginApi, type PluginFactory, type PluginMethod, type QueryParamsMode, type QueryParamsOptions, type Route, type RouteConfigUpdate, type RouteParams, type RouteTree, type RouteTreeState, Router, RouterError, type RouterLogger, type RouterValidator, type RoutesApi, type SerializedRouterState, type SimpleState, type State, type StateContext, type StateMetaInput, type SubscribeFn, type SubscribeState, type Subscription, type TransitionMeta, type TransitionPhase, type TransitionReason, type TreeChangedAdd, type TreeChangedClear, type TreeChangedEvent, type TreeChangedRemove, type TreeChangedReplace, type TreeChangedUpdate, type TreeStructuralPatch, UNKNOWN_ROUTE, type Unsubscribe, constants, createRouter, errorCodes, events, getNavigator, resolveForwardChain };
@@ -1,2 +1,2 @@
1
- import{C as e,E as t,T as n,g as r,n as i,t as a,w as o}from"./Router-DikzugaD.mjs";const s=(e=[],t={},n={})=>new a(e,t,n),c=new WeakMap,l=e=>{let t=c.get(e);return t||(t=Object.freeze({navigate:e.navigate,getState:e.getState,isActiveRoute:e.isActiveRoute,canNavigateTo:e.canNavigateTo,subscribe:e.subscribe,subscribeLeave:e.subscribeLeave,isLeaveApproved:e.isLeaveApproved}),c.set(e,t)),t};export{a as Router,i as RouterError,e as UNKNOWN_ROUTE,o as constants,s as createRouter,n as errorCodes,t as events,l as getNavigator,r as resolveForwardChain};
1
+ import{C as e,E as t,T as n,g as r,n as i,t as a,w as o}from"./Router-Bk6PfSE8.mjs";const s=(e=[],t={},n={})=>new a(e,t,n),c=new WeakMap,l=e=>{let t=c.get(e);return t||(t=Object.freeze({navigate:e.navigate,getState:e.getState,isActiveRoute:e.isActiveRoute,canNavigateTo:e.canNavigateTo,subscribe:e.subscribe,subscribeLeave:e.subscribeLeave,isLeaveApproved:e.isLeaveApproved}),c.set(e,t)),t};export{a as Router,i as RouterError,e as UNKNOWN_ROUTE,o as constants,s as createRouter,n as errorCodes,t as events,l as getNavigator,r as resolveForwardChain};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,98 @@
1
+ import { RouteTree } from "./engine/builder/types.mjs";
2
+ import { RouteTreeState } from "./types/route-node-types.mjs";
3
+ import { Params, SerializedRouterState, SimpleState, State, Unsubscribe } from "./types/base.mjs";
4
+ import { DefaultDependencies, LoggerConfig, Options, Plugin, PluginFactory, Router, RouterLogger } from "./types/router.mjs";
5
+ import { EventMethodMap, EventName } from "./types/constants.mjs";
6
+ import { TreeChangedEvent } from "./types/tree-changed.mjs";
7
+ import { NavigationOptions } from "./types.mjs";
8
+ import { RouterValidator } from "./types/RouterValidator.mjs";
9
+ import { DependenciesStore } from "./namespaces/DependenciesNamespace/dependenciesStore.mjs";
10
+ import { RoutesStore } from "./namespaces/RoutesNamespace/routesStore.mjs";
11
+ //#region src/internals.d.ts
12
+ interface RouterInternals<D extends DefaultDependencies = DefaultDependencies> {
13
+ readonly makeState: <P extends Params = Params>(name: string, params?: P, path?: string, meta?: Record<string, Record<string, "url" | "query">>) => State<P>;
14
+ readonly forwardState: <P extends Params = Params>(routeName: string, routeParams: P) => SimpleState<P>;
15
+ readonly buildStateResolved: (resolvedName: string, resolvedParams: Params) => RouteTreeState | undefined;
16
+ readonly matchPath: <P extends Params = Params>(path: string, options?: Options) => State<P> | undefined;
17
+ readonly getOptions: () => Options;
18
+ readonly addEventListener: <E extends EventName>(eventName: E, cb: Plugin[EventMethodMap[E]]) => Unsubscribe;
19
+ /**
20
+ * Route-tree mutation channel — internal access for the `getRoutesApi`
21
+ * wrapper. A dedicated bridge is required because the public
22
+ * `addEventListener<E extends EventName>` structurally rejects
23
+ * `"TREE_CHANGED"` (it is not in the public `EventName` union), is strict on
24
+ * duplicates, and exposes neither `emit` nor `listenerCount`.
25
+ */
26
+ readonly treeChanged: {
27
+ readonly emit: (event: TreeChangedEvent) => void;
28
+ readonly subscribe: (handler: (event: TreeChangedEvent) => void) => Unsubscribe;
29
+ readonly listenerCount: () => number;
30
+ /**
31
+ * True while a `TREE_CHANGED` emit is on the stack — `getRoutesApi` reads it
32
+ * to reject reentrant route-CRUD from a `subscribeChanges` handler (#1032).
33
+ */
34
+ readonly isEmitting: () => boolean;
35
+ };
36
+ readonly buildPath: (route: string, params?: Params) => string;
37
+ readonly emitTransitionError: (error: Error) => void;
38
+ /**
39
+ * Emits `TRANSITION_SUCCESS` directly (no FSM transition) — used by
40
+ * `getRoutesApi().replace()` to notify `router.subscribe` listeners when a
41
+ * structural replace revalidates the active state (#950). Mirrors the success
42
+ * emission `completeTransition` / `navigateToNotFound` perform.
43
+ */
44
+ readonly emitTransitionSuccess: (toState: State, fromState: State | undefined, opts?: NavigationOptions) => void;
45
+ /**
46
+ * Commits the not-found (`UNKNOWN_ROUTE`) state for `path` and emits
47
+ * `TRANSITION_SUCCESS` — the `NavigationNamespace.navigateToNotFound`
48
+ * primitive. `replace()` uses it when a structural replace drops the active
49
+ * route, so subscribers are notified instead of the state silently clearing
50
+ * (#950).
51
+ */
52
+ readonly navigateToNotFound: (path: string) => State;
53
+ readonly start: (path: string) => Promise<State>;
54
+ /**
55
+ * Plugin-only navigation entry point — delegates to
56
+ * `NavigationNamespace.navigateToState` (`getPluginApi(router).navigateToState`).
57
+ * Hidden from `Router`/`Navigator` to keep the userland surface minimal;
58
+ * see `core-types/src/api.ts` for usage docs.
59
+ */
60
+ readonly navigateToState: (state: State, options?: NavigationOptions) => Promise<State>;
61
+ readonly interceptors: Map<string, ((next: (...args: any[]) => any, ...args: any[]) => any)[]>;
62
+ readonly setRootPath: (rootPath: string) => void;
63
+ readonly getRootPath: () => string;
64
+ readonly getTree: () => RouteTree;
65
+ readonly isDisposed: () => boolean;
66
+ validator: RouterValidator | null;
67
+ readonly logger: RouterLogger;
68
+ readonly dependenciesGetStore: () => DependenciesStore<D>;
69
+ readonly getCloneState: () => {
70
+ options: Options;
71
+ dependencies: Record<string, unknown>;
72
+ pluginFactories: PluginFactory<D>[];
73
+ loggerConfig: LoggerConfig;
74
+ };
75
+ readonly routeGetStore: () => RoutesStore<D>;
76
+ readonly getStateName: () => string | undefined;
77
+ readonly isTransitioning: () => boolean;
78
+ readonly clearState: () => void;
79
+ readonly setState: (state: State) => void;
80
+ readonly routerExtensions: {
81
+ keys: string[];
82
+ }[];
83
+ readonly contextClaimRecords: Set<string>;
84
+ /**
85
+ * One-shot hydration scratchpad populated by `hydrateRouter` immediately
86
+ * before delegating to `router.start(parsed.path)` and cleared in the
87
+ * matching `finally`. SSR loader plugins read this slot directly via
88
+ * `getInternals(router).hydrationState` to short-circuit their own loader
89
+ * call when the server-resolved namespace value is already present in the
90
+ * parsed state (#596). `null` outside of an active `hydrateRouter`
91
+ * invocation.
92
+ */
93
+ hydrationState: SerializedRouterState | null;
94
+ }
95
+ declare function getInternals<D extends DefaultDependencies>(router: Router<D>): RouterInternals<D>;
96
+ //#endregion
97
+ export { RouterInternals, getInternals };
98
+ //# sourceMappingURL=internals.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internals.d.mts","names":[],"sources":["../../src/internals.ts"],"mappings":";;;;;;;;;;;UAyBiB,gBACf,UAAU,sBAAsB;WAEvB,YAAY,UAAU,SAAS,QACtC,cACA,SAAS,GACT,eACA,OAAO,eAAe,qCACnB,MAAM;WAEF,eAAe,UAAU,SAAS,QACzC,mBACA,aAAa,MACV,YAAY;WAER,qBACP,sBACA,gBAAgB,WACb;WAEI,YAAY,UAAU,SAAS,QACtC,cACA,UAAU,YACP,MAAM;WAEF,kBAAkB;WAElB,mBAAmB,UAAU,WACpC,WAAW,GACX,IAAI,OAAO,eAAe,QACvB;;;;;;;;WASI;aACE,OAAO,OAAO;aACd,YACP,UAAU,OAAO,8BACd;aACI;;;;;aAKA;;WAGF,YAAY,eAAe,SAAS;WAEpC,sBAAsB,OAAO;;;;;;;WAQ7B,wBACP,SAAS,OACT,WAAW,mBACX,OAAO;;;;;;;;WAUA,qBAAqB,iBAAiB;WAEtC,QAAQ,iBAAiB,QAAQ;;;;;;;WAQjC,kBACP,OAAO,OACP,UAAU,sBACP,QAAQ;WAGJ,cAAc,cAEnB,UAAU,wBAAwB;WAI7B,cAAc;WACd;WAEA,eAAe;WAEf;EAET,WAAW;WAQF,QAAQ;WAGR,4BAA4B,kBAAkB;WAM9C;IACP,SAAS;IACT,cAAc;IACd,iBAAiB,cAAc;IAK/B,cAAc;;WAIP,qBAAqB,YAAY;WAGjC;WACA;WACA;WACA,WAAW,OAAO;WAClB;IAAoB;;WACpB,qBAAqB;;;;;;;;;;EAW9B,gBAAgB;;iBAMF,aAAa,UAAU,qBACrC,QAAQ,OAAgB,KACvB,gBAAgB"}
@@ -0,0 +1,10 @@
1
+ import { DefaultDependencies } from "../../types/router.mjs";
2
+ import { Limits } from "../../types/internal.mjs";
3
+ //#region src/namespaces/DependenciesNamespace/dependenciesStore.d.ts
4
+ interface DependenciesStore<Dependencies extends DefaultDependencies = DefaultDependencies> {
5
+ dependencies: Partial<Dependencies>;
6
+ limits: Limits;
7
+ }
8
+ //#endregion
9
+ export { DependenciesStore };
10
+ //# sourceMappingURL=dependenciesStore.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependenciesStore.d.mts","names":[],"sources":["../../../../src/namespaces/DependenciesNamespace/dependenciesStore.ts"],"mappings":";;;UAKiB,kBACf,qBAAqB,sBAAsB;EAE3C,cAAc,QAAQ;EACtB,QAAQ"}