@koine/next 1.0.65 → 1.0.68

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.
package/load.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Utility to load a component with an optional pre-determined delay.
3
3
  *
4
- * This was designed to improve anti spam wit async form loading.
4
+ * This was designed to improve anti spam with async form loading.
5
5
  *
6
6
  * @see https://github.com/vercel/next.js/blob/main/packages/next/next-server/lib/dynamic.tsx
7
7
  * @see https://github.com/vercel/next.js/blob/canary/examples/with-dynamic-import/pages/index.js
package/load.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Utility to load a component with an optional pre-determined delay.
3
3
  *
4
- * This was designed to improve anti spam wit async form loading.
4
+ * This was designed to improve anti spam with async form loading.
5
5
  *
6
6
  * @see https://github.com/vercel/next.js/blob/main/packages/next/next-server/lib/dynamic.tsx
7
7
  * @see https://github.com/vercel/next.js/blob/canary/examples/with-dynamic-import/pages/index.js
package/node/load.js CHANGED
@@ -4,7 +4,7 @@ exports.load = void 0;
4
4
  /**
5
5
  * Utility to load a component with an optional pre-determined delay.
6
6
  *
7
- * This was designed to improve anti spam wit async form loading.
7
+ * This was designed to improve anti spam with async form loading.
8
8
  *
9
9
  * @see https://github.com/vercel/next.js/blob/main/packages/next/next-server/lib/dynamic.tsx
10
10
  * @see https://github.com/vercel/next.js/blob/canary/examples/with-dynamic-import/pages/index.js
package/package.json CHANGED
@@ -18,9 +18,9 @@
18
18
  "peerDependencies": {
19
19
  "react": "^16.8 || ^17 || ^18",
20
20
  "next": "^12.2.3",
21
- "@koine/utils": "1.0.65",
21
+ "@koine/utils": "1.0.68",
22
22
  "framer-motion": "^6.5.1",
23
- "@koine/react": "1.0.65",
23
+ "@koine/react": "1.0.68",
24
24
  "styled-components": "^5.3.5",
25
25
  "@mui/base": "^5.0.0-alpha.90",
26
26
  "react-icons": "^4.4.0",
@@ -41,7 +41,7 @@
41
41
  "next-seo": "^5.5.0",
42
42
  "@hookform/resolvers": "^2.9.6"
43
43
  },
44
- "version": "1.0.65",
44
+ "version": "1.0.68",
45
45
  "module": "./index.js",
46
46
  "types": "./index.d.ts"
47
47
  }
package/to.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { TranslateNamespaced, TranslatedRoute } from "./types-i18n";
2
- declare type OnlyStatic<T extends string> = T extends `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? never : T;
3
- declare type OnlyDynamic<T extends string> = T extends `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? T : never;
2
+ declare type OnlyStatic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? never : T;
3
+ declare type OnlyDynamic<T extends string> = T extends `${string}.[${string}].${string}` | `${string}.[${string}]` | `[${string}].${string}` | `[${string}]` ? T : never;
4
4
  /**
5
5
  * @borrows [awesome-template-literal-types](https://github.com/ghoullier/awesome-template-literal-types#router-params-parsing)
6
6
  */
package/types-i18n.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * ```ts
13
13
  * declare namespace Koine {
14
- * interface NextTranslations {
14
+ * interface Translations {
15
15
  * "~": typeof import("./locales/en/~.json");
16
16
  * "_": typeof import("./locales/en/_.json");
17
17
  * "$team": typeof import("./locales/en/$team.json");
@@ -43,7 +43,7 @@
43
43
  * would use a `~my~account-settings.json` file.
44
44
  * - `ComponentName.json`: pascal cased for **components** specific data
45
45
  */
46
- export declare type TranslationsDictionary = Koine.NextTranslations;
46
+ export declare type TranslationsDictionary = Koine.Translations;
47
47
  export declare type TranslateNamespace = Extract<keyof TranslationsDictionary, string>;
48
48
  declare type Join<S1, S2> = S1 extends string ? S2 extends string ? `${S1}.${S2}` : S1 : never;
49
49
  export declare type TranslationsPaths<T, TAddRoot extends true | undefined = undefined> = {
@@ -109,4 +109,16 @@ export declare type TranslateLoose = (s?: any, q?: TranslationQuery, o?: Transla
109
109
  * localised pathname (even with dynamic portions).
110
110
  */
111
111
  export declare type TranslatedRoute = TranslationsPaths<TranslationsDictionary["~"]>;
112
+ /**
113
+ * Utility standalone type to extract all (max two level depth) children routes
114
+ * that starts with the given string.
115
+ *
116
+ * This is useful to get the subroutes of an application area, e.g. all subroutes
117
+ * of a dashboard, using it with:
118
+ *
119
+ * ```
120
+ * type DashboardRoutes = TranslatedRoutesChildrenOf<"dashboard">;
121
+ * ```
122
+ */
123
+ export declare type TranslatedRoutesChildrenOf<TStarts extends string, T extends string = TranslatedRoute> = T extends `${TStarts}.${infer First}.${infer Second}` ? First | `${First}.${Second}` : T extends `${TStarts}.${infer First}` ? First : never;
112
124
  export {};
package/typings.d.ts CHANGED
@@ -64,7 +64,7 @@ declare namespace Koine {
64
64
  *
65
65
  * ```ts
66
66
  * declare namespace Koine {
67
- * interface NextTranslations {
67
+ * interface Translations {
68
68
  * "~": typeof import("./locales/en/~.json");
69
69
  * "_": typeof import("./locales/en/_.json");
70
70
  * "$team": typeof import("./locales/en/$team.json");
@@ -82,7 +82,7 @@ declare namespace Koine {
82
82
  * - `{route-name}`: lower cased for **route** specific data
83
83
  * - `{ComponentName}`: pascal cased for **components** specific data
84
84
  */
85
- interface NextTranslations {
85
+ interface Translations {
86
86
  [key: string]: any;
87
87
  }
88
88
  }