package com.semmle.ts.ast;

import com.semmle.js.ast.SourceLocation;
import com.semmle.js.ast.Visitor;

/** A type of form <tt>keyof T</tt> where <tt>T</tt> is a type. */
public class UnaryTypeExpr extends TypeExpression {
  private final ITypeExpression elementType;
  private final Kind kind;

  public enum Kind {
    Keyof,
    Readonly
  }

  public UnaryTypeExpr(SourceLocation loc, Kind kind, ITypeExpression elementType) {
    super("UnaryTypeExpr", loc);
    this.kind = kind;
    this.elementType = elementType;
  }

  public ITypeExpression getElementType() {
    return elementType;
  }

  public Kind getKind() {
    return kind;
  }

  @Override
  public <C, R> R accept(Visitor<C, R> v, C c) {
    return v.visit(this, c);
  }
}

@@ -104,68 +104,107 @@
 %0A/**
- A type of form %3Ctt%3Ekeyof T%3C/tt%3E where %3Ctt%3ET%3C/tt%3E is a type.
+%0A * A unary operator applied to a type.%0A *%0A * This can be %3Ctt%3Ekeyof T%3C/tt%3E or %3Ctt%3Ereadonly T%3C/tt%3E.%0A
  */%0A

Fix javadoc