import type { FieldMap, FieldNullability, InputFieldMap, InterfaceFieldsShape, InterfaceParam, Normalize, ObjectFieldsShape, ParentShape, SchemaTypes, TypeParam, UnionToIntersection, } from '@pothos/core'; import type { PothosSimpleObjectsPlugin } from '.'; import type { OutputShapeFromFields, SimpleObjectFieldsShape } from './types'; declare global { export namespace PothosSchemaTypes { export interface Plugins { simpleObjects: PothosSimpleObjectsPlugin; } export interface SchemaBuilder { simpleObject: < const Interfaces extends InterfaceParam[], Fields extends FieldMap, Shape extends Normalize< OutputShapeFromFields & UnionToIntersection> >, >( name: string, options: SimpleObjectTypeOptions, fields?: ObjectFieldsShape, ) => ObjectRef; simpleInterface: < const Interfaces extends InterfaceParam[], Fields extends FieldMap, Shape extends Normalize< OutputShapeFromFields & UnionToIntersection> >, >( name: string, options: SimpleInterfaceTypeOptions, fields?: InterfaceFieldsShape, ) => InterfaceRef; } export interface PothosKindToGraphQLType { SimpleObject: 'Object'; SimpleInterface: 'Interface'; } export interface FieldOptionsByKind< Types extends SchemaTypes, ParentShape, Type extends TypeParam, Nullable extends FieldNullability, Args extends InputFieldMap, ResolveShape, ResolveReturnShape, > { SimpleObject: ObjectFieldOptions< Types, ParentShape, Type, Nullable, Args, ResolveReturnShape >; SimpleInterface: InterfaceFieldOptions< Types, ParentShape, Type, Nullable, Args, ResolveReturnShape >; } export type SimpleObjectTypeOptions< Types extends SchemaTypes, Interfaces extends InterfaceParam[], Fields extends FieldMap, Shape, > = Omit< ObjectTypeOptions | ObjectTypeWithInterfaceOptions, 'fields' | 'interfaces' > & { interfaces?: (() => Interfaces) | Interfaces; fields?: SimpleObjectFieldsShape; }; export interface SimpleInterfaceTypeOptions< Types extends SchemaTypes, Interfaces extends InterfaceParam[], Fields extends FieldMap, Shape, > extends Omit, 'fields' | 'interfaces'> { interfaces?: (() => Interfaces) | Interfaces; fields?: SimpleObjectFieldsShape; } } }