@oslokommune/punkt-elements
Version:
Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo
17 lines (16 loc) • 912 B
TypeScript
import type { IHeaderFooterLocaleData, IMegaMenu, THeaderFooterApi, THeaderMenuLocale } from '../../shared-types/header-menu';
/**
* Pick the locale slice from a header/footer payload. Falls back to
* `nb-NO` when the requested locale is missing — the same fallback the
* legacy oslo.kommune.no header used.
*
* Returns `undefined` when the payload doesn't contain the fallback
* either (e.g. a malformed response). Callers should treat that as an
* error state.
*/
export declare function selectLocaleData<IconType = string>(api: THeaderFooterApi<IconType> | undefined, locale?: THeaderMenuLocale): IHeaderFooterLocaleData<IconType> | undefined;
/**
* Convenience wrapper that returns the `megamenu` slice for the given
* locale.
*/
export declare function selectMegamenu<IconType = string>(api: THeaderFooterApi<IconType> | undefined, locale?: THeaderMenuLocale): IMegaMenu<IconType> | undefined;