export type Config = { animate?: boolean; smoothScroll?: boolean; allowClose?: boolean; opacity?: number; }; let currentConfig: Config = {}; export function configure(config: Config = {}) { currentConfig = { animate: true, allowClose: true, opacity: 0.7, smoothScroll: false, ...config, }; } export function getConfig(): Config; export function getConfig(key: K): Config[K]; export function getConfig(key?: K) { return key ? currentConfig[key] : currentConfig; }