@uxf/router 11.72.0 → 11.72.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/router",
3
- "version": "11.72.0",
3
+ "version": "11.72.1",
4
4
  "description": "UXF Router",
5
5
  "author": "UXFans <dev@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/router#readme",
package/types.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { GetServerSideProps, GetStaticProps, PreviewData as NextPreviewData } from "next";
2
- import { Struct } from "superstruct";
2
+ import { Infer, Struct } from "superstruct";
3
3
  export type RoutesDefinition<Locales extends string[]> = Record<string, {
4
4
  path: string | Record<Locales[number], string>;
5
5
  schema?: Struct<any, any> | null;
6
6
  }>;
7
- export type QueryParams<RouteList, Route extends keyof RouteList> = RouteList[Route] extends null ? never : {
8
- [key in keyof RouteList[Route]]: string | string[] | undefined;
7
+ export type QueryParams<RouteList extends RoutesDefinition<any>, Route extends keyof RouteList> = RouteList[Route]["schema"] extends null ? never : {
8
+ [key in keyof Infer<NonNullable<RouteList[Route]["schema"]>>]: string | string[] | undefined;
9
9
  };
10
- export type UxfGetStaticProps<RouteList, Route extends keyof RouteList, Props extends {
10
+ export type UxfGetStaticProps<RouteList extends RoutesDefinition<any>, Route extends keyof RouteList, Props extends {
11
11
  [key: string]: any;
12
12
  } = {
13
13
  [key: string]: any;
14
14
  }, PreviewData extends NextPreviewData = NextPreviewData> = GetStaticProps<Props, QueryParams<RouteList, Route>, PreviewData>;
15
- export type UxfGetServerSideProps<RouteList, Route extends keyof RouteList, Props extends {
15
+ export type UxfGetServerSideProps<RouteList extends RoutesDefinition<any>, Route extends keyof RouteList, Props extends {
16
16
  [key: string]: any;
17
17
  } = {
18
18
  [key: string]: any;