I need help with extending a TypeScript interface where the property 'value' in the class is not being recognized as an array!
Here is the code snippet:
export class InListFilter<T, D=T[]> extends BaseFilter<T, D> {
constructor(props: Partial<BaseFilter<T>>) {
super(props);
}
getValue(): string {
let s: string[] = [];
if (this.value && this.value.length) { // <- Property length does not exist on type D
for (let v of this.value) {
v = this.getValueParsed(v);
s.push(this.enquoted ? `'${v}'` : `${v}`);
}
}
return s && s.length ? s.join(',') : '';
}
render(): string {
let s: string = '';
if (!this.field || !this.hasValue()) {
return s;
}
return `(${this.field} IN (${this.getValue()}))`;
}
}
Thank you for your assistance!