import type { NextConfig } from 'next'; import { type withGTConfigProps } from './config-dir/props/withGTConfigProps'; type WithGTConfigValue = T extends Promise ? Promise : T extends PromiseLike ? PromiseLike : T & NextConfig; type WithGTConfigResult = TNextConfig extends (...args: infer A) => infer R ? (...args: A) => WithGTConfigValue : TNextConfig & NextConfig; /** * Initializes General Translation settings for a Next.js application. * * Use it in `next.config.js` to enable GT translation functionality as a plugin. * * @example * // In next.config.ts * import { withGTConfig } from 'gt-next/config'; * import type { NextConfig } from 'next'; * * const nextConfig = { * reactStrictMode: true, * } satisfies NextConfig; * * export default withGTConfig(nextConfig, { * locales: ['en', 'es', 'fr'], * defaultLocale: 'en' * }) * * @param {string|undefined} config - Optional config filepath (defaults to './gt.config.json'). If a file is found, it will be parsed for GT config variables. * @param {string|undefined} dictionary - Optional dictionary configuration file path. If a string is provided, it will be used as a path. * @param {string|null} [runtimeUrl=defaultInitGTProps.runtimeUrl] - The base URL for the GT API. Set to an empty string to disable automatic translations. Set to null to disable. * @param {string|null} [cacheUrl=defaultInitGTProps.cacheUrl] - The URL for cached translations. Set to null to disable. * @param {string[]|undefined} - Whether to use local translations. * @param {string[]} [locales=defaultInitGTProps.locales] - List of supported locales for the application. * @param {string} [defaultLocale=defaultInitGTProps.defaultLocale] - The default locale to use if none is specified. * @param {string|undefined} [getLocalePath="getLocale"] - The path to the custom getLocale function. * @param {string|undefined} [getRegionPath="getRegion"] - The path to the custom getRegion function. * @param {object} [renderSettings=defaultInitGTProps.renderSettings] - Render settings for how translations should be handled. * @param {number} [cacheExpiryTime] - The time in milliseconds for how long translations should be cached. * @param {number} [maxConcurrentRequests=defaultInitGTProps.maxConcurrentRequests] - Maximum number of concurrent requests allowed. * @param {number} [maxBatchSize=defaultInitGTProps.maxBatchSize] - Maximum translation requests in the same batch. * @param {number} [batchInterval=defaultInitGTProps.batchInterval] - The interval in milliseconds between batched translation requests. * @param {boolean} [ignoreBrowserLocales=defaultWithGTConfigProps.ignoreBrowserLocales] - Whether to ignore browser's preferred locales. * @param {boolean} [disableInvalidLocaleWarning=defaultWithGTConfigProps.disableInvalidLocaleWarning] - Whether to disable invalid request locale warnings. * @param {string|undefined} [pathRegex] - Regular expression that request pathnames must match for i18n middleware to be applied. Write it for paths without the locale prefix: ``, `useLocalizeHref()` and `getLocalizeHref()` test the unprefixed path and leave non-matching paths unprefixed. * @param {object} headersAndCookies - Additional headers and cookies that can be passed for extended configuration. * @param {boolean} [localeRouting] - Default for createNextMiddleware's `localeRouting` option. * @param {boolean} [prefixDefaultLocale] - Default for createNextMiddleware's `prefixDefaultLocale` option. * @param {boolean} [enableSmartRouting] - Default for createNextMiddleware's `enableSmartRouting` option. * @param {boolean} [ignoreSourceMaps] - Default for createNextMiddleware's `ignoreSourceMaps` option. * @param {object} [pathConfig] - Default for createNextMiddleware's `pathConfig` option. * @param {object} [routeOverrides] - Default for createNextMiddleware's `routeOverrides` option. * @param {object} [localeRoutes] - Default for createNextMiddleware's `localeRoutes` option. * @param {object} metadata - Additional metadata that can be passed for extended configuration. * * @param {object} nextConfig - The Next.js configuration object to extend * @param {withGTConfigProps} props - General Translation configuration properties * @returns {NextConfig} - An updated Next.js config with GT settings applied * * @throws {Error} If the project ID is missing and default URLs are used, or if the API key is required and missing from the environment. */ export declare function withGTConfig(nextConfig?: TNextConfig, props?: withGTConfigProps): WithGTConfigResult; export {}; //# sourceMappingURL=config.d.ts.map