1 | import { NameNode, TypeNode, NamedTypeNode, GraphQLObjectType, GraphQLNamedType, GraphQLSchema, StringValueNode, SelectionSetNode, FieldNode, SelectionNode, FragmentSpreadNode, InlineFragmentNode, GraphQLOutputType } from 'graphql';
|
2 | import { ScalarsMap, NormalizedScalarsMap, ParsedScalarsMap } from './types';
|
3 | export declare const getConfigValue: <T = any>(value: T, defaultValue: T) => T;
|
4 | export declare function quoteIfNeeded(array: string[], joinWith?: string): string;
|
5 | export declare function block(array: any): string;
|
6 | export declare function wrapWithSingleQuotes(value: string | number | NameNode): string;
|
7 | export declare function breakLine(str: string): string;
|
8 | export declare function indent(str: string, count?: number): string;
|
9 | export declare function indentMultiline(str: string, count?: number): string;
|
10 | export interface DeclarationBlockConfig {
|
11 | blockWrapper?: string;
|
12 | blockTransformer?: (block: string) => string;
|
13 | enumNameValueSeparator?: string;
|
14 | ignoreExport?: boolean;
|
15 | }
|
16 | export declare function transformComment(comment: string | StringValueNode, indentLevel?: number): string;
|
17 | export declare class DeclarationBlock {
|
18 | private _config;
|
19 | _decorator: any;
|
20 | _export: boolean;
|
21 | _name: any;
|
22 | _kind: any;
|
23 | _methodName: any;
|
24 | _content: any;
|
25 | _block: any;
|
26 | _nameGenerics: any;
|
27 | _comment: any;
|
28 | _ignoreBlockWrapper: boolean;
|
29 | constructor(_config: DeclarationBlockConfig);
|
30 | withDecorator(decorator: string): DeclarationBlock;
|
31 | export(exp?: boolean): DeclarationBlock;
|
32 | asKind(kind: string): DeclarationBlock;
|
33 | withComment(comment: string | StringValueNode | null): DeclarationBlock;
|
34 | withMethodCall(methodName: string, ignoreBlockWrapper?: boolean): DeclarationBlock;
|
35 | withBlock(block: string): DeclarationBlock;
|
36 | withContent(content: string): DeclarationBlock;
|
37 | withName(name: string | NameNode, generics?: string | null): DeclarationBlock;
|
38 | get string(): string;
|
39 | }
|
40 | export declare function getBaseTypeNode(typeNode: TypeNode): NamedTypeNode;
|
41 | export declare function convertNameParts(str: string, func: (str: string) => string, removeUnderscore?: boolean): string;
|
42 | export declare function buildScalars(schema: GraphQLSchema | undefined, scalarsMapping: ScalarsMap, defaultScalarsMapping?: NormalizedScalarsMap, defaultScalarType?: string): ParsedScalarsMap;
|
43 | export declare function isRootType(type: GraphQLNamedType, schema: GraphQLSchema): type is GraphQLObjectType;
|
44 | export declare function getRootTypeNames(schema: GraphQLSchema): string[];
|
45 | export declare function stripMapperTypeInterpolation(identifier: string): string;
|
46 | export declare const OMIT_TYPE = "export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;";
|
47 | export declare const REQUIRE_FIELDS_TYPE = "export type RequireFields<T, K extends keyof T> = { [X in Exclude<keyof T, K>]?: T[X] } & { [P in K]-?: NonNullable<T[P]> };";
|
48 | export declare function mergeSelectionSets(selectionSet1: SelectionSetNode, selectionSet2: SelectionSetNode): void;
|
49 | export declare const getFieldNodeNameValue: (node: FieldNode) => string;
|
50 | export declare function separateSelectionSet(selections: ReadonlyArray<SelectionNode>): {
|
51 | fields: FieldNode[];
|
52 | spreads: FragmentSpreadNode[];
|
53 | inlines: InlineFragmentNode[];
|
54 | };
|
55 | export declare function getPossibleTypes(schema: GraphQLSchema, type: GraphQLNamedType): GraphQLObjectType[];
|
56 | declare type WrapModifiersOptions = {
|
57 | wrapOptional(type: string): string;
|
58 | wrapArray(type: string): string;
|
59 | };
|
60 | export declare function wrapTypeWithModifiers(baseType: string, type: GraphQLOutputType, options: WrapModifiersOptions): string;
|
61 | export {};
|