Interface SchemaProvider

An interface to be implemented by objects that initialize Joi schema objects.

interface SchemaProvider {
    init: ((props) => Promise<AnySchema<any>>);
    name: string | (() => string);
    schema?: ((props) => ObjectSchema<any>);
}

Properties

Properties

init: ((props) => Promise<AnySchema<any>>)

Initialize Joi schema

Type declaration

    • (props): Promise<AnySchema<any>>
    • Parameters

      Returns Promise<AnySchema<any>>

name: string | (() => string)

Name of the schema that this provider initializes.

Type declaration

    • (): string
    • Returns string

schema?: ((props) => ObjectSchema<any>)

Create a schema used to validate properties used to initialize a new schema.

Type declaration

    • (props): ObjectSchema<any>
    • Parameters

      • props: SchemaProps

      Returns ObjectSchema<any>

Generated using TypeDoc