const GLOBAL_SETTINGS_KEY = '__PDFDRAFT_PDF_INVOICES_FOR_WOOCOMMERCE_SETTINGS__';

export function getLocalizedGlobal<T = unknown>(key: string): T | null {
	if (typeof window === 'undefined') {
		return null;
	}

	const value = (window as any)[key];
	return (value ?? null) as T | null;
}

export function getWooCommerceSettingsLocalized<T = unknown>(): T | null {
	return getLocalizedGlobal<T>(GLOBAL_SETTINGS_KEY);
}

