From 4d3a064cac8651b8b710f8559c575620e40c7033 Mon Sep 17 00:00:00 2001 From: Dang Mai Date: Fri, 11 Nov 2022 15:23:23 -0800 Subject: [PATCH] Adapt to new typescript-generator version --- src/main/java/net/dangmai/types/CustomEnumExtension.java | 4 ++-- src/main/java/net/dangmai/types/CustomFieldExtension.java | 4 ++-- src/main/java/net/dangmai/types/GenericNodeExtension.java | 4 ++-- src/main/java/net/dangmai/types/UnionTypeExtension.java | 5 ----- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/dangmai/types/CustomEnumExtension.java b/src/main/java/net/dangmai/types/CustomEnumExtension.java index a97a8c0..82a65ef 100644 --- a/src/main/java/net/dangmai/types/CustomEnumExtension.java +++ b/src/main/java/net/dangmai/types/CustomEnumExtension.java @@ -4,8 +4,8 @@ import cz.habarta.typescript.generator.TsProperty; import cz.habarta.typescript.generator.TsType; import cz.habarta.typescript.generator.compiler.ModelCompiler; -import cz.habarta.typescript.generator.compiler.ModelTransformer; import cz.habarta.typescript.generator.compiler.Symbol; +import cz.habarta.typescript.generator.compiler.TsModelTransformer; import cz.habarta.typescript.generator.emitter.*; import java.util.Arrays; @@ -30,7 +30,7 @@ public List getTransformers() { return Arrays.asList( new TransformerDefinition( ModelCompiler.TransformationPhase.BeforeEnums, - (ModelTransformer) (symbolTable, model) -> transformEnums(model) + (TsModelTransformer) (context, model) -> transformEnums(model) ) ); } diff --git a/src/main/java/net/dangmai/types/CustomFieldExtension.java b/src/main/java/net/dangmai/types/CustomFieldExtension.java index 022eb7f..c6f7a9d 100644 --- a/src/main/java/net/dangmai/types/CustomFieldExtension.java +++ b/src/main/java/net/dangmai/types/CustomFieldExtension.java @@ -3,7 +3,7 @@ import cz.habarta.typescript.generator.Extension; import cz.habarta.typescript.generator.TsType; import cz.habarta.typescript.generator.compiler.ModelCompiler; -import cz.habarta.typescript.generator.compiler.ModelTransformer; +import cz.habarta.typescript.generator.compiler.TsModelTransformer; import cz.habarta.typescript.generator.emitter.EmitterExtensionFeatures; import cz.habarta.typescript.generator.emitter.TsBeanModel; import cz.habarta.typescript.generator.emitter.TsModifierFlags; @@ -28,7 +28,7 @@ public List getTransformers() { return Arrays.asList( new TransformerDefinition( ModelCompiler.TransformationPhase.BeforeSymbolResolution, - (ModelTransformer) (symbolTable, model) -> model.withBeans( + (TsModelTransformer) (context, model) -> model.withBeans( model.getBeans().stream() .map(CustomFieldExtension.this::addCustomProperties) .collect(Collectors.toList()) diff --git a/src/main/java/net/dangmai/types/GenericNodeExtension.java b/src/main/java/net/dangmai/types/GenericNodeExtension.java index 4983f8a..381356a 100644 --- a/src/main/java/net/dangmai/types/GenericNodeExtension.java +++ b/src/main/java/net/dangmai/types/GenericNodeExtension.java @@ -3,8 +3,8 @@ import cz.habarta.typescript.generator.Extension; import cz.habarta.typescript.generator.TsType; import cz.habarta.typescript.generator.compiler.ModelCompiler; -import cz.habarta.typescript.generator.compiler.ModelTransformer; import cz.habarta.typescript.generator.compiler.Symbol; +import cz.habarta.typescript.generator.compiler.TsModelTransformer; import cz.habarta.typescript.generator.emitter.*; import java.util.Arrays; @@ -21,7 +21,7 @@ public List getTransformers() { return Arrays.asList( new TransformerDefinition( ModelCompiler.TransformationPhase.BeforeSymbolResolution, - (ModelTransformer) (symbolTable, model) -> addGenericNode(model) + (TsModelTransformer) (context, model) -> addGenericNode(model) ) ); } diff --git a/src/main/java/net/dangmai/types/UnionTypeExtension.java b/src/main/java/net/dangmai/types/UnionTypeExtension.java index b756914..c4f0a4d 100644 --- a/src/main/java/net/dangmai/types/UnionTypeExtension.java +++ b/src/main/java/net/dangmai/types/UnionTypeExtension.java @@ -5,7 +5,6 @@ import cz.habarta.typescript.generator.compiler.ModelTransformer; import cz.habarta.typescript.generator.compiler.SymbolTable; import cz.habarta.typescript.generator.emitter.EmitterExtensionFeatures; -import cz.habarta.typescript.generator.emitter.TsModel; import cz.habarta.typescript.generator.parser.BeanModel; import cz.habarta.typescript.generator.parser.Model; import cz.habarta.typescript.generator.util.Utils; @@ -36,10 +35,6 @@ public List getTransformers() { } public static class UnionTypeModelTransformer implements ModelTransformer { - @Override - public TsModel transformModel(SymbolTable symbolTable, TsModel model) { - return model; - } // This method is copied straight from a private method in // typescript-generator private Map> createChildrenMap(Model model) {