import { GraphQLEnumTypeConfig, GraphQLEnumValueConfig } from 'graphql'; import { NexusArgDef, NexusAsArgConfig } from './args'; import { Maybe, SourceTypingDef } from './_types'; declare type TypeScriptEnumLike = { [key: number]: string; }; export interface EnumMemberInfo { /** The external "value" of the enum as displayed in the SDL */ name: string; /** The internal representation of the enum */ value?: string | number | object | boolean; /** The description to annotate the GraphQL SDL */ description?: Maybe; /** * Info about a field deprecation. Formatted as a string and provided with the deprecated directive on * field/enum types and as a comment on input fields. */ deprecation?: Maybe; /** * Custom extensions, as supported in graphql-js * * @see https://github.com/graphql/graphql-js/issues/1527 */ extensions?: GraphQLEnumValueConfig['extensions']; } export interface NexusEnumTypeConfig { name: TypeName; /** The description to annotate the GraphQL SDL */ description?: Maybe; /** Source type information for this type */ sourceType?: SourceTypingDef; /** All members of the enum, either as an array of strings/definition objects, as an object, or as a TypeScript enum */ members: ReadonlyArray | Record | TypeScriptEnumLike; /** * Custom extensions, as supported in graphql-js * * @see https://github.com/graphql/graphql-js/issues/1527 */ extensions?: GraphQLEnumTypeConfig['extensions']; /** Adds this type as a method on the Object/Interface definition blocks */ asNexusMethod?: string; } export declare class NexusEnumTypeDef { readonly name: TypeName; protected config: NexusEnumTypeConfig; constructor(name: TypeName, config: NexusEnumTypeConfig); get value(): NexusEnumTypeConfig; /** * Wraps the current enum as an argument, useful if you're defining the enumType inline for an individual field. * * @example * args: { * sort: enumType(config).asArg({ default: 'someValue' }) * } */ asArg(cfg?: NexusAsArgConfig): NexusArgDef; } export declare function enumType(config: NexusEnumTypeConfig): NexusEnumTypeDef; export {};