UNPKG

@boostercloud/metadata-booster

Version:

Emits detailed metadata of your types. You can then get it in runtime to deal with schema-aware operation, like defining GraphQL schemas, ORM operations, etc.

21 lines (20 loc) 589 B
import * as ts from 'typescript'; import { TypeGroup } from './metadata-types'; export interface TypeInfo { name: string; typeName: string | null; parameters: Array<TypeInfo>; typeGroup: TypeGroup; isNullable: boolean; isGetAccessor: boolean; } export interface PropertyInfo { name: string; typeInfo: TypeInfo; } export interface ClassInfo { name: string; fields: Array<PropertyInfo>; methods: Array<PropertyInfo>; } export declare function getClassInfo(classNode: ts.ClassDeclaration & ts.Node, checker: ts.TypeChecker): ClassInfo | undefined;