From e1354236346c2ace9170a5043dd052afaf747b2a Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 12:25:58 +0000 Subject: [PATCH] Initial upload with CI/CD workflow --- src/types.ts | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/types.ts diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..d6e446c --- /dev/null +++ b/src/types.ts @@ -0,0 +1,60 @@ +export interface TypeDefinition { + name: string; + type: TypeNode; +} + +export type TypeNode = + | PrimitiveType + | ArrayType + | ObjectType + | UnionType + | LiteralType + | OptionalType; + +export interface PrimitiveType { + kind: 'primitive'; + type: 'string' | 'number' | 'boolean' | 'null' | 'unknown' | 'any'; +} + +export interface ArrayType { + kind: 'array'; + elementType: TypeNode; +} + +export interface ObjectType { + kind: 'object'; + properties: Property[]; + name?: string; +} + +export interface Property { + name: string; + type: TypeNode; + optional: boolean; +} + +export interface UnionType { + kind: 'union'; + types: TypeNode[]; +} + +export interface LiteralType { + kind: 'literal'; + value: string | number | boolean; +} + +export interface OptionalType { + kind: 'optional'; + type: TypeNode; +} + +export interface TypeInferenceOptions { + rootName?: string; + detectUnions?: boolean; + literalThreshold?: number; +} + +export interface ParseResult { + types: TypeDefinition[]; + warnings: string[]; +}