"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const typescript_1 = require("typescript");
const TYPED_TEST_REGEX = /__@TYPED_TEST@[0-9]+/;
function isTypedTestTestInterface(typeChecker) {
    return (node) => {
        if (node.kind === typescript_1.SyntaxKind.InterfaceDeclaration) {
            const type = typeChecker.getTypeAtLocation(node);
            const symbol = type.getSymbol();
            if (symbol && symbol.getName() === 'Test') {
                const properties = typeChecker.getPropertiesOfType(type);
                const escapedNames = properties.map(x => x.getEscapedName()).sort();
                return (escapedNames.length === 2 &&
                    TYPED_TEST_REGEX.test(escapedNames[0]) &&
                    escapedNames[1] === 'runTest' &&
                    symbol === typeChecker.getExportSymbolOfSymbol(symbol));
            }
        }
        return false;
    };
}
exports.isTypedTestTestInterface = isTypedTestTestInterface;
//# sourceMappingURL=isTypedTestTestInterface.js.map