import { CustomIntlayerConfig, CustomRoutingConfig, EditorConfig, InternationalizationConfig, IntlayerConfig, LogConfig, LogFunctions, RoutingConfig } from "@intlayer/types/config"; //#region src/configFile/buildBrowserConfiguration.d.ts /** * Browser-safe subset of {@link IntlayerConfig}. * * Excludes server-only fields (`system`, `content`, `build`, `compiler`, * `dictionary`, `ai`) and sensitive editor credentials (`clientId`, * `clientSecret`) that must never be shipped to the browser. */ type BrowserIntlayerConfig = { internationalization: Pick; routing: RoutingConfig; editor: Omit; log: Pick; }; declare global { interface Window { /** Browser-safe Intlayer configuration injected by a build plugin or `installIntlayer`. */ INTLAYER_CONFIG?: BrowserIntlayerConfig; } } /** * Build the internationalization section of the Intlayer configuration. * * @param customConfiguration - Partial user-supplied internationalization config. * @returns A fully-defaulted {@link InternationalizationConfig}. */ declare const buildInternationalizationFields: (customConfiguration?: Partial) => InternationalizationConfig; /** * Build the routing section of the Intlayer configuration. * * @param customConfiguration - Partial user-supplied routing config. * @returns A fully-defaulted {@link RoutingConfig}. */ declare const buildRoutingFields: (customConfiguration?: Partial) => RoutingConfig; /** * Build the editor section of the Intlayer configuration. * * Returns the **full** {@link EditorConfig} including sensitive fields * (`clientId`, `clientSecret`). The browser-safe {@link BrowserIntlayerConfig} * omits those fields when exposing config to the client. * * @param customConfiguration - Partial user-supplied editor config. * @returns A fully-defaulted {@link EditorConfig}. */ declare const buildEditorFields: (customConfiguration?: Partial) => EditorConfig; /** * Build the log section of the Intlayer configuration. * * @param customConfiguration - Partial user-supplied log config. * @param logFunctions - Optional custom log function overrides (server-only). * @returns A fully-defaulted {@link LogConfig}. */ declare const buildLogFields: (customConfiguration?: Partial, logFunctions?: LogFunctions) => LogConfig; /** * Build a browser-safe {@link BrowserIntlayerConfig} from a raw user config. * * Applies defaults for every field and strips all server-only or sensitive * information (`system`, `content`, `build`, `compiler`, `dictionary`, `ai`, * `editor.clientId`, `editor.clientSecret`). * * This is the browser counterpart of `buildConfigurationFields`. It is safe * to call in browser environments because it has no Node.js dependencies. * * @param customConfig - Optional partial user-supplied Intlayer config. * @returns A browser-safe configuration object ready for `window.INTLAYER_CONFIG`. * * @example * ```ts * import { buildBrowserConfiguration } from '@intlayer/config/client'; * * window.INTLAYER_CONFIG = buildBrowserConfiguration({ * internationalization: { locales: ['en', 'fr'], defaultLocale: 'en' }, * }); * ``` */ declare const buildBrowserConfiguration: (customConfig?: CustomIntlayerConfig) => BrowserIntlayerConfig; /** * Extract a {@link BrowserIntlayerConfig} from an already-built full * {@link IntlayerConfig}. * * Used by build plugins (`vite-intlayer`, `withIntlayer`) which already hold * the full server-side config and need to inject the browser-safe subset at * compile time via a bundler `define`. * * @param config - A fully-built server-side Intlayer configuration. * @returns The browser-safe subset of that configuration. */ declare const extractBrowserConfiguration: (config: IntlayerConfig) => BrowserIntlayerConfig; //#endregion export { BrowserIntlayerConfig, buildBrowserConfiguration, buildEditorFields, buildInternationalizationFields, buildLogFields, buildRoutingFields, extractBrowserConfiguration }; //# sourceMappingURL=buildBrowserConfiguration.d.ts.map