deno.land / x / pothos@release-1713397530 / packages / core / refs / interface.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// @ts-nocheck/* eslint-disable max-classes-per-file */import { InterfaceParam, InterfaceTypeOptions, OutputRef, outputShapeKey, parentShapeKey, SchemaTypes, } from '../types/index.ts';import BaseTypeRef from './base.ts';export default class InterfaceRef<T, P = T> extends BaseTypeRef implements OutputRef, PothosSchemaTypes.InterfaceRef<T, P> { override kind = "Interface" as const; $inferType!: T; [outputShapeKey]!: T; [parentShapeKey]!: P; constructor(name: string) { super("Interface", name); }}export class ImplementableInterfaceRef<Types extends SchemaTypes, Shape, Parent = Shape> extends InterfaceRef<Shape, Parent> { protected builder: PothosSchemaTypes.SchemaBuilder<Types>; constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string) { super(name); this.builder = builder; } implement<Interfaces extends InterfaceParam<Types>[]>(options: InterfaceTypeOptions<Types, ImplementableInterfaceRef<Types, Shape, Parent>, Parent, Interfaces>) { return this.builder.interfaceType(this, options); }}
pothos

Version Info

Tagged at
a year ago