import type { TSchema, SchemaOptions } from '../schema/index'; import { Kind } from '../symbols/index'; import { TUnsafe } from '../unsafe/index'; import { Static } from '../static/index'; export interface TRef extends TSchema { [Kind]: 'Ref'; static: unknown; $ref: Ref; } export type TRefUnsafe = TUnsafe>; /** `[Json]` Creates a Ref type.*/ export declare function Ref($ref: Ref, options?: SchemaOptions): TRef; /** * @deprecated `[Json]` Creates a Ref type. This signature was deprecated in 0.34.0 where Ref requires callers to pass * a `string` value for the reference (and not a schema). * * To adhere to the 0.34.0 signature, Ref implementations should be updated to the following. * * ```typescript * // pre-0.34.0 * * const T = Type.String({ $id: 'T' }) * * const R = Type.Ref(T) * ``` * should be changed to the following * * ```typescript * // post-0.34.0 * * const T = Type.String({ $id: 'T' }) * * const R = Type.Unsafe>(Type.Ref('T')) * ``` * You can also create a generic function to replicate the pre-0.34.0 signature if required * * ```typescript * const LegacyRef = (schema: T) => Type.Unsafe>(Type.Ref(schema.$id!)) * ``` */ export declare function Ref(type: Type, options?: SchemaOptions): TRefUnsafe;