"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function createTypeCheck(cls) {
    cls.implements = new Set();
    for (let baseClass of cls.baseClasses) {
        cls.implements.add(baseClass);
        for (let i of baseClass.implements) {
            cls.implements.add(i);
        }
    }
    return (instance) => {
        var _a;
        if (instance == null) {
            return false;
        }
        let ctor = instance.constructor;
        return ctor === cls || ((_a = ctor.implements) === null || _a === void 0 ? void 0 : _a.has(cls)) === true;
    };
}
exports.default = createTypeCheck;
