import { getElement , getLocation } from "~/browser" ; /**
 * Feature flag
 */ export type Flag = "content.code.annotate" | "header.autohide" | "navigation.expand" | "navigation.indexes" | "navigation.instant" | "navigation.sections" | "navigation.tabs" | "navigation.tabs.sticky" | "navigation.top" | "navigation.tracking" | "search.highlight" | "search.share" | "search.suggest" | "toc.integrate" ; /**
 * Translation
 */ export type Translation = "clipboard.copy" | "clipboard.copied" | "search.config.lang" | "search.config.pipeline" | "search.config.separator" | "search.placeholder" | "search.result.placeholder" | "search.result.none" | "search.result.one" | "search.result.other" | "search.result.more.one" | "search.result.more.other" | "search.result.term.missing" | "select.version.title" ; /**
 * Translations
 */ export type Translations = Record < Translation , string > ; /**
 * Versioning
 */ export interface Versioning { provider : "mike" ; default ? : string ; } /**
 * Configuration
 */ export interface Config { base : string ; features : Flag [ ] ; translations : Translations ; search : string ; version ? : Versioning ; } /**
 * Retrieve global configuration and make base URL absolute
 */ const script = getElement ( "#__config" ) ; const config = JSON . parse ( script . textContent ! ) ; config . base = `${ new URL ( config . base , getLocation ( ) ) }` ; returns export function configuration ( ) { return config ; } param flag returns export function feature ( flag ) { return config . features . includes ( flag ) ; } param key param value returns export function translation ( key , value ? ) { return typeof value !== "undefined" ? config . translations [ key ] . replace ( "#" , value . toString ( ) ) : config . translations [ key ] ; }