import { type DataElementType } from '@tamanu/constants';
interface Component {
    dataElement?: {
        code?: string;
        type?: DataElementType;
    };
}
export type Binaryish = boolean | 'true' | 'false' | 'Yes' | 'No' | '1' | '0';
export type BinaryAnswer = Binaryish | null | undefined;
/**
 * - Desktop form state uses and persists to database 'true' | 'false'
 * - Mobile persists to database 'Yes' | 'No'
 * - `visibilityCriteria` has historically used 'Yes' | 'No'
 * - Reports may receive '1' | '0' from some clients
 */
export declare function normalizeBinaryAnswer(answer: BinaryAnswer): boolean | null | undefined;
export declare function convertBinaryToYesNo(answer: BinaryAnswer): 'Yes' | 'No' | Exclude<BinaryAnswer, Binaryish>;
export declare function checkJSONCriteria(criteria: string, allComponents: Component[], values: Record<string, any>): boolean;
/**
 * Returns question codes referenced in form visibility criteria JSON.
 * @param visibilityCriteria - JSON string e.g. '{"QUESTION_CODE": "Yes"}'
 */
export declare function getQuestionCodesFromFormVisibilityCriteria(visibilityCriteria: string): string[];
/**
 * Evaluates form-level visibility criteria (same JSON format as question-level visibility).
 * @param criteria - JSON string e.g. '{"QUESTION_CODE": "Yes"}'
 * @param valuesByCode - Map of question code to last answer value
 * @param dataElementTypesByCode - Map of question code to ProgramDataElement type (for multi-select handling)
 */
export declare function checkFormVisibilityCriteria(criteria: string, valuesByCode: Record<string, any>, dataElementTypesByCode?: Record<string, DataElementType>): boolean;
export {};
//# sourceMappingURL=criteria.d.ts.map