import { type MultiCellRange } from './cell-range'; export type DataValidationType = 'whole' | 'decimal' | 'list' | 'date' | 'time' | 'textLength' | 'custom'; export type DataValidationOperator = 'between' | 'notBetween' | 'equal' | 'notEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual'; export type DataValidationErrorStyle = 'stop' | 'warning' | 'information'; export interface DataValidation { /** Constraint kind. `'list'` is the dropdown form (formula1 = comma list or range). */ type: DataValidationType; /** Comparison operator — only meaningful for whole/decimal/date/time/textLength. */ operator?: DataValidationOperator; /** Lower-bound formula or list source. Always required for list/whole/decimal/date/time. */ formula1?: string; /** Upper-bound formula. Used by between / notBetween only. */ formula2?: string; /** Allow empty cells. */ allowBlank?: boolean; /** Show the input message popover when the cell is selected. */ showInputMessage?: boolean; /** Show the error message popover on invalid entry. */ showErrorMessage?: boolean; errorTitle?: string; error?: string; errorStyle?: DataValidationErrorStyle; promptTitle?: string; prompt?: string; /** Excel inverts this attribute: `showDropDown="1"` actually *hides* the dropdown arrow on list-type validators. We mirror the wire form. */ showDropDown?: boolean; /** Apply-to range (sqref). */ sqref: MultiCellRange; } export declare function makeDataValidation(opts: Omit, 'sqref'> & { type: DataValidationType; sqref: MultiCellRange | string; }): DataValidation; import type { Worksheet } from './worksheet'; export interface ValidationCommon { /** Show the dropdown / input prompt when the cell is selected. */ prompt?: string; promptTitle?: string; /** Show an error dialog when the user types an invalid value. */ error?: string; errorTitle?: string; errorStyle?: DataValidationErrorStyle; allowBlank?: boolean; } /** * Add a list-type dropdown validation to a range. `values` may be an inline * list (`['Red', 'Green', 'Blue']`) or a sheet reference * (`'=Sheet1!$A$1:$A$10'`). */ export declare const addListValidation: (ws: Worksheet, sqref: MultiCellRange | string, values: ReadonlyArray | string, opts?: ValidationCommon) => DataValidation; /** * Add a number-range validation. `between(min, max)` matches Excel's "Whole * Number" → "between" form by default. Use `kind: 'decimal'` for decimal * (default 'whole'). */ export declare const addNumberValidation: (ws: Worksheet, sqref: MultiCellRange | string, range: { min: number; max?: number; operator?: DataValidationOperator; kind?: "whole" | "decimal"; }, opts?: ValidationCommon) => DataValidation; /** * Add a date-range validation. Dates are passed as Excel serial numbers (use * `dateToExcel` to convert from JS `Date`). */ export declare const addDateValidation: (ws: Worksheet, sqref: MultiCellRange | string, range: { min: number; max?: number; operator?: DataValidationOperator; }, opts?: ValidationCommon) => DataValidation; /** Add a custom-formula validation (`formula1` evaluated for each cell). */ export declare const addCustomValidation: (ws: Worksheet, sqref: MultiCellRange | string, formula: string, opts?: ValidationCommon) => DataValidation;