Skip to content

Commit

Permalink
fix(types): export missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
UberMouse committed Jul 16, 2022
1 parent f2a6931 commit 6224030
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export {
type LinkProps,
type AnyRoute,
type RouteParams,
type RouteArguments,
type Route,
type RouteMeta,
type Routing404Event,
type StyledLink,
type ArgumentsForRoute,
Expand Down
3 changes: 3 additions & 0 deletions src/routing/createRoute/createRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ type EmptyKeys<T> = keyof {
type MakeEmptyObjectPropertiesOptional<T> = Omit<T, EmptyKeys<T>> &
Partial<Pick<T, EmptyKeys<T>>>;

/**
* @public
*/
export type RouteArguments<TParams, TQuery, TMeta> = TParams extends undefined
? TQuery extends undefined
? TMeta extends undefined
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 RouteArguments,
type ArgumentsForRoute,
buildCreateRoute,
} from "./createRoute";
Expand Down
40 changes: 31 additions & 9 deletions xstate-tree.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export type AnyRoute = {
querySchema?: Z.ZodObject<any>;
};

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

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

// @public (undocumented)
export type RouteArguments<TParams, TQuery, TMeta> = TParams extends undefined ? TQuery extends undefined ? TMeta extends undefined ? {} : {
meta?: TMeta;
} : TMeta extends undefined ? {
query: TQuery;
} : {
query: TQuery;
meta?: TMeta;
} : TQuery extends undefined ? TMeta extends undefined ? {
params: TParams;
} : {
params: TParams;
meta?: TMeta;
} : TMeta extends undefined ? {
params: TParams;
query: TQuery;
} : {
params: TParams;
query: TQuery;
meta?: TMeta;
};

// @public (undocumented)
export type RouteMeta<T> = T extends Route<any, any, any, infer TMeta> ? TMeta : undefined;

// @public (undocumented)
export type RouteParams<T> = T extends Route<infer TParams, any, any, any> ? TParams : undefined;

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

// Warnings were encountered during analysis:
//
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Params" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "Meta" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:228:5 - (ae-forgotten-export) The symbol "SharedMeta" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:251:37 - (ae-forgotten-export) The symbol "RouteArgumentFunctions" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:324:5 - (ae-forgotten-export) The symbol "RouteMeta" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Params" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "Meta" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:231:5 - (ae-forgotten-export) The symbol "SharedMeta" needs to be exported by the entry point index.d.ts
// src/routing/createRoute/createRoute.ts:254:37 - (ae-forgotten-export) The symbol "RouteArgumentFunctions" needs to be exported by the entry point index.d.ts
// 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

// (No @packageDocumentation comment for this package)
Expand Down

0 comments on commit 6224030

Please sign in to comment.