@etsoo/shared 1.2.9 → 1.2.10
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/README.md +4 -0
- package/lib/cjs/DataTypes.d.ts +18 -1
- package/lib/mjs/DataTypes.d.ts +18 -1
- package/package.json +1 -1
- package/src/DataTypes.ts +19 -2
package/README.md
CHANGED
|
@@ -136,13 +136,16 @@ Data type definitions and type safe functions. ListItemType, ListItemType1 and L
|
|
|
136
136
|
|Func<R>|Function type, R is return type|
|
|
137
137
|
|HAlign|Horizontal align|
|
|
138
138
|
|HAlignEnum|Horizontal align enum|
|
|
139
|
+
|IdDefaultType|Id default type|
|
|
139
140
|
|IdType|Number and string combination id type|
|
|
140
141
|
|IdItem|Item with id or id generator|
|
|
141
142
|
|IdLabelItem|Item with id and label|
|
|
142
143
|
|IdLabelType|Item with id and label dynamic type|
|
|
143
144
|
|IdNameItem|Item with id and name|
|
|
145
|
+
|IdTitleItem|Item with id and title|
|
|
144
146
|
|KeyCollection|Key collection, like { key1: {}, key2: {} }|
|
|
145
147
|
|Keys|Get specific type keys|
|
|
148
|
+
|LabelDefaultType|Label default type|
|
|
146
149
|
|MConstructor|Mixins constructor|
|
|
147
150
|
|ObjType|Generic object type|
|
|
148
151
|
|Optional|Make properties optional|
|
|
@@ -155,6 +158,7 @@ Data type definitions and type safe functions. ListItemType, ListItemType1 and L
|
|
|
155
158
|
|SimpleObject|Simple object, string key, simple type and null value Record|
|
|
156
159
|
|StringDictionary|String key, string value Record|
|
|
157
160
|
|StringRecord|String key, unknown value Record|
|
|
161
|
+
|TitleDefaultType|Title default type|
|
|
158
162
|
|VAlign|Vertical align|
|
|
159
163
|
|VAlignEnum|Vertical align enum|
|
|
160
164
|
|Methods||
|
package/lib/cjs/DataTypes.d.ts
CHANGED
|
@@ -224,6 +224,15 @@ export declare namespace DataTypes {
|
|
|
224
224
|
*/
|
|
225
225
|
name: string;
|
|
226
226
|
};
|
|
227
|
+
/**
|
|
228
|
+
* Item with id and title property
|
|
229
|
+
*/
|
|
230
|
+
type IdTitleItem<T extends IdType = number> = IdItem<T> & {
|
|
231
|
+
/**
|
|
232
|
+
* title field
|
|
233
|
+
*/
|
|
234
|
+
title: string;
|
|
235
|
+
};
|
|
227
236
|
/**
|
|
228
237
|
* Item with id and label dynamic type
|
|
229
238
|
*/
|
|
@@ -396,7 +405,7 @@ export type ListType = DataTypes.IdLabelItem<number>;
|
|
|
396
405
|
*/
|
|
397
406
|
export type ListType1 = DataTypes.IdLabelItem<string>;
|
|
398
407
|
/**
|
|
399
|
-
* List item with compatible id and name / label
|
|
408
|
+
* List item with compatible id and name / label / title
|
|
400
409
|
*/
|
|
401
410
|
export type ListType2 = {
|
|
402
411
|
id: DataTypes.IdType;
|
|
@@ -404,6 +413,8 @@ export type ListType2 = {
|
|
|
404
413
|
label: string;
|
|
405
414
|
} | {
|
|
406
415
|
name: string;
|
|
416
|
+
} | {
|
|
417
|
+
title: string;
|
|
407
418
|
});
|
|
408
419
|
/**
|
|
409
420
|
* Id default type
|
|
@@ -417,3 +428,9 @@ export type IdDefaultType<T extends object> = T extends {
|
|
|
417
428
|
export type LabelDefaultType<T extends object> = T extends {
|
|
418
429
|
label: string;
|
|
419
430
|
} ? DataTypes.Keys<T, string> & 'label' : DataTypes.Keys<T, string>;
|
|
431
|
+
/**
|
|
432
|
+
* Title default type
|
|
433
|
+
*/
|
|
434
|
+
export type TitleDefaultType<T extends object> = T extends {
|
|
435
|
+
title: string;
|
|
436
|
+
} ? DataTypes.Keys<T, string> & 'title' : DataTypes.Keys<T, string>;
|
package/lib/mjs/DataTypes.d.ts
CHANGED
|
@@ -224,6 +224,15 @@ export declare namespace DataTypes {
|
|
|
224
224
|
*/
|
|
225
225
|
name: string;
|
|
226
226
|
};
|
|
227
|
+
/**
|
|
228
|
+
* Item with id and title property
|
|
229
|
+
*/
|
|
230
|
+
type IdTitleItem<T extends IdType = number> = IdItem<T> & {
|
|
231
|
+
/**
|
|
232
|
+
* title field
|
|
233
|
+
*/
|
|
234
|
+
title: string;
|
|
235
|
+
};
|
|
227
236
|
/**
|
|
228
237
|
* Item with id and label dynamic type
|
|
229
238
|
*/
|
|
@@ -396,7 +405,7 @@ export type ListType = DataTypes.IdLabelItem<number>;
|
|
|
396
405
|
*/
|
|
397
406
|
export type ListType1 = DataTypes.IdLabelItem<string>;
|
|
398
407
|
/**
|
|
399
|
-
* List item with compatible id and name / label
|
|
408
|
+
* List item with compatible id and name / label / title
|
|
400
409
|
*/
|
|
401
410
|
export type ListType2 = {
|
|
402
411
|
id: DataTypes.IdType;
|
|
@@ -404,6 +413,8 @@ export type ListType2 = {
|
|
|
404
413
|
label: string;
|
|
405
414
|
} | {
|
|
406
415
|
name: string;
|
|
416
|
+
} | {
|
|
417
|
+
title: string;
|
|
407
418
|
});
|
|
408
419
|
/**
|
|
409
420
|
* Id default type
|
|
@@ -417,3 +428,9 @@ export type IdDefaultType<T extends object> = T extends {
|
|
|
417
428
|
export type LabelDefaultType<T extends object> = T extends {
|
|
418
429
|
label: string;
|
|
419
430
|
} ? DataTypes.Keys<T, string> & 'label' : DataTypes.Keys<T, string>;
|
|
431
|
+
/**
|
|
432
|
+
* Title default type
|
|
433
|
+
*/
|
|
434
|
+
export type TitleDefaultType<T extends object> = T extends {
|
|
435
|
+
title: string;
|
|
436
|
+
} ? DataTypes.Keys<T, string> & 'title' : DataTypes.Keys<T, string>;
|
package/package.json
CHANGED
package/src/DataTypes.ts
CHANGED
|
@@ -278,6 +278,16 @@ export namespace DataTypes {
|
|
|
278
278
|
name: string;
|
|
279
279
|
};
|
|
280
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Item with id and title property
|
|
283
|
+
*/
|
|
284
|
+
export type IdTitleItem<T extends IdType = number> = IdItem<T> & {
|
|
285
|
+
/**
|
|
286
|
+
* title field
|
|
287
|
+
*/
|
|
288
|
+
title: string;
|
|
289
|
+
};
|
|
290
|
+
|
|
281
291
|
/**
|
|
282
292
|
* Item with id and label dynamic type
|
|
283
293
|
*/
|
|
@@ -751,11 +761,11 @@ export type ListType = DataTypes.IdLabelItem<number>;
|
|
|
751
761
|
export type ListType1 = DataTypes.IdLabelItem<string>;
|
|
752
762
|
|
|
753
763
|
/**
|
|
754
|
-
* List item with compatible id and name / label
|
|
764
|
+
* List item with compatible id and name / label / title
|
|
755
765
|
*/
|
|
756
766
|
export type ListType2 = {
|
|
757
767
|
id: DataTypes.IdType;
|
|
758
|
-
} & ({ label: string } | { name: string });
|
|
768
|
+
} & ({ label: string } | { name: string } | { title: string });
|
|
759
769
|
|
|
760
770
|
/**
|
|
761
771
|
* Id default type
|
|
@@ -770,3 +780,10 @@ export type IdDefaultType<T extends object> = T extends { id: number | string }
|
|
|
770
780
|
export type LabelDefaultType<T extends object> = T extends { label: string }
|
|
771
781
|
? DataTypes.Keys<T, string> & 'label'
|
|
772
782
|
: DataTypes.Keys<T, string>;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Title default type
|
|
786
|
+
*/
|
|
787
|
+
export type TitleDefaultType<T extends object> = T extends { title: string }
|
|
788
|
+
? DataTypes.Keys<T, string> & 'title'
|
|
789
|
+
: DataTypes.Keys<T, string>;
|