Skip to content

Commit 6224030

Browse files
committed
fix(types): export missing types
1 parent f2a6931 commit 6224030

File tree

4 files changed

+37
-9
lines changed

4 files changed

+37
-9
lines changed

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export {
1515
type LinkProps,
1616
type AnyRoute,
1717
type RouteParams,
18+
type RouteArguments,
1819
type Route,
20+
type RouteMeta,
1921
type Routing404Event,
2022
type StyledLink,
2123
type ArgumentsForRoute,

src/routing/createRoute/createRoute.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ type EmptyKeys<T> = keyof {
1313
type MakeEmptyObjectPropertiesOptional<T> = Omit<T, EmptyKeys<T>> &
1414
Partial<Pick<T, EmptyKeys<T>>>;
1515

16+
/**
17+
* @public
18+
*/
1619
export type RouteArguments<TParams, TQuery, TMeta> = TParams extends undefined
1720
? TQuery extends undefined
1821
? TMeta extends undefined

src/routing/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export {
44
type AnyRoute,
55
type RouteParams,
66
type RouteMeta,
7+
type RouteArguments,
78
type ArgumentsForRoute,
89
buildCreateRoute,
910
} from "./createRoute";

xstate-tree.api.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ export type AnyRoute = {
3737
querySchema?: Z.ZodObject<any>;
3838
};
3939

40-
// Warning: (ae-forgotten-export) The symbol "RouteArguments" needs to be exported by the entry point index.d.ts
41-
//
4240
// @public (undocumented)
4341
export type ArgumentsForRoute<T> = T extends Route<infer TParams, infer TQuery, any, infer TMeta> ? RouteArguments<TParams, TQuery, TMeta> : never;
4442

@@ -217,6 +215,31 @@ export type Route<TParams, TQuery, TEvent, TMeta> = {
217215
querySchema?: Z.ZodObject<any>;
218216
};
219217

218+
// @public (undocumented)
219+
export type RouteArguments<TParams, TQuery, TMeta> = TParams extends undefined ? TQuery extends undefined ? TMeta extends undefined ? {} : {
220+
meta?: TMeta;
221+
} : TMeta extends undefined ? {
222+
query: TQuery;
223+
} : {
224+
query: TQuery;
225+
meta?: TMeta;
226+
} : TQuery extends undefined ? TMeta extends undefined ? {
227+
params: TParams;
228+
} : {
229+
params: TParams;
230+
meta?: TMeta;
231+
} : TMeta extends undefined ? {
232+
params: TParams;
233+
query: TQuery;
234+
} : {
235+
params: TParams;
236+
query: TQuery;
237+
meta?: TMeta;
238+
};
239+
240+
// @public (undocumented)
241+
export type RouteMeta<T> = T extends Route<any, any, any, infer TMeta> ? TMeta : undefined;
242+
220243
// @public (undocumented)
221244
export type RouteParams<T> = T extends Route<infer TParams, any, any, any> ? TParams : undefined;
222245

@@ -288,13 +311,12 @@ export type XstateTreeMachineStateSchema<TContext, TEvent extends EventObject, T
288311

289312
// Warnings were encountered during analysis:
290313
//
291-
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
292-
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Params" needs to be exported by the entry point index.d.ts
293-
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point index.d.ts
294-
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Meta" needs to be exported by the entry point index.d.ts
295-
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "SharedMeta" needs to be exported by the entry point index.d.ts
296-
// src/routing/createRoute/createRoute.ts:251:37 - (ae-forgotten-export) The symbol "RouteArgumentFunctions" needs to be exported by the entry point index.d.ts
297-
// src/routing/createRoute/createRoute.ts:324:5 - (ae-forgotten-export) The symbol "RouteMeta" needs to be exported by the entry point index.d.ts
314+
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
315+
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Params" needs to be exported by the entry point index.d.ts
316+
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point index.d.ts
317+
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Meta" needs to be exported by the entry point index.d.ts
318+
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "SharedMeta" needs to be exported by the entry point index.d.ts
319+
// src/routing/createRoute/createRoute.ts:254:37 - (ae-forgotten-export) The symbol "RouteArgumentFunctions" needs to be exported by the entry point index.d.ts
298320
// src/types.ts:76:3 - (ae-incompatible-release-tags) The symbol "slots" is marked as @public, but its signature references "GetSlotNames" which is marked as @internal
299321

300322
// (No @packageDocumentation comment for this package)

0 commit comments

Comments
 (0)