@etsoo/shared 1.2.2 → 1.2.4

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.
@@ -243,11 +243,11 @@ export declare namespace DataTypes {
243
243
  /**
244
244
  * Culture definiton
245
245
  */
246
- type CultureDefinition<T extends StringRecord = StringRecord> = Readonly<{
246
+ type CultureDefinition<T extends StringRecord = StringRecord> = {
247
247
  /**
248
248
  * Name, like zh-CN
249
249
  */
250
- name: string;
250
+ readonly name: string;
251
251
  /**
252
252
  * Label for description, like Simplifined Chinese
253
253
  */
@@ -255,12 +255,12 @@ export declare namespace DataTypes {
255
255
  /**
256
256
  * Resources
257
257
  */
258
- resources: T | Promise<T>;
258
+ resources: T | (() => Promise<T>);
259
259
  /**
260
260
  * Compatible names
261
261
  */
262
- compatibleNames?: string[];
263
- }>;
262
+ readonly compatibleNames?: string[];
263
+ };
264
264
  /**
265
265
  * Dynamic interface with multiple properties
266
266
  */
@@ -84,17 +84,7 @@ export declare namespace DomUtils {
84
84
  * @param items Available cultures
85
85
  * @param culture Detected culture
86
86
  */
87
- const getCulture: <T extends DataTypes.StringRecord>(items: Readonly<{
88
- name: string;
89
- label: string;
90
- resources: T | Promise<T>;
91
- compatibleNames?: string[] | undefined;
92
- }>[], culture: string) => [Readonly<{
93
- name: string;
94
- label: string;
95
- resources: T | Promise<T>;
96
- compatibleNames?: string[] | undefined;
97
- }> | undefined, CultureMatch];
87
+ const getCulture: <T extends DataTypes.StringRecord>(items: DataTypes.CultureDefinition<T>[], culture: string) => [DataTypes.CultureDefinition<T> | undefined, CultureMatch];
98
88
  /**
99
89
  * Get input value depending on its type
100
90
  * @param input HTML input
@@ -243,11 +243,11 @@ export declare namespace DataTypes {
243
243
  /**
244
244
  * Culture definiton
245
245
  */
246
- type CultureDefinition<T extends StringRecord = StringRecord> = Readonly<{
246
+ type CultureDefinition<T extends StringRecord = StringRecord> = {
247
247
  /**
248
248
  * Name, like zh-CN
249
249
  */
250
- name: string;
250
+ readonly name: string;
251
251
  /**
252
252
  * Label for description, like Simplifined Chinese
253
253
  */
@@ -255,12 +255,12 @@ export declare namespace DataTypes {
255
255
  /**
256
256
  * Resources
257
257
  */
258
- resources: T | Promise<T>;
258
+ resources: T | (() => Promise<T>);
259
259
  /**
260
260
  * Compatible names
261
261
  */
262
- compatibleNames?: string[];
263
- }>;
262
+ readonly compatibleNames?: string[];
263
+ };
264
264
  /**
265
265
  * Dynamic interface with multiple properties
266
266
  */
@@ -84,17 +84,7 @@ export declare namespace DomUtils {
84
84
  * @param items Available cultures
85
85
  * @param culture Detected culture
86
86
  */
87
- const getCulture: <T extends DataTypes.StringRecord>(items: Readonly<{
88
- name: string;
89
- label: string;
90
- resources: T | Promise<T>;
91
- compatibleNames?: string[] | undefined;
92
- }>[], culture: string) => [Readonly<{
93
- name: string;
94
- label: string;
95
- resources: T | Promise<T>;
96
- compatibleNames?: string[] | undefined;
97
- }> | undefined, CultureMatch];
87
+ const getCulture: <T extends DataTypes.StringRecord>(items: DataTypes.CultureDefinition<T>[], culture: string) => [DataTypes.CultureDefinition<T> | undefined, CultureMatch];
98
88
  /**
99
89
  * Get input value depending on its type
100
90
  * @param input HTML input
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/DataTypes.ts CHANGED
@@ -309,28 +309,27 @@ export namespace DataTypes {
309
309
  /**
310
310
  * Culture definiton
311
311
  */
312
- export type CultureDefinition<T extends StringRecord = StringRecord> =
313
- Readonly<{
314
- /**
315
- * Name, like zh-CN
316
- */
317
- name: string;
318
-
319
- /**
320
- * Label for description, like Simplifined Chinese
321
- */
322
- label: string;
323
-
324
- /**
325
- * Resources
326
- */
327
- resources: T | Promise<T>;
328
-
329
- /**
330
- * Compatible names
331
- */
332
- compatibleNames?: string[];
333
- }>;
312
+ export type CultureDefinition<T extends StringRecord = StringRecord> = {
313
+ /**
314
+ * Name, like zh-CN
315
+ */
316
+ readonly name: string;
317
+
318
+ /**
319
+ * Label for description, like Simplifined Chinese
320
+ */
321
+ label: string;
322
+
323
+ /**
324
+ * Resources
325
+ */
326
+ resources: T | (() => Promise<T>);
327
+
328
+ /**
329
+ * Compatible names
330
+ */
331
+ readonly compatibleNames?: string[];
332
+ };
334
333
 
335
334
  /**
336
335
  * Dynamic interface with multiple properties