analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
20 lines • 980 B
TypeScript
import { QUESTION_TYPE } from '../components/Quiz/useQuizStore';
/**
* Maps API question type string to QUESTION_TYPE enum
* Converts input to uppercase for case-insensitive matching
*
* @param type - Question type string from API
* @param fallback - Optional fallback QUESTION_TYPE if mapping fails. If not provided, returns null
* @returns QUESTION_TYPE enum value or null/fallback if not found
*/
export declare function mapQuestionTypeToEnum(type: string, fallback?: QUESTION_TYPE): QUESTION_TYPE | null;
/**
* Maps API question type string to QUESTION_TYPE enum with required fallback
* Always returns a QUESTION_TYPE (never null)
*
* @param type - Question type string from API
* @param fallback - Fallback QUESTION_TYPE if mapping fails (defaults to ALTERNATIVA)
* @returns QUESTION_TYPE enum value
*/
export declare function mapQuestionTypeToEnumRequired(type: string, fallback?: QUESTION_TYPE): QUESTION_TYPE;
//# sourceMappingURL=questionTypeUtils.d.ts.map