Search in sources :

Example 1 with TSNamedElement

use of io.crnk.gen.typescript.model.TSNamedElement in project crnk-framework by crnk-project.

the class TSImportProcessor method processType.

private static void processType(TSSource source, TSNamedElement type) {
    TSSource refSource = getSource(type);
    // no need for inclusions of primitive types and within same file
    if (!(type instanceof TSPrimitiveType || source == refSource)) {
        TSNamedElement importedType = type;
        if (type.getParent() instanceof TSModule) {
            importedType = (TSNamedElement) type.getParent();
        }
        addImport(refSource, source, importedType);
    }
}
Also used : TSPrimitiveType(io.crnk.gen.typescript.model.TSPrimitiveType) TSModule(io.crnk.gen.typescript.model.TSModule) TSSource(io.crnk.gen.typescript.model.TSSource) TSNamedElement(io.crnk.gen.typescript.model.TSNamedElement)

Aggregations

TSModule (io.crnk.gen.typescript.model.TSModule)1 TSNamedElement (io.crnk.gen.typescript.model.TSNamedElement)1 TSPrimitiveType (io.crnk.gen.typescript.model.TSPrimitiveType)1 TSSource (io.crnk.gen.typescript.model.TSSource)1