"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isGradingResult = exports.isApiProvider = exports.isProviderOptions = void 0;
function isProviderOptions(provider) {
    return !isApiProvider(provider) && typeof provider === 'object';
}
exports.isProviderOptions = isProviderOptions;
function isApiProvider(provider) {
    return typeof provider === 'object' && 'id' in provider && typeof provider.id === 'function';
}
exports.isApiProvider = isApiProvider;
function isGradingResult(result) {
    return (typeof result === 'object' &&
        result !== null &&
        typeof result.pass === 'boolean' &&
        typeof result.score === 'number' &&
        typeof result.reason === 'string' &&
        (typeof result.namedScores === 'undefined' || typeof result.namedScores === 'object') &&
        (typeof result.tokensUsed === 'undefined' || typeof result.tokensUsed === 'object') &&
        (typeof result.componentResults === 'undefined' || Array.isArray(result.componentResults)) &&
        (typeof result.assertion === 'undefined' ||
            result.assertion === null ||
            typeof result.assertion === 'object') &&
        (typeof result.comment === 'undefined' || typeof result.comment === 'string'));
}
exports.isGradingResult = isGradingResult;
//# sourceMappingURL=types.js.map