Sanity Library Reference Docs
    Preparing search index...

    Interface ObjectRule

    interface ObjectRule {
        custom: <LenientFieldValue extends Record<string, unknown>>(
            fn: CustomValidator<LenientFieldValue>,
        ) => ObjectRule;
        error: (message?: string | LocalizedValidationMessages) => ObjectRule;
        info: (message?: string | LocalizedValidationMessages) => ObjectRule;
        required: () => ObjectRule;
        valueOfField: (path: string | string[]) => FieldReference;
        warning: (message?: string | LocalizedValidationMessages) => ObjectRule;
    }

    Hierarchy (View Summary)

    Index

    Properties

    custom: <LenientFieldValue extends Record<string, unknown>>(
        fn: CustomValidator<LenientFieldValue>,
    ) => ObjectRule
    error: (message?: string | LocalizedValidationMessages) => ObjectRule
    info: (message?: string | LocalizedValidationMessages) => ObjectRule
    required: () => ObjectRule
    valueOfField: (path: string | string[]) => FieldReference
    warning: (message?: string | LocalizedValidationMessages) => ObjectRule