1 | import { DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, NamedTypeNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeDefinitionNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, TypeNode, TypeSystemDefinitionNode, TypeSystemExtensionNode, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql';
|
2 | import { ClassDeclaration, ClassDeclarationStructure, InterfaceDeclaration, InterfaceDeclarationStructure, ParameterDeclarationStructure, SourceFile } from 'ts-morph';
|
3 | export interface DefinitionsGeneratorOptions {
|
4 | |
5 |
|
6 |
|
7 |
|
8 | emitTypenameField?: boolean;
|
9 | |
10 |
|
11 |
|
12 |
|
13 | skipResolverArgs?: boolean;
|
14 | |
15 |
|
16 |
|
17 |
|
18 | defaultScalarType?: string;
|
19 | |
20 |
|
21 |
|
22 |
|
23 | customScalarTypeMapping?: Record<string, string | {
|
24 | name: string;
|
25 | }>;
|
26 | |
27 |
|
28 |
|
29 |
|
30 | defaultTypeMapping?: Partial<Record<'ID' | 'Boolean' | 'Float' | 'String' | 'Int', string>>;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 | additionalHeader?: string;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | enumsAsTypes?: boolean;
|
42 | }
|
43 | export declare class GraphQLAstExplorer {
|
44 | private readonly root;
|
45 | explore(documentNode: DocumentNode, outputPath: string, mode: 'class' | 'interface', options?: DefinitionsGeneratorOptions): Promise<SourceFile>;
|
46 | lookupDefinition(item: Readonly<TypeSystemDefinitionNode | TypeSystemExtensionNode>, tsFile: SourceFile, mode: 'class' | 'interface', options: DefinitionsGeneratorOptions): void | import("ts-morph").TypeAliasDeclaration;
|
47 | lookupRootSchemaDefinition(operationTypes: ReadonlyArray<OperationTypeDefinitionNode>, tsFile: SourceFile, mode: 'class' | 'interface'): void;
|
48 | addObjectTypeDefinition(item: ObjectTypeDefinitionNode | ObjectTypeExtensionNode | InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode | InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, tsFile: SourceFile, mode: 'class' | 'interface', options: DefinitionsGeneratorOptions): void;
|
49 | lookupFieldDefiniton(item: FieldDefinitionNode | InputValueDefinitionNode, parentRef: InterfaceDeclaration | ClassDeclaration, mode: 'class' | 'interface', options: DefinitionsGeneratorOptions): void;
|
50 | lookupField(item: FieldDefinitionNode | InputValueDefinitionNode, parentRef: InterfaceDeclaration | ClassDeclaration, mode: 'class' | 'interface', options: DefinitionsGeneratorOptions): void;
|
51 | getFieldTypeDefinition(typeNode: TypeNode, options: DefinitionsGeneratorOptions): {
|
52 | name: string;
|
53 | required: boolean;
|
54 | };
|
55 | unwrapTypeIfNonNull(type: TypeNode): {
|
56 | type: TypeNode;
|
57 | required: boolean;
|
58 | };
|
59 | getType(typeName: string, options: DefinitionsGeneratorOptions): string;
|
60 | getDefaultTypes(options: DefinitionsGeneratorOptions): {
|
61 | [type: string]: string;
|
62 | };
|
63 | getFunctionParameters(inputs: ReadonlyArray<InputValueDefinitionNode>, options: DefinitionsGeneratorOptions): ParameterDeclarationStructure[];
|
64 | addScalarDefinition(item: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, tsFile: SourceFile, options: DefinitionsGeneratorOptions): void;
|
65 | addExtendInterfaces(interfaces: NamedTypeNode[], parentRef: InterfaceDeclaration): void;
|
66 | addImplementsInterfaces(interfaces: NamedTypeNode[], parentRef: ClassDeclaration): void;
|
67 | addEnumDefinition(item: EnumTypeDefinitionNode | EnumTypeExtensionNode, tsFile: SourceFile, options: DefinitionsGeneratorOptions): import("ts-morph").TypeAliasDeclaration;
|
68 | addUnionDefinition(item: UnionTypeDefinitionNode | UnionTypeExtensionNode, tsFile: SourceFile): void;
|
69 | addSymbolIfRoot(name: string): string;
|
70 | isRoot(name: string): boolean;
|
71 | addClassOrInterface(tsFile: SourceFile, mode: 'class' | 'interface', options: InterfaceDeclarationStructure | ClassDeclarationStructure): InterfaceDeclaration | ClassDeclaration;
|
72 | getClassOrInterface(tsFile: SourceFile, mode: 'class' | 'interface', name: string): InterfaceDeclaration | ClassDeclaration;
|
73 | }
|
74 |
|
\ | No newline at end of file |