I am facing a challenge in translating 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) {
this.self = self;
this.metadata = metadata;
this.expandAnyPaths = expandAnyPaths;
}
Despite my attempts to create constructors by referring to the examples provided, I have not been able to successfully implement them...
Do you have any suggestions or ideas?
constructor();
constructor(metadata: QueryMetadata);
constructor(metadata: QueryMetadata, expandAnyPaths: boolean);
constructor(self: T);
constructor(self: T, metadata: QueryMetadata);
constructor(???) {
this.self = self; <<< ???
this.metadata = selfOrMetadata; <<< ???
this.expandAnyPaths = expandAnyPaths;
}