import { upperFirst, kebabCase, camelCase } from 'lodash'; import { GeneratorContext } from './SourcesGenerator'; import { ObjectType, Field } from '../model'; import { GraphQLEnumType, GraphQLEnumValueConfigMap } from 'graphql'; export { upperFirst, kebabCase, camelCase }; export declare function supplant(str: string, obj: Record): string; export declare function pascalCase(str: string): string; export declare function camelPlural(str: string): string; export declare function names(name: string): { [key: string]: string; }; export declare function withNames({ name }: { name: string; }): GeneratorContext; export declare function hasInterfaces(o: ObjectType): boolean; /** * Return fields which are not definded in the interface * * @param o - ObjecType definition */ export declare function ownFields(o: ObjectType): Field[]; export declare function interfaceRelations(o: ObjectType): { fieldName: string; }[]; export declare function generateJoinColumnName(name: string): string; export declare function generateJoinTableName(table1: string, table2: string): string; export declare function generateEntityImport(entityName: string): string; export declare function generateEntityServiceImport(name: string): string; export declare function generateResolverReturnType(type: string, isList: boolean): string; /** * replace all whitespaces and carriage returns with a whitesapace * * @param s - string to compat * @returns the same string with all whitecharacters removed */ export declare function compact(s: string): string; /** * Generate EnumField for interface filtering; filter interface by implementers * e.g `where: {type_in: [Type1, Type2]}` * * @param typeName - field type */ export declare function generateEnumField(typeName: string, apiOnly?: boolean): Field; export declare function generateGraphqlEnumType(name: string, values: GraphQLEnumValueConfigMap): GraphQLEnumType; export declare function generateEnumOptions(options: string[]): GraphQLEnumValueConfigMap;