Creating a card that draws cards... setConfig is not a function?

I’m trying to create a card that renders cards but am running into an error where the cards I’m creating are throwing a setConfig is not a function error?

Here is my renderCard code:

  private renderCard(card): LovelaceCard {
    let tag = card.type;
    if (tag.startsWith(this.CUSTOM_TYPE_PREFIX)) {
      tag = tag.substr(this.CUSTOM_TYPE_PREFIX.length);
    } else {
      tag = `hui-${tag}-card`;
    }

    const cardElement = document.createElement(tag) as LovelaceCard;
    cardElement.setConfig(card);
    cardElement.hass = hass();

    return cardElement;
  }

I’m sure there’s an “official” way of rendering cards from the provided config, I just haven’t been able to find a suitable example.

The whole component can be found here: tablet-card/tablet-card.ts at 9fbcc44e29747cd3bdac82559af9b335660dd64d · d2kagw/tablet-card · GitHub

Many thanks in advance for your help.

Look at strategies https://developers.home-assistant.io/docs/frontend/custom-ui/lovelace-custom-strategy

Thanks for the fast reply @ludeeus,
I’m still getting my head around HASS. How is strategies relevant to this situation?

With strategies you are in full controll of everything that is presented

Sorry, from the documentation I don’t think it’s what I’m after.
Here’s the lovelace view config I have right now…

  - icon: 'mdi:home'
    panel: true
    badges: []
    theme: noctis
    cards:
      - type: custom:tablet-card
        utility_cards:
          - type: picture-entity
            entity: camera.front_door
            camera_image: camera.front_door
            camera_view: live
            show_state: false
            show_name: false
        logo: /local/logo/logo.png
        screensaver_time: 600
        auto_refresh_time: 3600
        columns:
          - cards:
            - type: markdown
              content: >
                ## Lovelace something something
          - cards:
            - type: markdown
              content: >
                ## Lovelace something something

When I loop over the column cards, I call the renderCard method above, and that throws the setConfig error as outlined.