@koine/next 1.0.66 → 1.0.67

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/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.66",
21
+ "@koine/utils": "1.0.67",
22
22
  "framer-motion": "^6.5.1",
23
- "@koine/react": "1.0.66",
23
+ "@koine/react": "1.0.67",
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.66",
44
+ "version": "1.0.67",
45
45
  "module": "./index.js",
46
46
  "types": "./index.d.ts"
47
47
  }
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
  }