@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
@@ -1,518 +1,6 @@
1
- import { a as MatcherInputNode, i as MatchResult, n as RouteTree, o as ResolvedMatcherOptions, r as BuildPathOptions, s as SegmentMatcherOptions, t as RouteDefinition } from "./types-DaXCTxi1.mjs";
2
- import { $ as State, B as PluginFactory, D as ForwardToCallback, I as LoggerConfig, J as LimitsConfig, O as GuardFn, Q as SimpleState, R as Options$1, U as Router, W as RouterLogger, X as Params, Y as NavigationOptions, at as Unsubscribe, k as GuardFnFactory, lt as RouteTreeState, u as TreeChangedEvent, v as EventMethodMap, w as DefaultDependencies, y as EventName, z as Plugin } from "./index-CAnGQpnz.mjs";
3
- import { t as RouterValidator } from "./RouterValidator-CZ8kPkrI.mjs";
4
- import { n as SerializedRouterState } from "./index-DnSU6huX.mjs";
5
-
6
- //#region src/engine/search-params/types.d.ts
7
- /**
8
- * Search Params Type Definitions.
9
- *
10
- * Consolidated interfaces and type aliases for the search-params module.
11
- *
12
- * @module search-params/types
13
- */
14
- /**
15
- * Array parameter encoding format.
16
- *
17
- * @remarks
18
- * - `none` - repeated keys: `a=1&a=2`
19
- * - `brackets` - bracket notation: `a[]=1&a[]=2`
20
- * - `index` - indexed notation: `a[0]=1&a[1]=2`
21
- * - `comma` - comma-separated: `a=1,2`
22
- */
23
- type ArrayFormat = "none" | "brackets" | "index" | "comma";
24
- /**
25
- * Boolean parameter encoding format.
26
- *
27
- * @remarks
28
- * - `none` - no special handling
29
- * - `auto` - auto-detect "true"/"false" strings as boolean values
30
- * - `empty-true` - true values have no value: `?flag` instead of `?flag=true`
31
- *
32
- * @remarks
33
- * Under `empty-true` the bare-key wire form (`?flag`) is reserved for `true`, so
34
- * a `null` value with `nullFormat: "default"` (which also encodes to a bare key)
35
- * is **not representable**: it round-trips back as `true`, not `null`. Both null
36
- * and true collapse to the same token and only `true` decodes back. Pair
37
- * `empty-true` with `nullFormat: "hidden"`, or avoid null query values.
38
- */
39
- type BooleanFormat = "none" | "auto" | "empty-true";
40
- /**
41
- * Null parameter encoding format.
42
- *
43
- * @remarks
44
- * - `default` - key only: `?key` (collides with `booleanFormat: "empty-true"`,
45
- * which reserves the bare-key form for `true` — null then decodes as `true`)
46
- * - `hidden` - omit from query string
47
- */
48
- type NullFormat = "default" | "hidden";
49
- /**
50
- * Number parameter encoding format.
51
- *
52
- * @remarks
53
- * - `none` - no special handling
54
- * - `auto` - decode canonical decimal numbers (`/^-?(0|[1-9]\d*)(\.\d+)?$/`) to
55
- * `Number()`. Recognizes negatives so the parsed type matches what
56
- * `build`/`navigate` produce; rejects leading zeros (`"007"`), exponent
57
- * notation, unsafe integers, and negative zero (`"-0"` — the grammar matches
58
- * it, but an `Object.is` guard rejects it since `build(-0)` emits `"0"`, #898)
59
- * — those keep their exact text as strings.
60
- */
61
- type NumberFormat = "none" | "auto";
62
- /**
63
- * Options for search-params parsing and building.
64
- */
65
- interface Options {
66
- /** Array parameter encoding format. @default "none" */
67
- arrayFormat?: ArrayFormat;
68
- /** Boolean parameter encoding format. @default "auto" */
69
- booleanFormat?: BooleanFormat;
70
- /** Null parameter encoding format. @default "default" */
71
- nullFormat?: NullFormat;
72
- /** Number parameter encoding format. @default "auto" */
73
- numberFormat?: NumberFormat;
74
- }
75
- //#endregion
76
- //#region src/engine/path-matcher/SegmentMatcher.d.ts
77
- declare class SegmentMatcher {
78
- #private;
79
- get options(): ResolvedMatcherOptions;
80
- constructor(options: SegmentMatcherOptions);
81
- registerTree(node: MatcherInputNode): void;
82
- match(path: string): MatchResult | undefined;
83
- buildPath(name: string, params?: Record<string, unknown>, options?: BuildPathOptions): string;
84
- getSegmentsByName(name: string): readonly MatcherInputNode[] | undefined;
85
- getMetaByName(name: string): Readonly<Record<string, Record<string, "url" | "query">>> | undefined;
86
- hasRoute(name: string): boolean;
87
- }
88
- //#endregion
89
- //#region src/engine/createMatcher.d.ts
90
- /**
91
- * Query string formatting options.
92
- *
93
- * Controls how arrays, booleans, nulls, and numbers are serialized in query strings.
94
- */
95
- type QueryParamsConfig = Readonly<Options>;
96
- /**
97
- * Options for creating a path matcher.
98
- */
99
- interface CreateMatcherOptions {
100
- readonly caseSensitive?: boolean;
101
- readonly strictTrailingSlash?: boolean;
102
- readonly strictQueryParams?: boolean;
103
- readonly urlParamsEncoding?: "default" | "uri" | "uriComponent" | "none";
104
- readonly queryParams?: QueryParamsConfig;
105
- }
106
- /**
107
- * Path matcher instance type.
108
- *
109
- * Opaque type — consumers use methods (match, buildPath, hasRoute, etc.)
110
- * without knowing the underlying SegmentMatcher implementation.
111
- */
112
- type Matcher = SegmentMatcher;
113
- //#endregion
114
- //#region src/engine/validation/route-batch.d.ts
115
- /**
116
- * Validates route structure for add operations.
117
- *
118
- * Performs comprehensive validation including:
119
- * - Type check (must be object)
120
- * - Name validation
121
- * - Path validation
122
- * - Duplicate name detection (in tree and batch)
123
- * - Duplicate path detection (in tree and batch)
124
- * - Recursive children validation
125
- *
126
- * @param route - Route to validate
127
- * @param methodName - Calling method for error context
128
- * @param rootNode - Optional root node for duplicate checking
129
- * @param parentName - Parent route name for building full path (used in recursion)
130
- * @param seenNames - Set of names already seen in this batch
131
- * @param seenPathsByParent - Map of paths by parent for path duplicate detection
132
- * @throws {TypeError} If route structure is invalid
133
- * @throws {Error} If route already exists (duplicate)
134
- * @throws {Error} If path already defined (duplicate)
135
- *
136
- * @example
137
- * ```typescript
138
- * const seenNames = new Set<string>();
139
- * const seenPaths = new Map<string, Set<string>>();
140
- *
141
- * // Validate routes before adding
142
- * for (const route of routes) {
143
- * validateRoute(route, "add", rootNode, "", seenNames, seenPaths);
144
- * }
145
- * ```
146
- */
147
- declare function validateRoute(route: unknown, methodName: string, rootNode?: RouteTree, parentName?: string, seenNames?: Set<string>, seenPathsByParent?: Map<string, Set<string>>): asserts route is RouteDefinition;
148
- //#endregion
149
- //#region src/types/internal.d.ts
150
- /**
151
- * Immutable limits configuration type.
152
- */
153
- type Limits = Readonly<LimitsConfig>;
154
- //#endregion
155
- //#region src/namespaces/DependenciesNamespace/dependenciesStore.d.ts
156
- interface DependenciesStore<Dependencies extends DefaultDependencies = DefaultDependencies> {
157
- dependencies: Partial<Dependencies>;
158
- limits: Limits;
159
- }
160
- //#endregion
161
- //#region src/namespaces/RouteLifecycleNamespace/types.d.ts
162
- interface RouteLifecycleDependencies<Dependencies extends DefaultDependencies = DefaultDependencies> {
163
- /** Per-router logger instance (from `getInternals(router).logger`) */
164
- logger: RouterLogger;
165
- compileFactory: (factory: GuardFnFactory<Dependencies>) => GuardFn;
166
- /**
167
- * Returns the opt-in DX validator, or `null` when no validation-plugin is
168
- * installed. A plain deps field (#1331) — internals are registered before
169
- * wiring, so `getInternals(router)` never throws and no try/catch is needed.
170
- */
171
- getValidator: () => RouterValidator | null;
172
- }
173
- //#endregion
174
- //#region src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts
175
- /**
176
- * Origin lane for a guard clear. Every `clearCanActivate` / `clearCanDeactivate`
177
- * caller names its lane — there is no origin-blind default — so a new call site
178
- * cannot silently wipe both the route-config and the external guard (#1171):
179
- *
180
- * - `"definition"` — clear only the route-config guard (`update(name, {…: null})`, #952).
181
- * - `"external"` — clear only the external, component-managed guard
182
- * (`removeXGuard()` and post-leave auto-cleanup — the inverse of `addXGuard()`).
183
- * - `"both"` — clear both (route removal / router teardown; the route is gone).
184
- */
185
- type GuardClearScope = "definition" | "external" | "both";
186
- /**
187
- * Source of truth for `canActivate` / `canDeactivate` guards.
188
- *
189
- * Storage is split by origin into four factory Maps (definition vs external,
190
- * each ×activate/deactivate); a single compiled-function Map per kind backs
191
- * navigation ("external wins" — when a route holds both a definition and an
192
- * external guard, the compiled guard is the external one, regardless of
193
- * registration order; #1174). `getFunctions()` returns a cached
194
- * `[deactivate, activate]` tuple for the hot path (stable reference, no
195
- * per-navigate allocation).
196
- *
197
- * All input validation is handled upstream by `getLifecycleApi` and
198
- * `getRoutesApi` — this class has no static methods.
199
- *
200
- * **Ordering convention.** Every paired surface lists **deactivate before
201
- * activate**: `getFunctions()` / `getFactories()` return `[deactivate,
202
- * activate]`, `getFactoriesByOrigin()` returns that tuple per origin, and
203
- * `canNavigateTo(toDeactivate, toActivate, …)` takes deactivate first. Keep
204
- * any new paired surface consistent with this order.
205
- */
206
- declare class RouteLifecycleNamespace<Dependencies extends DefaultDependencies = DefaultDependencies> {
207
- #private;
208
- setDependencies(deps: RouteLifecycleDependencies<Dependencies>): void;
209
- getHandlerCount(type: "activate" | "deactivate"): number;
210
- /**
211
- * Pre-flights the #961 handler-limit `RangeError` into the route-CRUD PREPARE
212
- * phase (#1046). `#registerHandler`'s per-slot limit check throws AFTER the
213
- * tree/config swap, so `add`/`replace`/`update` tore post-commit when the
214
- * validator was installed and the per-type count was at `maxLifecycleHandlers`.
215
- * Running the same check here — before any store mutation — restores atomicity
216
- * (#951/#956/#698): a batch that would exceed the limit aborts before a single
217
- * write.
218
- *
219
- * Only NEW slots count (an overwrite leaves the union count unchanged, mirroring
220
- * `#registerHandler`). For `replace` (`clearsDefinition = true`) the definition
221
- * guards are about to be cleared, so the projection runs against the surviving
222
- * EXTERNAL guards only — exactly the post-clear state the install loop sees.
223
- * Plugin-gated: a no-op without the validator (the limit is opt-in).
224
- *
225
- * @param activateNames - route names a `canActivate` would be registered for
226
- * @param deactivateNames - route names a `canDeactivate` would be registered for
227
- * @param clearsDefinition - true for `replace` (definition guards cleared first)
228
- */
229
- preflightHandlerLimit(activateNames: Iterable<string>, deactivateNames: Iterable<string>, clearsDefinition: boolean): void;
230
- /**
231
- * Adds a canActivate guard for a route.
232
- *
233
- * @param name - Route name (input-validated by facade)
234
- * @param handler - Guard function or boolean (input-validated by facade)
235
- * @param isFromDefinition - True when guard comes from route definition
236
- * (lands in the definition Map; subject to `clearDefinitionGuards()`).
237
- * False (default) when added via `getLifecycleApi().addActivateGuard(...)`
238
- * (lands in the external Map; survives `replace()`).
239
- *
240
- * External wins at runtime (#1174): when a route holds both a definition and
241
- * an external guard, the compiled function is the external one, regardless of
242
- * registration order. Within one origin the most recent add overwrites. Origin
243
- * determines which Map the factory is filed under (relevant for
244
- * `clearDefinitionGuards()` and `cloneRouter` re-registration).
245
- */
246
- addCanActivate(name: string, handler: GuardFnFactory<Dependencies> | boolean, isFromDefinition?: boolean, precompiledFn?: GuardFn): void;
247
- /**
248
- * Adds a canDeactivate guard for a route.
249
- *
250
- * Symmetric counterpart to {@link addCanActivate}.
251
- */
252
- addCanDeactivate(name: string, handler: GuardFnFactory<Dependencies> | boolean, isFromDefinition?: boolean, precompiledFn?: GuardFn): void;
253
- /**
254
- * Removes a canActivate guard for a route. `scope` names the origin lane
255
- * (see {@link GuardClearScope}) — there is no origin-blind default, so every
256
- * caller commits to a lane and a new call site cannot silently clear both.
257
- * Delegates to {@link #clearGuard} (mirrors the add side's `#registerHandler`).
258
- *
259
- * @param name - Route name (already validated by facade)
260
- * @param scope - Which origin(s) to clear: `"definition"` / `"external"` / `"both"`
261
- */
262
- clearCanActivate(name: string, scope: GuardClearScope): void;
263
- /**
264
- * Removes a canDeactivate guard for a route. Symmetric counterpart to
265
- * {@link clearCanActivate}.
266
- *
267
- * The `"external"` lane is what makes a route-config `canDeactivate` durable:
268
- * post-leave auto-cleanup (`completeTransition`) and `removeDeactivateGuard()`
269
- * unregister only the external, component-managed guard (router5 mount/unmount
270
- * heritage), while a definition guard survives for re-entry — symmetric with
271
- * definition `canActivate`, which lives as long as the route is in the tree
272
- * (#1171). Clearing both by default made a config guard one-shot: the first
273
- * permitted leave erased it, so re-entry was unguarded, `getRoutesApi().get()`
274
- * lost the field, and a clone taken after the leave never received it
275
- * (clone invariant #6).
276
- *
277
- * @param name - Route name (already validated by facade)
278
- * @param scope - Which origin(s) to clear: `"definition"` / `"external"` / `"both"`
279
- */
280
- clearCanDeactivate(name: string, scope: GuardClearScope): void;
281
- /**
282
- * Clears all lifecycle handlers (canActivate and canDeactivate).
283
- * Used by clearRoutes to reset all lifecycle state.
284
- */
285
- clearAll(): void;
286
- /**
287
- * Clears only lifecycle handlers that were registered from route definitions.
288
- * Used by HMR `replace()` to remove definition-sourced guards without
289
- * touching externally-added guards.
290
- *
291
- * For a slot where BOTH a definition and an external guard exist, the external
292
- * factory survives — and the compiled function is RECOMPILED from it (#1192).
293
- * Under external-wins (#1174) the compiled slot is already the external guard,
294
- * so this recompile is idempotent — it re-derives the surviving external factory
295
- * through the same choke point that keeps clearing correct (and stays robust if
296
- * the compiled slot were ever out of sync). For a definition-only slot, the
297
- * compiled function is dropped.
298
- */
299
- clearDefinitionGuards(): void;
300
- /**
301
- * Returns lifecycle factories as a flat `[deactivate, activate]` tuple of
302
- * `Record<name, factory>` — the effective view where external wins over
303
- * definition for the same slot. Used by `getRoutesApi` to enrich route
304
- * objects with their current canActivate / canDeactivate factories and by
305
- * the route-removal cleanup path.
306
- *
307
- * For cloneRouter (which needs to preserve origin on re-registration), use
308
- * {@link getFactoriesByOrigin} instead.
309
- */
310
- getFactories(): [Record<string, GuardFnFactory<Dependencies>>, Record<string, GuardFnFactory<Dependencies>>];
311
- /**
312
- * Returns factories tagged by origin — definition and external as separate
313
- * `[deactivate, activate]` tuples. Used by `cloneRouter` to re-register
314
- * guards on the clone with their original origin flag preserved.
315
- */
316
- getFactoriesByOrigin(): {
317
- definition: [Record<string, GuardFnFactory<Dependencies>>, Record<string, GuardFnFactory<Dependencies>>];
318
- external: [Record<string, GuardFnFactory<Dependencies>>, Record<string, GuardFnFactory<Dependencies>>];
319
- };
320
- /**
321
- * Returns compiled lifecycle functions for transition execution.
322
- *
323
- * @returns Tuple of [canDeactivateFunctions, canActivateFunctions] as Maps
324
- */
325
- getFunctions(): [Map<string, GuardFn>, Map<string, GuardFn>];
326
- canNavigateTo(toDeactivate: string[], toActivate: string[], toState: State, fromState: State | undefined): boolean;
327
- /**
328
- * Compiles a guard factory to its `GuardFn` WITHOUT registering it — surfaces
329
- * a throwing / non-function factory eagerly. The prepare-then-commit
330
- * add/replace path (`adoptRouteArtifacts`) calls this for every pending guard
331
- * BEFORE the store swap (#956), so a malformed factory aborts the mutation
332
- * with the store untouched. The returned function is then installed via the
333
- * `precompiledFn` argument of {@link addCanActivate} / {@link addCanDeactivate}
334
- * — no re-compile, so a factory with compile-time side effects runs exactly
335
- * once. Same boolean-shorthand handling + compile + non-function check as the
336
- * inline `#registerHandler` path, so a route-config `canActivate: true`
337
- * (boolean shorthand, runtime-reachable via the public route type) compiles to
338
- * the cached `TRUE_GUARD`/`FALSE_GUARD` instead of throwing on a non-callable.
339
- */
340
- compileGuardFactory(handler: GuardFnFactory<Dependencies> | boolean, methodName: string): GuardFn;
341
- }
342
- //#endregion
343
- //#region src/namespaces/RoutesNamespace/types.d.ts
344
- /**
345
- * Dependencies injected into RoutesNamespace.
346
- *
347
- * These are function references from the Router facade,
348
- * avoiding the need to pass the entire Router object.
349
- */
350
- interface RoutesDependencies<Dependencies extends DefaultDependencies = DefaultDependencies> {
351
- /** Per-router logger instance (from `getInternals(router).logger`) */
352
- logger: RouterLogger;
353
- /**
354
- * Register a canActivate handler for a route. `precompiledFn` installs an
355
- * already-compiled `GuardFn` (from {@link compileGuard}) without re-invoking
356
- * the factory — used by the #956 prepare-then-commit path so guards compile
357
- * once, before the store swap.
358
- */
359
- addActivateGuard: (name: string, handler: GuardFnFactory<Dependencies>, precompiledFn?: GuardFn) => void;
360
- /** Register a canDeactivate handler for a route (see {@link addActivateGuard}). */
361
- addDeactivateGuard: (name: string, handler: GuardFnFactory<Dependencies>, precompiledFn?: GuardFn) => void;
362
- /**
363
- * Compile a guard factory to its `GuardFn` WITHOUT registering it — surfaces a
364
- * throwing / non-function factory eagerly so the add/replace commit can
365
- * validate every guard before swapping the store (#956).
366
- */
367
- compileGuard: (handler: GuardFnFactory<Dependencies>, methodName: string) => GuardFn;
368
- /** Create state object */
369
- makeState: <P extends Params = Params>(name: string, params?: P, path?: string, meta?: Record<string, Record<string, "url" | "query">>) => State<P>;
370
- /** Get current router state */
371
- getState: () => State | undefined;
372
- /** Compare two states for equality */
373
- areStatesEqual: (state1: State | undefined, state2: State | undefined, ignoreQueryParams?: boolean) => boolean;
374
- /** Get a dependency by name */
375
- getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K];
376
- /** Forward state through facade (allows plugin interception) */
377
- forwardState: <P extends Params = Params>(name: string, params: P) => SimpleState<P>;
378
- }
379
- /**
380
- * Configuration storage for routes.
381
- * Stores decoders, encoders, default params, and forward mappings.
382
- */
383
- interface RouteConfig {
384
- /** Custom param decoders per route */
385
- decoders: Record<string, (params: Params) => Params>;
386
- /** Custom param encoders per route */
387
- encoders: Record<string, (params: Params) => Params>;
388
- /** Default params per route */
389
- defaultParams: Record<string, Params>;
390
- /** Forward mappings (source -> target) */
391
- forwardMap: Record<string, string>;
392
- /** Dynamic forward callbacks (source -> callback) */
393
- forwardFnMap: Record<string, ForwardToCallback<any>>;
394
- }
395
- //#endregion
396
- //#region src/namespaces/RoutesNamespace/routesStore.d.ts
397
- interface RoutesStore<Dependencies extends DefaultDependencies = DefaultDependencies> {
398
- /**
399
- * DERIVED VIEW, not stored state: reconstructed from `tree` on every access
400
- * via `routeTreeToDefinitions` (the lossless inverse cloneRouter already
401
- * relies on — the `~` absolute marker is restored, child order is the
402
- * definition order). The tree is the single source of truth, so a third
403
- * retained copy of the route table (~30 B/route) is not kept. Every reader
404
- * is a cold CRUD/plugin-registration path; the derive is O(N).
405
- *
406
- * The returned array is a FRESH snapshot each time — mutating it never
407
- * affects the store (pass an explicitly-mutated snapshot to
408
- * `commitTreeChanges` instead, as `remove` does).
409
- */
410
- readonly definitions: RouteDefinition[];
411
- readonly config: RouteConfig;
412
- tree: RouteTree;
413
- matcher: Matcher;
414
- /**
415
- * Per-route-name cache of URL (path) param names, derived from `matcher` and
416
- * read by `RoutesNamespace.getUrlParams` (powers `areStatesEqual` /
417
- * `isActiveRoute`). Cleared on every `matcher` rebuild so comparisons never
418
- * stay frozen to a route's pre-mutation param shape (#723).
419
- */
420
- readonly urlParamsCache: Map<string, string[]>;
421
- resolvedForwardMap: Record<string, string>;
422
- routeCustomFields: Record<string, Record<string, unknown>>;
423
- rootPath: string;
424
- readonly matcherOptions: CreateMatcherOptions | undefined;
425
- depsStore: RoutesDependencies<Dependencies> | undefined;
426
- lifecycleNamespace: RouteLifecycleNamespace<Dependencies> | undefined;
427
- readonly pendingCanActivate: Map<string, GuardFnFactory<Dependencies>>;
428
- readonly pendingCanDeactivate: Map<string, GuardFnFactory<Dependencies>>;
429
- }
430
- //#endregion
431
- //#region src/internals.d.ts
432
- interface RouterInternals<D extends DefaultDependencies = DefaultDependencies> {
433
- readonly makeState: <P extends Params = Params>(name: string, params?: P, path?: string, meta?: Record<string, Record<string, "url" | "query">>) => State<P>;
434
- readonly forwardState: <P extends Params = Params>(routeName: string, routeParams: P) => SimpleState<P>;
435
- readonly buildStateResolved: (resolvedName: string, resolvedParams: Params) => RouteTreeState | undefined;
436
- readonly matchPath: <P extends Params = Params>(path: string, options?: Options$1) => State<P> | undefined;
437
- readonly getOptions: () => Options$1;
438
- readonly addEventListener: <E extends EventName>(eventName: E, cb: Plugin[EventMethodMap[E]]) => Unsubscribe;
439
- /**
440
- * Route-tree mutation channel — internal access for the `getRoutesApi`
441
- * wrapper. A dedicated bridge is required because the public
442
- * `addEventListener<E extends EventName>` structurally rejects
443
- * `"TREE_CHANGED"` (it is not in the public `EventName` union), is strict on
444
- * duplicates, and exposes neither `emit` nor `listenerCount`.
445
- */
446
- readonly treeChanged: {
447
- readonly emit: (event: TreeChangedEvent) => void;
448
- readonly subscribe: (handler: (event: TreeChangedEvent) => void) => Unsubscribe;
449
- readonly listenerCount: () => number;
450
- /**
451
- * True while a `TREE_CHANGED` emit is on the stack — `getRoutesApi` reads it
452
- * to reject reentrant route-CRUD from a `subscribeChanges` handler (#1032).
453
- */
454
- readonly isEmitting: () => boolean;
455
- };
456
- readonly buildPath: (route: string, params?: Params) => string;
457
- readonly emitTransitionError: (error: Error) => void;
458
- /**
459
- * Emits `TRANSITION_SUCCESS` directly (no FSM transition) — used by
460
- * `getRoutesApi().replace()` to notify `router.subscribe` listeners when a
461
- * structural replace revalidates the active state (#950). Mirrors the success
462
- * emission `completeTransition` / `navigateToNotFound` perform.
463
- */
464
- readonly emitTransitionSuccess: (toState: State, fromState: State | undefined, opts?: NavigationOptions) => void;
465
- /**
466
- * Commits the not-found (`UNKNOWN_ROUTE`) state for `path` and emits
467
- * `TRANSITION_SUCCESS` — the `NavigationNamespace.navigateToNotFound`
468
- * primitive. `replace()` uses it when a structural replace drops the active
469
- * route, so subscribers are notified instead of the state silently clearing
470
- * (#950).
471
- */
472
- readonly navigateToNotFound: (path: string) => State;
473
- readonly start: (path: string) => Promise<State>;
474
- /**
475
- * Plugin-only navigation entry point — delegates to
476
- * `NavigationNamespace.navigateToState` (`getPluginApi(router).navigateToState`).
477
- * Hidden from `Router`/`Navigator` to keep the userland surface minimal;
478
- * see `core-types/src/api.ts` for usage docs.
479
- */
480
- readonly navigateToState: (state: State, options?: NavigationOptions) => Promise<State>;
481
- readonly interceptors: Map<string, ((next: (...args: any[]) => any, ...args: any[]) => any)[]>;
482
- readonly setRootPath: (rootPath: string) => void;
483
- readonly getRootPath: () => string;
484
- readonly getTree: () => RouteTree;
485
- readonly isDisposed: () => boolean;
486
- validator: RouterValidator | null;
487
- readonly logger: RouterLogger;
488
- readonly dependenciesGetStore: () => DependenciesStore<D>;
489
- readonly getCloneState: () => {
490
- options: Options$1;
491
- dependencies: Record<string, unknown>;
492
- pluginFactories: PluginFactory<D>[];
493
- loggerConfig: LoggerConfig;
494
- };
495
- readonly routeGetStore: () => RoutesStore<D>;
496
- readonly getStateName: () => string | undefined;
497
- readonly isTransitioning: () => boolean;
498
- readonly clearState: () => void;
499
- readonly setState: (state: State) => void;
500
- readonly routerExtensions: {
501
- keys: string[];
502
- }[];
503
- readonly contextClaimRecords: Set<string>;
504
- /**
505
- * One-shot hydration scratchpad populated by `hydrateRouter` immediately
506
- * before delegating to `router.start(parsed.path)` and cleared in the
507
- * matching `finally`. SSR loader plugins read this slot directly via
508
- * `getInternals(router).hydrationState` to short-circuit their own loader
509
- * call when the server-resolved namespace value is already present in the
510
- * parsed state (#596). `null` outside of an active `hydrateRouter`
511
- * invocation.
512
- */
513
- hydrationState: SerializedRouterState | null;
514
- }
515
- declare function getInternals<D extends DefaultDependencies>(router: Router<D>): RouterInternals<D>;
516
- //#endregion
517
- export { type Matcher, type RouteTree, type RouterInternals, type RouterValidator, getInternals, validateRoute };
518
- //# sourceMappingURL=validation.d.mts.map
1
+ import { RouteTree } from "./engine/builder/types.mjs";
2
+ import { Matcher } from "./engine/createMatcher.mjs";
3
+ import { validateRoute } from "./engine/validation/route-batch.mjs";
4
+ import { RouterValidator } from "./types/RouterValidator.mjs";
5
+ import { RouterInternals, getInternals } from "./internals.mjs";
6
+ export { type Matcher, type RouteTree, type RouterInternals, type RouterValidator, getInternals, validateRoute };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/core",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "type": "commonjs",
5
5
  "description": "A simple, powerful, view-agnostic, modular and extensible router",
