### Question:
AstTSRenderer { public void toTS(Metadata metadata) { toTS(metadata, new ArrayDeque<>()); } AstTSRenderer(TypeScriptWriter writer);  AstTSRenderer(TypeScriptWriter writer, boolean prettyPrint);  AstTSRenderer(TypeScriptWriter writer, FieldNameProvider fieldNameProvider, boolean prettyPrint); void toTS(Metadata metadata);  }### Answer:
@Test void test_mapping_rule() { GenericModel model = new GenericModel(); final ByteArrayOutputStream ops = new ByteArrayOutputStream(); DefaultTypeScriptWriter writer = new DefaultTypeScriptWriter(Locale.US, ops, BUNDLE); AstTSRenderer astTSRenderer = new AstTSRenderer(writer); IntegerFieldInfo twelve = model.intField(12, "twelve"); IntegerFieldInfo zero = model.intField(0, "zero"); MappingRule rule = DOOV.map(twelve).to(zero); astTSRenderer.toTS(rule.metadata()); for (FieldSpec fieldSpec : writer.getFields()) { if (fieldSpec.fieldInfo() instanceof IntegerFieldInfo) { System.out.println("const " + fieldSpec.field().readable() + " = DOOV.number(DOOV.field(('" + fieldSpec.field().id().code() + "'))"); } } System.out.println(new String(ops.toByteArray())); }