Skip to content

Some types are missing from divi-types #2

Description

@mattiaz9

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>'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions