@koordinates/xstate-tree 1.1.3 → 1.2.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.
@@ -294,7 +294,7 @@ declare type MakeEmptyObjectPropertiesOptional<T> = Omit<T, EmptyKeys<T>> & Part
294
294
  /**
295
295
  * @public
296
296
  */
297
- export declare function matchRoute<TRoutes extends Route<any, any, any, any>[]>(routes: TRoutes, basePath: string, path: string, search: string): Return;
297
+ export declare function matchRoute<TRoutes extends Route<any, any, any, any>[]>(routes: TRoutes, basePath: string, path: string, search: string): Return<TRoutes>;
298
298
 
299
299
  /**
300
300
  * @public
@@ -374,10 +374,10 @@ export declare type Query<T> = T extends {
374
374
  query: infer TQuery;
375
375
  } ? TQuery : undefined;
376
376
 
377
- declare type Return = {
377
+ declare type Return<TRoutes extends Route<any, any, any, any>[]> = {
378
378
  type: "matched";
379
- route: AnyRoute;
380
- event: RoutingEvent<Route<any, any, any, any>>;
379
+ route: TRoutes[number];
380
+ event: RoutingEvent<TRoutes[number]>;
381
381
  } | {
382
382
  type: "no-matches";
383
383
  } | {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@koordinates/xstate-tree",
3
3
  "main": "lib/index.js",
4
4
  "types": "lib/xstate-tree.d.ts",
5
- "version": "1.1.3",
5
+ "version": "1.2.0",
6
6
  "dependencies": {
7
7
  "@xstate/react": "3.0.0",
8
8
  "fast-memoize": "2.5.2",