@oslokommune/punkt-react
Version:
React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo
17 lines (16 loc) • 852 B
TypeScript
import { DEFAULT_HEADER_FOOTER_URL, type THeaderFooterApi } from '../../shared-types/header-footer';
export { DEFAULT_HEADER_FOOTER_URL };
/** Clear the shared payload cache. Intended for tests. */
export declare function resetHeaderFooterDataCache(): void;
/**
* Fetch and parse the Oslo kommune header/footer JSON payload.
*
* Throws on HTTP errors and on invalid JSON. The caller is responsible
* for surfacing or hiding errors — the Lit element, for example, hides
* the menu and dispatches a `data-error` event.
*
* `signal` lets callers abort their own wait when the component
* disconnects; the underlying request is shared and keeps running for
* any other component awaiting the same URL.
*/
export declare function fetchHeaderFooterData<IconType = string>(url?: string, signal?: AbortSignal): Promise<THeaderFooterApi<IconType>>;