UNPKG

2.73 kBTypeScriptView Raw
1import { Generator } from './Generator';
2import { GraphQLSchema, GraphQLUnionType, GraphQLInterfaceType, GraphQLInputObjectType, GraphQLInputField, GraphQLField, GraphQLInputType, GraphQLOutputType, GraphQLScalarType, GraphQLEnumType, GraphQLFieldMap, GraphQLObjectType } from 'graphql';
3import { Maybe } from './types';
4export declare class FlowGenerator extends Generator {
5 scalarMapping: {
6 Int: string;
7 String: string;
8 ID: string;
9 Float: string;
10 Boolean: string;
11 DateTime: string;
12 };
13 graphqlRenderers: {
14 GraphQLUnionType: (type: GraphQLUnionType) => string;
15 GraphQLObjectType: (type: GraphQLObjectType<any, any, {
16 [key: string]: any;
17 }> | GraphQLInterfaceType | GraphQLInputObjectType) => string;
18 GraphQLInterfaceType: (type: GraphQLObjectType<any, any, {
19 [key: string]: any;
20 }> | GraphQLInterfaceType | GraphQLInputObjectType) => string;
21 GraphQLInputObjectType: (type: GraphQLObjectType<any, any, {
22 [key: string]: any;
23 }> | GraphQLInterfaceType | GraphQLInputObjectType) => string;
24 GraphQLScalarType: (type: GraphQLScalarType) => string;
25 GraphQLIDType: (type: GraphQLScalarType) => string;
26 GraphQLEnumType: (type: GraphQLEnumType) => string;
27 };
28 constructor({ schema, inputSchemaPath, outputBindingPath, isDefaultExport, }: {
29 schema: GraphQLSchema;
30 inputSchemaPath: string;
31 outputBindingPath: string;
32 isDefaultExport: boolean;
33 });
34 render(): string;
35 renderExports(): string;
36 renderQueries(): string;
37 renderMutations(): string;
38 renderSubscriptions(): string;
39 getTypeNames(): string[];
40 renderTypes(): string;
41 renderMainMethodFields(operation: string, fields: GraphQLFieldMap<any, any>): string;
42 getPayloadType(operation: string, type: string): string;
43 renderInterfaceOrObject(type: GraphQLObjectType | GraphQLInputObjectType | GraphQLInterfaceType): string;
44 renderFieldName(field: GraphQLInputField | GraphQLField<any, any>): string;
45 renderFieldType(type: GraphQLInputType | GraphQLOutputType): string;
46 renderInputFieldType(type: GraphQLInputType | GraphQLOutputType): any;
47 renderTypeWrapper(typeName: string, typeDescription: Maybe<string>, fieldDefinition: string): string;
48 renderObjectWrapper(typeName: string, typeDescription: Maybe<string>, objects: GraphQLObjectType[], fieldDefinition: string): string;
49 renderInterfaceWrapper(typeName: string, typeDescription: Maybe<string>, interfaces: GraphQLInterfaceType[], fieldDefinition: string): string;
50 renderDescription(description: Maybe<string>): string;
51 renderImports(): string;
52}