Interface Definitions<D>

a type for gradually building a definitions schema

interface Definitions<D> {
    build<const T, const S>(val): CompiledSchema<T, {
        [K in string | number | symbol]: (S & Record<"definitions", {
            [R in string | number | symbol]: D[R] extends CompiledSchema<unknown, S>
                ? S
                : never
        }>)[K]
    }>;
    def<const R, const T, const S>(name, val): Definitions<{
        [K in string | number | symbol]: (D & Record<R, CompiledSchema<T, S>>)[K]
    }>;
}

Type Parameters

Methods

Methods

  • build the definitions into a compiled schema

    Type Parameters

    • const T
    • const S

    Parameters

    Returns CompiledSchema<T, {
        [K in string | number | symbol]: (S & Record<"definitions", {
            [R in string | number | symbol]: D[R] extends CompiledSchema<unknown, S>
                ? S
                : never
        }>)[K]
    }>