import type { DeepRequired, SitecoreConfigInput } from '@sitecore-content-sdk/content/config'; import type { ExpressRequest, ExpressResponse } from './http-types'; /** * Link-prefetch strategy for `scRouterLink`/`scRichText` links: * - `'eager'` (default) — prefetch as soon as the link renders. * - `'hover'` — prefetch only once the pointer dwells on the link (see `delayMs`); starts * disabled and is enabled the moment the user shows intent. * - `'off'` — never prefetch. * @public */ export type LinkPrefetchMode = 'eager' | 'hover' | 'off'; /** * Sitecore configuration input for Angular apps. Extends the base * {@link SitecoreConfigInput} with an `angular` section. `redirects.locales` is intentionally * omitted from the input — it is derived from `angular.locales` so there is a single * source of truth for the locale list. * @public */ export interface AngularSitecoreConfigInput extends Omit { /** Angular-specific configuration. */ angular?: { /** * Locales supported by the Angular app. * `defaultLanguage` is prepended automatically when absent. */ locales?: string[]; /** * Configuration for the ISR-like cache. Both fields default when omitted * (`enabled: true`, `revalidate: 300`). */ loadersCache?: { /** Whether the cache is enabled. */ enabled?: boolean; /** The global revalidate time in seconds. */ revalidate?: number; }; /** * Configuration for loader prefetch on `scRouterLink`/`scRichText` links. Both fields * default when omitted (`mode: 'eager'`, `delayMs: 100`). Can be overridden per-link via * each directive's `prefetch` input. */ linkPrefetch?: { /** Prefetch strategy. See {@link LinkPrefetchMode}. */ mode?: LinkPrefetchMode; /** Hover dwell time (ms) before prefetch fires when `mode: 'hover'`. */ delayMs?: number; }; }; multisite?: { enabled?: boolean; /** * Function used to determine if site should be resolved from sc_site cookie when present */ useCookieResolution?: (req?: ExpressRequest, res?: ExpressResponse) => boolean; }; } /** * Resolved Sitecore configuration for Angular apps. Extends the fully-resolved * {@link SitecoreConfig}; structurally still a `SitecoreConfig`, so existing callers that * type the value as `SitecoreConfig` continue to work. `redirects.locales` is intentionally * omitted at the type level — read the canonical locale list from `angular.locales`. * @public */ export type AngularSitecoreConfig = DeepRequired; /** * Merges `clientEnv` (browser-safe `environment*.ts`) with `process.env` for server-only variables, * then delegates to the base content `defineConfig` and adds the Angular-specific config layer. * * - `angular.locales` is the single source of truth for the locale list; `defaultLanguage` is * added when missing. * - `redirects.locales` is overwritten from `angular.locales` so the redirects proxy stays in sync. * * On Node/SSR, load `.env` in the app entry before importing `sitecore.config` (see * `load-env.ts` in the sample). * @param {AngularSitecoreConfigInput} [config] - Base Sitecore configuration input. * @param {Record} [clientEnv] - Browser-safe env from `environment*.ts`. * @returns {AngularSitecoreConfig} Fully merged Sitecore configuration for Angular. * @public */ export declare function defineConfig(config?: AngularSitecoreConfigInput, clientEnv?: Record): AngularSitecoreConfig; //# sourceMappingURL=define-config.d.ts.map