Interface ModelSchemaField<TValue>

Shape each manifest schema entry must satisfy. The type system extracts the validated value via validate, while the other flags drive runtime behaviour (virtual fields, defaults, sensitivity, etc.).

interface ModelSchemaField<TValue = unknown> {
    defaultValue?: TValue | () => TValue;
    getDefault?: () => TValue;
    hasDefault?: boolean;
    isSensitive?: boolean;
    isVirtual?: boolean;
    validate(value: unknown, fieldName?: string): TValue;
}

Type Parameters

  • TValue = unknown

Properties

defaultValue?: TValue | () => TValue
getDefault?: () => TValue
hasDefault?: boolean
isSensitive?: boolean
isVirtual?: boolean

Methods