import type { PartialDeep } from 'type-fest'; import { fetchConfig } from './scripts/fetchConfig'; export interface AppConfigModule { /** * Returns the resolved config, initializing it on first access. */ getConfig: () => Promise; /** * Fetches and resolves the config, replacing any previously cached value. */ initializeConfig: () => Promise; } /** * Creates a reusable app config module. * * Each application provides its own config type `T` and a `defaultConfig` used * as the base. The fetched runtime config (see {@link fetchConfig}) is deep-merged * over the defaults. * * @example * ```ts * import { createAppConfig } from '@webitel/ui-sdk/modules/AppConfig'; * import { defaultConfig } from './defaults/defaultConfig'; * import type { AppConfig } from './types/AppConfig'; * * export const { getConfig, initializeConfig } = createAppConfig(defaultConfig); * ``` */ export declare function createAppConfig(defaultConfig: PartialDeep): AppConfigModule; export type { PartialDeep }; export { fetchConfig };