@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
22 lines (21 loc) • 908 B
TypeScript
import type { I18nPublicRuntimeConfig } from '@nuxtjs/i18n';
import type { ShopConfigIndexed } from '@scayle/storefront-nuxt';
interface RuntimeDomainValidationError {
type: 'missing_domain' | 'duplicate_domain';
shopId: number | undefined;
locale: string;
domain?: string;
message: string;
}
/**
* Validates shop an @nuxtjs/i18n configuration for domain based shop switching.
* - Checks that every shop has a domain property configured
* - Checks that the domain configured in the shop config is also configured in the i18n config
* - Checks that all domains in the i18nConfig are different
*
* @param shops - The shops configuration.
* @param i18nConfig - The @nuxtjs/i18n configuration.
* @returns An array of errors.
*/
export declare const validateDomainConfig: (shops: ShopConfigIndexed, i18nConfig: I18nPublicRuntimeConfig) => RuntimeDomainValidationError[];
export {};