There is a problem in this area
if (components[i] == **TextOptionType**) {
I'm self-debugging a plug-in for a program called obsidian.
~ObsidianDevLibrary.ts is located at Importing ~type.ts.
There is a problem in referring to TextOptionType as a value.
How can I solve this?
type.ts
export type TextOptionType = {
[propName: string] : any,
key: string,
placeholder?: string,
autoSave?: boolean,
value?: boolean,
onChange?: onChangeType,
}
ObsidianDevLibrary.ts
for (let i = 0; i < components.length; i++) {
if (components[i] == TextOptionType) {
componentsToReturn.push(this.addText(setting, components[i]))
}
}
Maybe comparing TextOptionType with if is wrong grammar, but I don't know the right way.
It may be intended to verify that the data entering the component is formatted
components?