// AUTO-GENERATED by mizan — do not edit

import { mizanFetch } from '@mizan/base'

{% if !type_imports.is_empty() -%}
import type { {{ type_imports|join(", ") }} } from '../types'

{% endif -%}
export interface {{ pascal }}ContextData {
{%- for field in data_fields %}
    {{ field.name }}: {{ field.output_type }}
{%- endfor %}
}

{% if has_params -%}
export interface {{ pascal }}ContextParams {
{%- for p in params %}
    {{ p.name }}{% if !p.required %}?{% endif %}: {{ p.ts_type }}
{%- endfor %}
}
{%- else -%}
export type {{ pascal }}ContextParams = Record<string, never>
{%- endif %}

export function fetch{{ pascal }}Context(params: {{ pascal }}ContextParams): Promise<{{ pascal }}ContextData> {
    return mizanFetch('{{ ctx_name }}', params)
}

