import { type InterfaceParam, type InterfaceTypeOptions, type OutputRef, outputShapeKey, type PothosInterfaceTypeConfig, parentShapeKey, type SchemaTypes, } from '../types'; import { TypeRefWithFields } from './base-with-fields'; export class InterfaceRef extends TypeRefWithFields implements OutputRef, PothosSchemaTypes.InterfaceRef { override kind = 'Interface' as const; $inferType!: T; [outputShapeKey]!: T; [parentShapeKey]!: P; constructor(name: string, config?: PothosInterfaceTypeConfig) { super('Interface', name, config); } } export class ImplementableInterfaceRef< Types extends SchemaTypes, Shape, Parent = Shape, > extends InterfaceRef { builder: PothosSchemaTypes.SchemaBuilder; constructor(builder: PothosSchemaTypes.SchemaBuilder, name: string) { super(name); this.builder = builder; } implement[]>( options: InterfaceTypeOptions< Types, ImplementableInterfaceRef, Parent, Interfaces >, ) { return this.builder.interfaceType(this, options); } }