export type ExtractComponentArgumentValue<C> = C extends ComponentArgument<
infer T
>
? T
: never;
export type ExtractStructuredComponentArgumentsValues<C> = {
[property in keyof C]: ExtractComponentArgumentValue<C[property]>;
};
export type T = ExtractComponentArgumentValue<Structured<any>>;
export abstract class ComponentArgument<ARG extends any> {
ARG!: ARG; // this is for some reason necessary to make the ExtractComponentArgumentValue work. It seems like this argument has to appear somewhere in the structure of the class to make it work. Possibly it can be made into some function argument or smth
abstract getTypeName(): string;
abstract getEmptyValue(): ARG;
}
export class ShortText extends ComponentArgument<string> {
getTypeName() {
return "short-text";
}
getEmptyValue() {
return "";
}
}
export class MarkdownArgument extends ComponentArgument<string> {