import { InjectionToken, EnvironmentProviders } from '@angular/core';
import { ZCacheConfig, ZIndexDbService, ZIndexDbConfig, ZThemeConfig } from '@shival99/z-ui/services';
export { ZThemeConfig, ZThemeName } from '@shival99/z-ui/services';
import { HttpClient } from '@angular/common/http';
import { TranslateLoader } from '@ngx-translate/core';
import { ZUITranslations } from '@shival99/z-ui/i18n';

/** Injection token for ZCacheService configuration */
declare const Z_CACHE_CONFIG: InjectionToken<ZCacheConfig>;
/**
 * Provide Z-Cache service with configuration
 * @param config - Cache configuration with prefix and encrypt options
 *
 * @example
 * ```typescript
 * // In app.config.ts
 * export const appConfig: ApplicationConfig = {
 *   providers: [
 *     provideZCache({
 *       prefix: 'myapp_',
 *       encrypt: false, // Disable encryption for debugging
 *     }),
 *   ],
 * };
 * ```
 */
declare function provideZCache(config?: ZCacheConfig): EnvironmentProviders;

/** Injection token for ZIndexDbService */
declare const Z_INDEXDB_SERVICE: InjectionToken<ZIndexDbService>;
/**
 * Provide Z-IndexDB service with configuration
 * @param config - IndexDB configuration with multi-store support
 *
 * @example
 * ```typescript
 * // In app.config.ts
 * export const appConfig: ApplicationConfig = {
 *   providers: [
 *     provideZIndexDb({
 *       dbName: 'MyApp',
 *       version: 1,
 *       stores: [
 *         { name: 'cache', encrypt: true },
 *         { name: 'userData', encrypt: true, protectedKeys: ['profile'] },
 *         { name: 'settings', encrypt: false },
 *       ],
 *       defaultStore: 'cache',
 *       protectedKeys: ['token'],
 *     }),
 *   ],
 * };
 * ```
 */
declare function provideZIndexDb(config?: ZIndexDbConfig): EnvironmentProviders;

/**
 * Z-NgxMask Provider Types
 */
interface ZNgxMaskConfig {
    /** Language code (vi, en, etc.) */
    lang?: string;
    /** Allow negative numbers */
    allowNegativeNumbers?: boolean;
    /** Enable validation */
    validation?: boolean;
}

/**
 * Provide Z-NgxMask with locale-aware configuration
 * @param config - Mask configuration
 *
 * @example
 * ```typescript
 * // In app.config.ts
 * export const appConfig: ApplicationConfig = {
 *   providers: [
 *     provideZNgxMask({ lang: 'vi' }),
 *   ],
 * };
 * ```
 */
declare function provideZNgxMask(config?: ZNgxMaskConfig): EnvironmentProviders;

/**
 * Provides global scrollbar options for ngx-scrollbar
 * Use this in app.config.ts: providers: [provideZScrollbar()]
 */
declare function provideZScrollbar(): EnvironmentProviders;

/**
 * Provide theme configuration for the application
 * @param config - Theme configuration with defaultTheme, defaultDarkMode, and optional cacheKey
 * @example
 * ```typescript
 * // In app.config.ts
 * export const appConfig: ApplicationConfig = {
 *   providers: [
 *     provideZTheme({
 *       defaultTheme: 'hospital',
 *       defaultDarkMode: false,
 *       cacheKey: 'Z_THEME_PREFERENCES_CRM',
 *     })
 *   ]
 * };
 * ```
 */
declare function provideZTheme(config?: ZThemeConfig): EnvironmentProviders;

type ZUITranslationsLoader = (lang: string) => Promise<ZUITranslations>;
interface ZTranslateProviderConfig {
    /** Default language (default: 'vi') */
    defaultLang?: string;
    /** Path to user translation files (default: './assets/i18n/') */
    translationPath?: string;
    /** File extension for translation files (default: '.json') */
    fileExtension?: string;
    /**
     * Whether to include Z-UI default translations (default: true)
     * Z-UI translations are merged with user translations,
     * user translations take precedence.
     */
    includeZUITranslations?: boolean;
    /**
     * Path to Z-UI translation override files (optional)
     * If set, will load translations from this path to override Z-UI defaults.
     * Example: './assets/i18n/z-ui/' will load './assets/i18n/z-ui/vi.json'.
     * Recommended for file-based customization of built-in Z-UI keys.
     *
     * File format:
     * ```json
     * {
     *   "i18n_z_ui_table_noData": "Bảng trống"
     * }
     * ```
     */
    zuiOverridePath?: string;
    /**
     * Custom loader for Z-UI built-in translations.
     * Useful when you want to control how default translations are loaded (dynamic import, remote source, etc.)
     */
    zuiTranslationsLoader?: ZUITranslationsLoader;
}

declare function zCreateTranslateLoader(http: HttpClient, path?: string, extension?: string, includeZUI?: boolean, zuiOverridePath?: string, zuiLoader?: ZUITranslationsLoader): TranslateLoader;
declare function provideZTranslate(config?: ZTranslateProviderConfig): EnvironmentProviders;

export { Z_CACHE_CONFIG, Z_INDEXDB_SERVICE, provideZCache, provideZIndexDb, provideZNgxMask, provideZScrollbar, provideZTheme, provideZTranslate, zCreateTranslateLoader };
export type { ZNgxMaskConfig, ZTranslateProviderConfig, ZUITranslationsLoader };
