/* eslint-disable max-classes-per-file */ import { OutputRef, outputShapeKey } from '../types'; import BaseTypeRef from './base'; import { InterfaceParam, InterfaceTypeOptions, parentShapeKey, SchemaTypes } from '..'; export default class InterfaceRef extends BaseTypeRef implements OutputRef, GiraphQLSchemaTypes.InterfaceRef { override kind = 'Interface' as const; [outputShapeKey]: T; [parentShapeKey]: P; constructor(name: string) { super('Interface', name); } } export class ImplementableInterfaceRef< Types extends SchemaTypes, Shape, Parent = Shape, > extends InterfaceRef { private builder: GiraphQLSchemaTypes.SchemaBuilder; constructor(builder: GiraphQLSchemaTypes.SchemaBuilder, name: string) { super(name); this.builder = builder; } implement[]>( options: InterfaceTypeOptions< Types, ImplementableInterfaceRef, Parent, Interfaces >, ) { return this.builder.interfaceType(this, options); } }