Sanity Library Reference Docs
    Preparing search index...

    Interface BooleanRule

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

    Hierarchy (View Summary)

    Index

    Properties

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