function emitSerializedTypeNode(node) {
                if (node) {
                    switch (node.kind) {
                        case 103 /* VoidKeyword */:
                            write("void 0");
                            return;
                        case 160 /* ParenthesizedType */:
                            emitSerializedTypeNode(node.type);
                            return;
                        case 152 /* FunctionType */:
                        case 153 /* ConstructorType */:
                            write("Function");
                            return;
                        case 156 /* ArrayType */:
                        case 157 /* TupleType */:
                            write("Array");
                            return;
                        case 150 /* TypePredicate */:
                        case 120 /* BooleanKeyword */:
                            write("Boolean");
                            return;
                        case 130 /* StringKeyword */:
                        case 9 /* StringLiteral */:
                            write("String");
                            return;
                        case 128 /* NumberKeyword */:
                            write("Number");
                            return;
                        case 131 /* SymbolKeyword */:
                            write("Symbol");
                            return;
                        case 151 /* TypeReference */:
                            emitSerializedTypeReferenceNode(node);
                            return;
                        case 154 /* TypeQuery */:
                        case 155 /* TypeLiteral */:
                        case 158 /* UnionType */:
                        case 159 /* IntersectionType */:
                        case 117 /* AnyKeyword */:
                            break;
                        default:
                            ts.Debug.fail("Cannot serialize unexpected type node.");
                            break;
                    }
                }
                write("Object");
            }
Serializes the type of a declaration to an appropriate JS constructor value. Used by the __metadata decorator for a class member.