UNPKG

1.49 kBTypeScriptView Raw
1import { GraphQLEnumType, GraphQLInputObjectType } from "graphql";
2import { CompilerOptions } from "apollo-codegen-core/lib/compiler";
3import * as t from "@babel/types";
4export declare type ObjectProperty = {
5 name: string;
6 description?: string | null | undefined;
7 annotation: t.FlowTypeAnnotation;
8};
9export interface FlowCompilerOptions extends CompilerOptions {
10 useFlowExactObjects: boolean;
11}
12export default class FlowGenerator {
13 options: FlowCompilerOptions;
14 typeAnnotationFromGraphQLType: Function;
15 constructor(compilerOptions: FlowCompilerOptions);
16 enumerationDeclaration(type: GraphQLEnumType): t.ExportNamedDeclaration;
17 inputObjectDeclaration(inputObjectType: GraphQLInputObjectType): t.TypeAlias;
18 objectTypeAnnotation(fields: ObjectProperty[], { keyInheritsNullability }?: {
19 keyInheritsNullability?: boolean;
20 }): t.ObjectTypeAnnotation;
21 typeAliasObject(name: string, fields: ObjectProperty[], { keyInheritsNullability, exact }?: {
22 keyInheritsNullability?: boolean;
23 exact?: boolean;
24 }): t.TypeAlias;
25 typeAliasObjectUnion(name: string, members: ObjectProperty[][]): t.TypeAlias;
26 typeAliasGenericUnion(name: string, members: t.FlowTypeAnnotation[]): t.TypeAlias;
27 exportDeclaration(declaration: t.Declaration, options?: {
28 comments?: string;
29 }): t.ExportNamedDeclaration;
30 annotationFromScopeStack(scope: string[]): t.GenericTypeAnnotation;
31}
32//# sourceMappingURL=language.d.ts.map
\No newline at end of file