-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
enhancementNew feature or requestNew feature or requestts-interface-generatorRelated to the ts-interface-generator sub-packageRelated to the ts-interface-generator sub-package
Description
Hi.
There is an issue when generating interfaces for generic classes. Example:
import ManagedObject from "sap/ui/base/ManagedObject";
/**
* @namespace com.ts.test.tstest.util
*/
export default abstract class MyGenericClass<T> extends ManagedObject {
static readonly metadata: object = {
properties: {
test: "string"
}
}
}
Generated interface:
import { PropertyBindingInfo } from "sap/ui/base/ManagedObject";
import { $ManagedObjectSettings } from "sap/ui/base/ManagedObject";
declare module "./MyGenericClass" {
/**
* Interface defining the settings object used in constructor calls
*/
interface $MyGenericClassSettings extends $ManagedObjectSettings {
test?: string | PropertyBindingInfo;
}
export default interface MyGenericClass {
// property: test
getTest(): string;
setTest(test: string): this;
}
}
As a result, error message is shown: All declarations of 'MyGenericClass' must have identical type parameters
Which, basically, means, that generated interface should be:
export default interface MyGenericClass<T> {
// property: test
getTest(): string;
setTest(test: string): this;
}
Would it be possible to add generics to the interface?
Thanks!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestts-interface-generatorRelated to the ts-interface-generator sub-packageRelated to the ts-interface-generator sub-package