all files / dist/factories/ StructureFactory.js

97.73% Statements 86/88
75% Branches 9/12
97.44% Functions 38/39
97.73% Lines 86/88
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135  739× 739×     27×     31×   11×         10×         22×   18×   12×   39× 13×     26×     32×   23×     10×         22×   20×         31×   10×   13×   21× 21× 12×   21×   299× 299×         20×     24×          
"use strict";
var binders = require("./../binders");
var definitions = require("./../definitions");
function bindToDefinition(binder, def) {
    binder.bind(def);
    return def;
}
var StructureFactory = (function () {
    /* istanbul ignore next */ function StructureFactory() {
    }
    StructureFactory.prototype.getCallSignature = function (structure) {
        return bindToDefinition(new binders.StructureCallSignatureBinder(this, structure), new definitions.CallSignatureDefinition());
    };
    StructureFactory.prototype.getCallSignatureParameter = function (structure) {
        return bindToDefinition(new binders.StructureCallSignatureParameterBinder(this, structure), new definitions.CallSignatureParameterDefinition());
    };
    StructureFactory.prototype.getClass = function (structure) {
        return bindToDefinition(new binders.StructureClassBinder(this, structure), new definitions.ClassDefinition());
    };
    StructureFactory.prototype.getClassConstructor = function (structure) {
        return bindToDefinition(new binders.StructureClassConstructorBinder(this, structure), new definitions.ClassConstructorDefinition());
    };
    StructureFactory.prototype.getClassConstructorParameter = function (structure) {
        return bindToDefinition(new binders.StructureClassConstructorParameterBinder(this, structure), new definitions.ClassConstructorParameterDefinition());
    };
    StructureFactory.prototype.getClassMethod = function (structure) {
        return bindToDefinition(new binders.StructureClassMethodBinder(this, structure), new definitions.ClassMethodDefinition());
    };
    StructureFactory.prototype.getClassMethodParameter = function (structure) {
        return bindToDefinition(new binders.StructureClassMethodParameterBinder(this, structure), new definitions.ClassMethodParameterDefinition());
    };
    StructureFactory.prototype.getClassProperty = function (structure) {
        return bindToDefinition(new binders.StructureClassPropertyBinder(this, structure), new definitions.ClassPropertyDefinition());
    };
    StructureFactory.prototype.getClassStaticMethod = function (structure) {
        return bindToDefinition(new binders.StructureClassStaticMethodBinder(this, structure), new definitions.ClassStaticMethodDefinition());
    };
    StructureFactory.prototype.getClassStaticMethodParameter = function (structure) {
        return bindToDefinition(new binders.StructureClassStaticMethodParameterBinder(this, structure), new definitions.ClassStaticMethodParameterDefinition());
    };
    StructureFactory.prototype.getClassStaticProperty = function (structure) {
        return bindToDefinition(new binders.StructureClassStaticPropertyBinder(this, structure), new definitions.ClassStaticPropertyDefinition());
    };
    StructureFactory.prototype.getDecorator = function (structure) {
        return bindToDefinition(new binders.StructureDecoratorBinder(this, structure), new definitions.DecoratorDefinition());
    };
    StructureFactory.prototype.getEnum = function (structure) {
        return bindToDefinition(new binders.StructureEnumBinder(this, structure), new definitions.EnumDefinition());
    };
    StructureFactory.prototype.getEnumMember = function (structure) {
        return bindToDefinition(new binders.StructureEnumMemberBinder(structure), new definitions.EnumMemberDefinition());
    };
    StructureFactory.prototype.getExpressionFromText = function (text) {
        if (typeof text === "string" && text.length > 0) {
            return bindToDefinition(new binders.StructureExpressionBinder(text), new definitions.ExpressionDefinition());
        }
        else {
            return null;
        }
    };
    StructureFactory.prototype.getFile = function (structure) {
        return bindToDefinition(new binders.StructureFileBinder(this, structure), new definitions.FileDefinition());
    };
    StructureFactory.prototype.getFunction = function (structure) {
        return bindToDefinition(new binders.StructureFunctionBinder(this, structure), new definitions.FunctionDefinition());
    };
    StructureFactory.prototype.getFunctionParameter = function (structure) {
        return bindToDefinition(new binders.StructureFunctionParameterBinder(this, structure), new definitions.FunctionParameterDefinition());
    };
    StructureFactory.prototype.getImport = function (structure) {
        return bindToDefinition(new binders.StructureImportBinder(this, structure), new definitions.ImportDefinition());
    };
    StructureFactory.prototype.getDefaultImportPartByName = function (importName) {
        return bindToDefinition(new binders.StructureDefaultImportPartBinder(importName), new definitions.DefaultImportPartDefinition());
    };
    StructureFactory.prototype.getIndexSignature = function (structure) {
        return bindToDefinition(new binders.StructureIndexSignatureBinder(this, structure), new definitions.IndexSignatureDefinition());
    };
    StructureFactory.prototype.getReExport = function (structure) {
        return bindToDefinition(new binders.StructureReExportBinder(this, structure), new definitions.ReExportDefinition());
    };
    StructureFactory.prototype.getNamedImportPart = function (structure) {
        return bindToDefinition(new binders.StructureNamedImportPartBinder(structure), new definitions.NamedImportPartDefinition());
    };
    StructureFactory.prototype.getInterface = function (structure) {
        return bindToDefinition(new binders.StructureInterfaceBinder(this, structure), new definitions.InterfaceDefinition());
    };
    StructureFactory.prototype.getInterfaceMethod = function (structure) {
        return bindToDefinition(new binders.StructureInterfaceMethodBinder(this, structure), new definitions.InterfaceMethodDefinition());
    };
    StructureFactory.prototype.getInterfaceProperty = function (structure) {
        return bindToDefinition(new binders.StructureInterfacePropertyBinder(this, structure), new definitions.InterfacePropertyDefinition());
    };
    StructureFactory.prototype.getInterfaceMethodParameter = function (structure) {
        return bindToDefinition(new binders.StructureInterfaceMethodParameterBinder(this, structure), new definitions.InterfaceMethodParameterDefinition());
    };
    StructureFactory.prototype.getNamespace = function (structure) {
        return bindToDefinition(new binders.StructureNamespaceBinder(this, structure), new definitions.NamespaceDefinition());
    };
    StructureFactory.prototype.getObjectProperty = function (structure) {
        return bindToDefinition(new binders.StructureObjectPropertyBinder(this, structure), new definitions.ObjectPropertyDefinition());
    };
    StructureFactory.prototype.getTypeAlias = function (structure) {
        return bindToDefinition(new binders.StructureTypeAliasBinder(this, structure), new definitions.TypeAliasDefinition());
    };
    StructureFactory.prototype.getTypeFromDefinitionAndTypeArguments = function (definition, typeArguments) {
        var text = definition.name || "any";
        if (typeArguments.length > 0) {
            text += "<" + typeArguments.join(", ") + ">";
        }
        return this.getTypeFromText(text);
    };
    StructureFactory.prototype.getTypeFromText = function (text) {
        text = text || "any";
        return bindToDefinition(new binders.StructureTypeBinder(this, text), new definitions.TypeDefinition());
    };
    StructureFactory.prototype.getTypeNodeFromText = function (text) {
        text = text || "any";
        return bindToDefinition(new binders.StructureTypeNodeBinder(this, text), new definitions.TypeNodeDefinition());
    };
    StructureFactory.prototype.getTypeParameter = function (structure) {
        return bindToDefinition(new binders.StructureTypeParameterBinder(this, structure), new definitions.TypeParameterDefinition());
    };
    StructureFactory.prototype.getUserDefinedTypeGuard = function (structure) {
        return bindToDefinition(new binders.StructureUserDefinedTypeGuardBinder(this, structure), new definitions.UserDefinedTypeGuardDefinition());
    };
    StructureFactory.prototype.getVariable = function (structure) {
        return bindToDefinition(new binders.StructureVariableBinder(this, structure), new definitions.VariableDefinition());
    };
    return StructureFactory;
}());
exports.StructureFactory = StructureFactory;
 
//# sourceMappingURL=StructureFactory.js.map