I am struggling to convert these Java constructor overloads to Typescript:
public QueryMixin() {
this(null, new DefaultQueryMetadata(), true);
}
public QueryMixin(QueryMetadata metadata) {
this(null, metadata, true);
}
public QueryMixin(QueryMetadata metadata, boolean expandAnyPaths) {
this(null, metadata, expandAnyPaths);
}
public QueryMixin(T self) {
this(self, new DefaultQueryMetadata(), true);
}
public QueryMixin(T self, QueryMetadata metadata) {
this(self, metadata, true);
}
public QueryMixin(T self, QueryMetadata metadata, boolean expandAnyPaths) {//...}
I have attempted to create these constructors by referencing the examples provided, but I am unable to resolve the issue...
Do you have any suggestions?
constructor(); <<<1>>>
constructor(metadata: QueryMetadata);
constructor(metadata: QueryMetadata, expandAnyPaths: boolean);
constructor(self: T);
constructor(self: T, metadata: QueryMetadata);
constructor(selfOrMetadata: T | QueryMetadata, expandAnyPaths: boolean) {
this.self = selfOrMetadata; <<< PROBLEM HERE
this.metadata = selfOrMetadata; <<< PROBLEM HERE
this.expandAnyPaths = expandAnyPaths;
}
The compilation message at <<<1>>>
states:
Overload signature is not compatible with function implementation.