I’m unsure how to cast Attributes to their actual concrete types when generating TS defs.
For example:
export interface Test extends Schema.Component {
attributes: {
title: Attribute.String;
};
}
const hello = {
title: "Title", // This doesn't work.
} as Test;
With the implementation above I recieve this error:
Svelte: Conversion of type { section: StringAttribute; } to type Test may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to unknown first. Type 'StringAttribute' is not comparable to type 'string'.
Using as unknown as string
everywhere is a bit cumbersome.
Any help would be appreciated.