@getcronit/pylon-builder
Version:
37 lines (36 loc) • 944 B
TypeScript
import ts from 'typescript';
import { Schema } from './schema-parser.js';
export interface Union {
name: string;
rawType: ts.Type;
types: Array<string>;
}
export interface Enum {
name: string;
rawType: ts.Type;
values: Array<string>;
}
interface FieldDefinition {
name: string;
isList: boolean;
isRequired: boolean;
isListRequired?: boolean;
}
export declare class TypeDefinitionBuilder {
private checker;
private schema;
private typesNameMap;
private inputsNameMap;
private unions;
private enums;
constructor(checker: ts.TypeChecker, schema: Schema);
getTypeDefinition: (rawType: ts.Type, options?: {
isInputType?: boolean;
isRequired?: boolean;
propertyName?: string;
}) => FieldDefinition;
getUnions(): Array<Union>;
getEnums(): Array<Enum>;
typeDefinitionToGraphQLType: (typeDefinition: FieldDefinition) => string;
}
export {};