Initial upload with CI/CD workflow
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-01-31 12:25:58 +00:00
parent ade2c3be47
commit e135423634

60
src/types.ts Normal file
View File

@@ -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[];
}