I'm looking into these examples but I noticed I have a few type errors when trying to use them in my codebase.
For instance:
import { type Metadata } from "@divi/types"
import { type Attrs } from "./types"
export const moduleDefaultPrintedStyleAttributes: Metadata.DefaultAttributes<Attrs> = {
title: {
decoration: {
font: {
font: {
desktop: {
value: {
headingLevel: "h2",
weight: "400",
size: "26px",
letterSpacing: "0px",
lineHeight: "1em",
},
},
},
},
},
},
}
gives this error: namespace Metadata has no exported member 'DefaultAttributes'
Also when defining the module like this:
export const module: ModuleLibrary.Module.RegisterDefinition<Attrs> = {
metadata: moduleMetaData,
defaultAttrs: moduleDefaultRenderAttributes,
defaultPrintedStyleAttrs: moduleDefaultPrintedStyleAttributes,
renderers: {
edit: Edit,
},
placeholderContent,
conversionOutline,
}
I get this error: Object literal may only specify known properties, and 'defaultAttrs' does not exist in type 'RegisterDefinition<Attrs, ModuleAttrs>'
I'm looking into these examples but I noticed I have a few type errors when trying to use them in my codebase.
For instance:
gives this error:
namespace Metadata has no exported member 'DefaultAttributes'Also when defining the module like this:
I get this error:
Object literal may only specify known properties, and 'defaultAttrs' does not exist in type 'RegisterDefinition<Attrs, ModuleAttrs>'