public TypeScriptType ReferenceFrom(ITypeInfo type, TypeScriptUnit targetUnit, ITypeGenerator typeGenerator)
        {
            if (!type.Equals(Type))
            {
                throw new InvalidOperationException($"Expected type {Type} with different meta, but got different type: {type}");
            }

            return(TypeScriptGeneratorHelpers.BuildTargetNullableTypeByOptions(
                       ReferenceFromInternal(type, targetUnit, typeGenerator),
                       type.CanBeNull(typeGenerator.Options.NullabilityMode),
                       typeGenerator.Options));
        }