deno.land / x / pothos@release-1713397530 / packages / core / refs / object.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, ObjectTypeOptions, OutputRef, outputShapeKey, parentShapeKey, SchemaTypes, } from '../types/index.ts';import BaseTypeRef from './base.ts';export default class ObjectRef<T, P = T> extends BaseTypeRef implements OutputRef, PothosSchemaTypes.ObjectRef<T, P> { override kind = "Object" as const; $inferType!: T; [outputShapeKey]!: T; [parentShapeKey]!: P; constructor(name: string) { super("Object", name); }}export class ImplementableObjectRef<Types extends SchemaTypes, Shape, Parent = Shape> extends ObjectRef<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: Omit<ObjectTypeOptions<Types, ImplementableObjectRef<Types, Shape, Parent>, Parent, Interfaces>, "name">): PothosSchemaTypes.ObjectRef<Shape, Parent> { return this.builder.objectType(this, options as ObjectTypeOptions<Types, ImplementableObjectRef<Types, Shape, Parent>, Parent, Interfaces>); }}
pothos

Version Info

Tagged at
a year ago