import { FetchHelper } from '../../../../globals/FetchHelper';
import type { EnvironmentName, MarketName } from '../../../../services/pn-refined-marketweb-context/pn-refined-marketweb-context.types';
import type { SiteHeaderI18N } from '../../pn-marketweb-siteheader/pn-marketweb-siteheader-types';
import type { HeaderApiPayload, HeaderContext, HeaderMenuMode, HeaderViewModel } from '../types/pn-marketweb-header.types';
/**
 * Input used when resolving/fetching/building header state.
 */
export interface LoadHeaderStateInput {
    market?: MarketName | null;
    language?: string | null;
    environment?: EnvironmentName | null;
    endpoint?: string | null;
    pageId?: string;
    cache?: boolean;
    hideHomeMenuItem: boolean;
    siteDomainInUrls: boolean;
    autocompleteEndpoint: string;
    searchPlaceholder: string;
}
/**
 * Result returned from service orchestration methods.
 */
export interface HeaderStateResult {
    context: HeaderContext;
    rawHeaderData: HeaderApiPayload | null;
    vm: HeaderViewModel | null;
    i18n: SiteHeaderI18N;
    status: 'ready' | 'error';
    /**
     * The currently active menu mode used by the wrapper component.
     *
     * This is preserved by the service during remaps, but the effective initial
     * value is resolved by the component layer.
     */
    activeMenuMode: HeaderMenuMode;
}
/**
 * Service responsible for:
 * - resolving the effective header context
 * - building the fetch URL for the header endpoint
 * - loading header data from the backend
 * - mapping backend data into a renderable header state
 *
 * This service uses the refined context service as the source of truth
 * for market/language/environment resolution.
 */
export declare class PnMarketwebHeaderService {
    private fetchHelper;
    private href;
    private doc;
    /**
     * Fixed backend path for loading header data.
     * This is appended to the resolved endpoint domain.
     */
    private endpointPath;
    constructor(fetchHelper: FetchHelper, href?: string, doc?: Document);
    /**
     * Resolves the effective header context.
     *
     * What it does:
     * - uses the RefinedMarketWebContextService to resolve context from the current URL/document
     * - lets explicit input values override resolved values when provided
     * - resolves endpoint from environment + market when endpoint is not explicitly passed in
     * - keeps pageId as part of the final header request context
     */
    private resolveContext;
    /**
     * Builds the final request URL used to fetch header JSON.
     *
     * What it does:
     * - removes a trailing slash from the endpoint base if needed
     * - appends the fixed header endpoint path
     * - adds query parameters for market, language and current page
     */
    private buildFetchUrl;
    /**
     * Fetches header data from the backend.
     *
     * Returns null when required context is missing.
     */
    private fetchHeaderData;
    /**
     * Builds i18n for the current language + presentation overrides.
     */
    private resolveI18n;
    /**
     * Maps raw header data into the current UI view model.
     */
    private mapViewModel;
    /**
     * Resolves context, fetches backend data and builds the final header state.
     */
    loadHeaderState(input: LoadHeaderStateInput): Promise<HeaderStateResult>;
    /**
     * Rebuilds the UI state from already-fetched raw backend data.
     * Use this when presentation-only inputs change and a refetch is not needed.
     */
    remapHeaderState(input: {
        context: HeaderContext;
        rawHeaderData: HeaderApiPayload | null;
        language?: string | null;
        hideHomeMenuItem: boolean;
        siteDomainInUrls: boolean;
        autocompleteEndpoint: string;
        searchPlaceholder: string;
        currentActiveMenuMode: HeaderMenuMode;
    }): HeaderStateResult;
}
