Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
UberMouse committed Jan 23, 2024
2 parents a018445 + f99d57c commit a4cd41e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
* **core:** xstate v5 support ([4c7a57a](https://github.com/koordinates/xstate-tree/commit/4c7a57ad5842a76aa2a33360f3a81c04eb66ca72)), closes [#58](https://github.com/koordinates/xstate-tree/issues/58)


# [4.6.0](https://github.com/koordinates/xstate-tree/compare/v4.5.0...v4.6.0) (2024-01-23)


### feat

* **routes:** RouteQuery type ([1468c77](https://github.com/koordinates/xstate-tree/commit/1468c77020f3d34be6aaccf986659a44a1ba8a80))

# [4.5.0](https://github.com/koordinates/xstate-tree/compare/v4.4.0...v4.5.0) (2024-01-15)


Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export {
type LinkProps,
type AnyRoute,
type RouteParams,
type RouteQuery,
type RouteArguments,
type Route,
type RouteMeta,
Expand Down
9 changes: 9 additions & 0 deletions src/routing/createRoute/createRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ export type RouteParams<T> = T extends Route<infer TParams, any, any, any>
? TParams
: undefined;

/**
* @public
*
* Extract query type from route
*/
export type RouteQuery<T> = T extends Route<any, infer TQuery, any, any>
? TQuery
: undefined;

/**
* @public
*
Expand Down
1 change: 1 addition & 0 deletions src/routing/createRoute/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export {
type RouteArguments,
type RouteParams,
type RouteMeta,
type RouteQuery,
type ArgumentsForRoute,
type Params,
type Query,
Expand Down
1 change: 1 addition & 0 deletions src/routing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export {
type AnyRoute,
type RouteParams,
type RouteMeta,
type RouteQuery,
type RouteArguments,
type ArgumentsForRoute,
type Params,
Expand Down
9 changes: 6 additions & 3 deletions xstate-tree.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ export type RouteMeta<T> = T extends Route<any, any, any, infer TMeta> ? TMeta :
// @public
export type RouteParams<T> = T extends Route<infer TParams, any, any, any> ? TParams : undefined;

// @public
export type RouteQuery<T> = T extends Route<any, infer TQuery, any, any> ? TQuery : undefined;

// @public (undocumented)
export type Routing404Event = {
type: "ROUTING_404";
Expand Down Expand Up @@ -396,9 +399,9 @@ export type XstateTreeMachineStateSchemaV2<TMachine extends AnyStateMachine, TSe

// Warnings were encountered during analysis:
//
// src/routing/createRoute/createRoute.ts:279:19 - (ae-forgotten-export) The symbol "MergeRouteTypes" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:279:19 - (ae-forgotten-export) The symbol "ResolveZodType" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:316:9 - (ae-forgotten-export) The symbol "RouteRedirect" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:288:19 - (ae-forgotten-export) The symbol "MergeRouteTypes" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:288:19 - (ae-forgotten-export) The symbol "ResolveZodType" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:325:9 - (ae-forgotten-export) The symbol "RouteRedirect" needs to be exported by the entry point index.d.ts
// src/types.ts:117:3 - (ae-incompatible-release-tags) The symbol "canHandleEvent" is marked as @public, but its signature references "CanHandleEvent" which is marked as @internal
// src/types.ts:118:3 - (ae-incompatible-release-tags) The symbol "inState" is marked as @public, but its signature references "MatchesFrom" which is marked as @internal

Expand Down

0 comments on commit a4cd41e

Please sign in to comment.