Type alias ObtainDocumentType<DocDefinition, EnforcedDocType, TSchemaOptions>

ObtainDocumentType<DocDefinition, EnforcedDocType, TSchemaOptions>: IsItRecordAndNotAny<EnforcedDocType> extends true
    ? EnforcedDocType
    : {
        [K in keyof (RequiredPaths<DocDefinition, TSchemaOptions["typeKey"]> & OptionalPaths<DocDefinition, TSchemaOptions["typeKey"]>)]: ObtainDocumentPathType<DocDefinition[K], TSchemaOptions["typeKey"]>
    }

Type Parameters

  • DocDefinition

    A generic equals to the type of document definition "provided in as first parameter in Schema constructor".

  • EnforcedDocType = any

    A generic type enforced by user "provided before schema constructor".

  • TSchemaOptions extends Record<any, any> = DefaultSchemaOptions

Summary

Obtains document schema type.

Description

Obtains document schema type from document Definition OR returns enforced schema type if it's provided.

Param

A generic of literal string type."Refers to the property used for path type definition".

Generated using TypeDoc