import { typedSchemas } from "../../widgets/registry"; /** * Calculates the greatest common divisor (GCD) of two numbers using the Euclidean algorithm. * @param a The first number. * @param b The second number. * @returns The GCD of a and b. */ export declare function gcd(a: number, b: number): number; /** * Determines if a fraction results in a terminating decimal. * A fraction terminates if and only if the prime factors of its simplified denominator are only 2s and 5s. * @param numerator The numerator of the fraction. * @param denominator The denominator of the fraction. * @returns True if the fraction terminates, false otherwise. */ export declare function isTerminatingFraction(numerator: number, denominator: number): boolean; export declare function encodeDataUri(content: string): string; export declare function isValidWidgetType(type: string): type is keyof typeof typedSchemas; /** * Attempts to approximate simple multiplicative/divisive expressions that include π or pi * by replacing pi with the provided approximation (default 3.14) and evaluating the expression. * * Supported forms (case-insensitive for "pi"): * - "144*pi", "pi*144", "144pi" (implicit multiplication), "pi144" (rare, but treated as pi*144) * - Chains with '*' and '/' only, e.g. "3/2*pi", "pi/4", "6*pi/5", "(144) * (pi)" * Parentheses are allowed but only for grouping; no addition/subtraction is supported. * * Returns a normalized decimal string if evaluation succeeds, otherwise null. */ export declare function tryApproximatePiProduct(rawExpr: string, piApprox?: number): string | null; /** * Normalizes a string part for use in a derived QTI identifier. * Converts to upper snake case and removes invalid characters. * @param part The string part to normalize. * @returns The normalized string. */ export declare function normalizeIdPart(part: string): string; /** * Derives a deterministic, QTI-safe combo identifier from a path of response parts. * @param pathParts An array of strings, where each string is a response-value pair (e.g., "RESPONSE_1_A"). * @returns The fully-formed combo identifier (e.g., "FB__RESPONSE_1_A__RESPONSE_2_CORRECT"). */ export declare function deriveComboIdentifier(pathParts: string[]): string; //# sourceMappingURL=helpers.d.ts.map