Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Adapt to new typescript-generator version
Browse files Browse the repository at this point in the history
  • Loading branch information
dangmai committed Nov 11, 2022
1 parent 92cfc05 commit 4d3a064
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/dangmai/types/CustomEnumExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,7 +30,7 @@ public List<TransformerDefinition> getTransformers() {
return Arrays.asList(
new TransformerDefinition(
ModelCompiler.TransformationPhase.BeforeEnums,
(ModelTransformer) (symbolTable, model) -> transformEnums(model)
(TsModelTransformer) (context, model) -> transformEnums(model)
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/dangmai/types/CustomFieldExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,7 +28,7 @@ public List<TransformerDefinition> 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())
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/dangmai/types/GenericNodeExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,7 +21,7 @@ public List<TransformerDefinition> getTransformers() {
return Arrays.asList(
new TransformerDefinition(
ModelCompiler.TransformationPhase.BeforeSymbolResolution,
(ModelTransformer) (symbolTable, model) -> addGenericNode(model)
(TsModelTransformer) (context, model) -> addGenericNode(model)
)
);
}
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/net/dangmai/types/UnionTypeExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -36,10 +35,6 @@ public List<Extension.TransformerDefinition> 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<Type, List<BeanModel>> createChildrenMap(Model model) {
Expand Down

0 comments on commit 4d3a064

Please sign in to comment.