longcelot-sheet-db
Version:
Google Sheets-backed staging database adapter for Node.js with schema-first design
12 lines • 968 B
TypeScript
import { BooleanFormat, ColumnDefinition } from '../schema/types';
import { ColumnValidationRule } from '../adapter/sheetClient';
/**
* Maps boolean()/enum() columns to the Sheets data validation rules formatSheet()/extendValidation()
* apply. boolean() columns use ONE_OF_LIST (not the native BOOLEAN checkbox type) deliberately: Sheets'
* BOOLEAN validation writes a real FALSE into every blank cell it covers, while an unselected ONE_OF_LIST
* cell stays genuinely empty — see FAQ.md #10 for why that distinction is the actual root cause of the
* phantom-row issue for boolean() specifically. `defaultBooleanFormat` is the project-wide sheetStyle
* fallback; a column's own `booleanFormat` (set via `boolean({ format })`) takes priority.
*/
export declare function buildValidationRules(headers: string[], columns: Record<string, ColumnDefinition>, defaultBooleanFormat?: BooleanFormat): ColumnValidationRule[];
//# sourceMappingURL=validationRules.d.ts.map