Type Alias DucBlock

DucBlock: {
    description?: string;
    id: BlockId;
    label: string;
    metadata?: DucBlockMetadata;
    thumbnail?: Uint8Array;
    version: number;
}

Defines the "Blueprint" for a reusable component.

Element Relationship Logic: The connection between this Block Definition and _DucElementBase depends on the state:

  1. Definition State (Source):

    • Elements that define the geometry of this block have this id inside their element.blockIds.
    • Their element.instanceId is null.
  2. Instance State (Usage):

    • When instantiated via DucBlockInstance, the rendered elements have element.instanceId set (not null).
    • Crucially, these instance elements have empty element.blockIds.
    • The relationship is resolved indirectly: Element.instanceId -> DucBlockInstance.blockId -> DucBlock.id.

Type declaration

  • Optionaldescription?: string
  • id: BlockId
  • label: string
  • Optionalmetadata?: DucBlockMetadata

    Block metadata including source, usage count, timestamps, and localization

  • Optionalthumbnail?: Uint8Array

    Cached thumbnail image for the block (webp format)

  • version: number