{%- for name, versions in namespaces|items %}
{%- if versions|length > 1 %}
declare module "gi://{{ name }}" {
    {%- for version in versions %}
    import {{ name }}{{ version|replace(".", "") }} from "gi://{{ name }}?version={{ version }}"
    {%- endfor %}
    const {{ name }}: {%- for version in versions -%}
        | typeof {{ name }}{{ version|replace(".", "") }}
    {%- endfor %}
    export default {{ name }}
}
{%- else %}
{%- for version in versions %}
declare module "gi://{{ name }}" {
    import {{ name }} from "gi://{{ name }}?version={{ version }}"
    export default {{ name }}
}
{%- endfor %}
{%- endif %}
{%- endfor %}
