UNPKG

1.13 kBTypeScriptView Raw
1import * as t from '@babel/types';
2import { AST, Fragment, Operation } from 'graphql-tool-utilities';
3import { EnumFormat } from '../../types';
4export interface Options {
5 schemaTypesPath: string;
6 enumFormat?: EnumFormat;
7 addTypename?: boolean;
8}
9export interface OperationOptions extends Options {
10 partial?: boolean;
11}
12export declare type NamespaceExportableType = t.TSInterfaceDeclaration;
13export declare class FileContext {
14 private path;
15 private options;
16 readonly schemaImports: t.ImportDeclaration | null;
17 private importedTypes;
18 constructor(path: string, options: Options);
19 import(type: string): void;
20}
21export declare class OperationContext {
22 operation: Operation | Fragment;
23 ast: AST;
24 options: OperationOptions;
25 file: FileContext;
26 readonly typeName: string;
27 readonly namespace: t.TSModuleDeclaration | null;
28 readonly exported: t.TSInterfaceDeclaration[];
29 private exportedTypes;
30 constructor(operation: Operation | Fragment, ast: AST, options: OperationOptions, file: FileContext);
31 export(type: NamespaceExportableType): t.TSTypeReference;
32}