"use strict";
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
Object.defineProperty(exports, "__esModule", { value: true });
const getTypeClass_1 = require("./getTypeClass");
const getTypeDef_1 = require("./getTypeDef");
function createClass(registry, type) {
    return getTypeClass_1.getTypeClass(registry, getTypeDef_1.getTypeDef(type));
}
exports.createClass = createClass;
// An unsafe version of the `createType` below. It's unsafe because the `type`
// argument here can be any string, which, if it cannot be parsed, it will yield
// a runtime error.
function ClassOfUnsafe(registry, name) {
    return createClass(registry, name);
}
exports.ClassOfUnsafe = ClassOfUnsafe;
// alias for createClass
function ClassOf(registry, name) {
    // TS2589: Type instantiation is excessively deep and possibly infinite.
    // The above happens with as Constructor<InterfaceRegistry[K]>;
    return ClassOfUnsafe(registry, name);
}
exports.ClassOf = ClassOf;
