@etsoo/shared 1.2.58 → 1.2.59

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 CHANGED
@@ -173,6 +173,7 @@ Data type definitions and type safe functions. ListItemType, ListItemType1 and L
173
173
  | StringDictionary | String key, string value Record |
174
174
  | StringRecord | String key, unknown value Record |
175
175
  | TitleDefaultType | Title default type |
176
+ | TristateEnum | Tristate enum |
176
177
  | VAlign | Vertical align |
177
178
  | VAlignEnum | Vertical align enum |
178
179
  | Methods | |
@@ -283,6 +283,27 @@ export declare namespace DataTypes {
283
283
  type DIS<K extends string, T> = {
284
284
  [P in K]: T;
285
285
  };
286
+ /**
287
+ * Tristate enum
288
+ * 三态枚举
289
+ */
290
+ enum TristateEnum {
291
+ /**
292
+ * False
293
+ * 假
294
+ */
295
+ False = 0,
296
+ /**
297
+ * True
298
+ * 真
299
+ */
300
+ True = 1,
301
+ /**
302
+ * Unsure
303
+ * 无法判断
304
+ */
305
+ Unsure = 9
306
+ }
286
307
  /**
287
308
  * Convert value to target type
288
309
  * @param input Input value
@@ -98,6 +98,28 @@ var DataTypes;
98
98
  PlacementEnum[PlacementEnum["BottomRight"] = 8] = "BottomRight";
99
99
  PlacementEnum[PlacementEnum["Unknown"] = 9] = "Unknown"; // Reserved for modal, only one instance held at the same time
100
100
  })(PlacementEnum = DataTypes.PlacementEnum || (DataTypes.PlacementEnum = {}));
101
+ /**
102
+ * Tristate enum
103
+ * 三态枚举
104
+ */
105
+ let TristateEnum;
106
+ (function (TristateEnum) {
107
+ /**
108
+ * False
109
+ * 假
110
+ */
111
+ TristateEnum[TristateEnum["False"] = 0] = "False";
112
+ /**
113
+ * True
114
+ * 真
115
+ */
116
+ TristateEnum[TristateEnum["True"] = 1] = "True";
117
+ /**
118
+ * Unsure
119
+ * 无法判断
120
+ */
121
+ TristateEnum[TristateEnum["Unsure"] = 9] = "Unsure";
122
+ })(TristateEnum = DataTypes.TristateEnum || (DataTypes.TristateEnum = {}));
101
123
  /**
102
124
  * Convert value to target type
103
125
  * @param input Input value
@@ -283,6 +283,27 @@ export declare namespace DataTypes {
283
283
  type DIS<K extends string, T> = {
284
284
  [P in K]: T;
285
285
  };
286
+ /**
287
+ * Tristate enum
288
+ * 三态枚举
289
+ */
290
+ enum TristateEnum {
291
+ /**
292
+ * False
293
+ * 假
294
+ */
295
+ False = 0,
296
+ /**
297
+ * True
298
+ * 真
299
+ */
300
+ True = 1,
301
+ /**
302
+ * Unsure
303
+ * 无法判断
304
+ */
305
+ Unsure = 9
306
+ }
286
307
  /**
287
308
  * Convert value to target type
288
309
  * @param input Input value
@@ -95,6 +95,28 @@ export var DataTypes;
95
95
  PlacementEnum[PlacementEnum["BottomRight"] = 8] = "BottomRight";
96
96
  PlacementEnum[PlacementEnum["Unknown"] = 9] = "Unknown"; // Reserved for modal, only one instance held at the same time
97
97
  })(PlacementEnum = DataTypes.PlacementEnum || (DataTypes.PlacementEnum = {}));
98
+ /**
99
+ * Tristate enum
100
+ * 三态枚举
101
+ */
102
+ let TristateEnum;
103
+ (function (TristateEnum) {
104
+ /**
105
+ * False
106
+ * 假
107
+ */
108
+ TristateEnum[TristateEnum["False"] = 0] = "False";
109
+ /**
110
+ * True
111
+ * 真
112
+ */
113
+ TristateEnum[TristateEnum["True"] = 1] = "True";
114
+ /**
115
+ * Unsure
116
+ * 无法判断
117
+ */
118
+ TristateEnum[TristateEnum["Unsure"] = 9] = "Unsure";
119
+ })(TristateEnum = DataTypes.TristateEnum || (DataTypes.TristateEnum = {}));
98
120
  /**
99
121
  * Convert value to target type
100
122
  * @param input Input value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.2.58",
3
+ "version": "1.2.59",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -40,7 +40,7 @@
40
40
  "@vitejs/plugin-react": "^4.3.4",
41
41
  "jsdom": "^26.0.0",
42
42
  "typescript": "^5.7.3",
43
- "vitest": "^2.1.8"
43
+ "vitest": "^3.0.2"
44
44
  },
45
45
  "dependencies": {
46
46
  "lodash.isequal": "^4.5.0"
package/src/DataTypes.ts CHANGED
@@ -356,6 +356,30 @@ export namespace DataTypes {
356
356
  */
357
357
  export type DIS<K extends string, T> = { [P in K]: T };
358
358
 
359
+ /**
360
+ * Tristate enum
361
+ * 三态枚举
362
+ */
363
+ export enum TristateEnum {
364
+ /**
365
+ * False
366
+ * 假
367
+ */
368
+ False = 0,
369
+
370
+ /**
371
+ * True
372
+ * 真
373
+ */
374
+ True = 1,
375
+
376
+ /**
377
+ * Unsure
378
+ * 无法判断
379
+ */
380
+ Unsure = 9
381
+ }
382
+
359
383
  /**
360
384
  * Convert value to target type
361
385
  * @param input Input value