Browse Source

refactor: allow to use string as DataType

e22m4u 2 months ago
parent
commit
0925e997a2
1 changed files with 13 additions and 8 deletions
  1. 13 8
      src/data-type.d.ts

+ 13 - 8
src/data-type.d.ts

@@ -1,11 +1,16 @@
 /**
  * Data type.
  */
-export declare enum DataType {
-  ANY = 'any',
-  STRING = 'string',
-  NUMBER = 'number',
-  BOOLEAN = 'boolean',
-  ARRAY = 'array',
-  OBJECT = 'object',
-}
+export declare const DataType: {
+  ANY: 'any';
+  STRING: 'string';
+  NUMBER: 'number';
+  BOOLEAN: 'boolean';
+  ARRAY: 'array';
+  OBJECT: 'object';
+};
+
+/**
+ * Type of DataType.
+ */
+export type DataType = (typeof DataType)[keyof typeof DataType];