@Test public void testTypeParentheses() { final Settings settings = TestUtils.settings(); assertEquals("string | number", new UnionType(Arrays.asList(String, Number)).format(settings)); assertEquals("string | number[]", new UnionType(Arrays.asList(String, new BasicArrayType(Number))).format(settings)); assertEquals("(string | number)[]", new BasicArrayType(new UnionType(Arrays.asList(String, Number))).format(settings)); assertEquals("(string | number)[][]", new BasicArrayType(new BasicArrayType(new UnionType(Arrays.asList(String, Number)))).format(settings)); assertEquals("{ [index: string]: string | number }", new IndexedArrayType(String, new UnionType(Arrays.asList(String, Number))).format(settings)); }
@Override public abstract String format(Settings settings);
TsType implements Emittable { @Override public abstract String format(Settings settings); }
TsType implements Emittable { @Override public abstract String format(Settings settings);  }
TsType implements Emittable { @Override public abstract String format(Settings settings);  @Override boolean equals(Object rhs); @Override int hashCode(); TsType.OptionalType optional(); @Override abstract String format(Settings settings); @Override String toString(); static TsType transformTsType(Context context, TsType tsType, Transformer transformer); }
TsType implements Emittable { @Override public abstract String format(Settings settings);  @Override boolean equals(Object rhs); @Override int hashCode(); TsType.OptionalType optional(); @Override abstract String format(Settings settings); @Override String toString(); static TsType transformTsType(Context context, TsType tsType, Transformer transformer); static final TsType Any; static final TsType Boolean; static final TsType Number; static final TsType String; static final TsType Date; static final TsType Void; static final TsType Undefined; static final TsType Null; static final TsType Never; static final TsType Unknown; }