Add HostContract interface per design spec §2.4
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { Logger } from "@/observability/logger/types";
|
||||
|
||||
/**
|
||||
* Contract a host application must implement to embed this component
|
||||
* as an MF 2.0 remote. Both standalone SSR and remote modes satisfy
|
||||
* this interface; features depend only on HostContract and never on
|
||||
* the hosting mode.
|
||||
*/
|
||||
export interface HostContract {
|
||||
/** Resolved locale, e.g. "ru", "en". */
|
||||
locale: string;
|
||||
/** Canonical origin for SEO (e.g. "https://flights.aeroflot.ru"). */
|
||||
canonicalOrigin: string;
|
||||
/** Optional deep-link navigation override from the host router. */
|
||||
navigate?: (path: string) => void;
|
||||
/** Optional consent flags; absent == assumed true. */
|
||||
consent?: { analytics: boolean; telemetry: boolean };
|
||||
/** Optional host logger for log stream merging. */
|
||||
logger?: Logger;
|
||||
}
|
||||
Reference in New Issue
Block a user