diff --git a/index.ts b/index.ts index d8460a3..7b5e259 100644 --- a/index.ts +++ b/index.ts @@ -62,13 +62,10 @@ export enum TypeKind { UNION } -export interface TypeModel { - typeKind: TypeKind; +export type TypeModel = BasicType | ArrayType | UnionType; -} - -export interface BasicType extends TypeModel { - //typeName:string +export interface BasicType { + typeKind: TypeKind.BASIC; nameSpace: string; basicName: string; typeName: string; @@ -76,13 +73,15 @@ export interface BasicType extends TypeModel { modulePath: string; } -export interface ArrayType extends TypeModel { +export interface ArrayType { + typeKind: TypeKind.ARRAY; base: TypeModel; } -export type Arg = string|number|boolean; +export type Arg = string | number | boolean; -export interface UnionType extends TypeModel { +export interface UnionType { + typeKind: TypeKind.UNION; options: TypeModel[]; } @@ -174,4 +173,4 @@ export function classDecl(name: string, isInteface: boolean): ClassModel { export function parseStruct(content: string, modules: {[path: string]: Module}, mpth: string): Module { return tsStructureParser.parseStruct(content, modules, mpth); -} \ No newline at end of file +}