6
6
  "main": "./dist/cjs/index.js",
@@ -14,9 +14,6 @@
14
14
  "api": [
15
15
  "./dist/cjs/api.d.ts"
16
16
  ],
17
- "utils": [
18
- "./dist/cjs/utils.d.ts"
19
- ],
20
17
  "validation": [
21
18
  "./dist/cjs/validation.d.ts"
22
19
  ]
@@ -50,15 +47,6 @@
50
47
  "import": "./dist/esm/api.mjs",
51
48
  "require": "./dist/cjs/api.js"
52
49
  },
53
- "./utils": {
54
- "@real-router/internal-source": "./src/utils/index.ts",
55
- "types": {
56
- "import": "./dist/esm/utils.d.mts",
57
- "require": "./dist/cjs/utils.d.ts"
58
- },
59
- "import": "./dist/esm/utils.mjs",
60
- "require": "./dist/cjs/utils.js"
61
- },
62
50
  "./validation": {
63
51
  "@real-router/internal-source": "./src/validation.ts",
64
52
  "types": {
@@ -97,6 +85,9 @@
97
85
  },
98
86
  "homepage": "https://github.com/greydragon888/real-router",
99
87
  "sideEffects": false,
88
+ "devDependencies": {
89
+ "@real-router/ssr-utils": "^0.1.0"
90
+ },
100
91
  "scripts": {
101
92
  "test": "vitest run",
102
93
  "test:properties": "vitest run --config vitest.config.properties.mts",
@@ -108,6 +99,6 @@
108
99
  "type-check": "tsc --noEmit",
109
100
  "lint": "eslint --cache --ext .ts src/ tests/ --max-warnings 0",
110
101
  "lint:fix": "eslint --cache --ext .ts src/ tests/ --fix --max-warnings 0",
111
- "bundle": "tsdown --config-loader unrun"
102
+ "bundle": "rm -rf dist && tsdown --config-loader unrun && node scripts/check-dts-augment-targets.mjs"
112
103
  }
113
104
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Router-BG5yNYUG.d.ts","names":[],"sources":["../../src/Router.ts"],"mappings":";;;;;AA4FA;;;;;;;;;;;;;;cAAa,MAAA,sBACU,mBAAA,GAAsB,mBAAA,aAChC,QAAA,CAAgB,YAAA;EAAA;GAC1B,GAAA;EA4ZmB;;;;;cAhXlB,MAAA,GAAQ,KAAA,CAAM,YAAA,KACd,OAAA,GAAS,OAAA,CAAQ,OAAA,GACjB,YAAA,GAAc,YAAA;EAyThB,aAAA,CACE,IAAA,UACA,MAAA,GAAS,MAAA,EACT,cAAA,YACA,iBAAA;EAgCF,SAAA,CAAU,KAAA,UAAe,MAAA,GAAS,MAAA;EAalC,QAAA,WAAmB,MAAA,GAAS,MAAA,KAAW,KAAA,CAAM,CAAA;EAI7C,gBAAA,IAAoB,KAAA;EAIpB,cAAA,CACE,MAAA,EAAQ,KAAA,cACR,MAAA,EAAQ,KAAA,cACR,iBAAA;EAWF,gBAAA,CACE,QAAA,YACE,OAAA,EAAS,KAAA,EAAO,SAAA,GAAY,KAAA;EAUhC,QAAA;EAIA,KAAA,CAAM,SAAA,WAAoB,OAAA,CAAQ,KAAA;EA4DlC,IAAA;EAyBA,OAAA;EAsDA,aAAA,CAAc,IAAA,UAAc,MAAA,GAAS,MAAA;EAiErC,SAAA,IACK,OAAA,GAAU,aAAA,CAAc,YAAA,kCAC1B,WAAA;EAyCH,SAAA,CAAU,QAAA,EAAU,WAAA,GAAc,WAAA;EAMlC,cAAA,CAAe,QAAA,EAAU,OAAA,GAAU,WAAA;EAMnC,eAAA;EAQA,QAAA,CACE,SAAA,UACA,WAAA,GAAc,MAAA,EACd,OAAA,GAAU,iBAAA,GACT,OAAA,CAAQ,KAAA;EA8BX,iBAAA,CAAkB,OAAA,GAAU,iBAAA,GAAoB,OAAA,CAAQ,KAAA;EA2BxD,kBAAA,CAAmB,IAAA,YAAgB,KAAA;AAAA"}