import * as i0 from '@angular/core';
import { Provider, EnvironmentProviders, ModuleWithProviders, RendererFactory2, InjectionToken } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Nullable } from '@fundamental-ngx/cdk/utils';
import { Observable } from 'rxjs';

/**
 * Type of theme styling resource.
 */
type ThemeStyleLink = 'base-theme' | 'custom-theme';
/**
 * Base theme interface.
 */
interface BaseTheme {
    /**
     * Unique ID of a theme.
     */
    id: string;
    /**
     * Theme name.
     */
    name: string;
    /**
     * Theme description.
     */
    description?: string;
}
/**
 * User provided theme interface.
 */
interface ThemeDefinition extends BaseTheme {
    /**
     * Theming resource files.
     */
    theming?: ThemingResource;
}
/**
 * Complete theme interface with all provided properties.
 */
interface CompleteThemeDefinition extends BaseTheme {
    /**
     * Theming resource files.
     */
    theming: CompleteThemingResource;
}
/**
 * User provided theming resource.
 */
type ThemingResource = Partial<CompleteThemingResource>;
/**
 * Complete theming resource interface with all provided properties.
 */
interface CompleteThemingResource {
    /**
     * Base theming css file path. Usually a path for the @sap-theming css variables file.
     */
    themingBasePath: string;
    /**
     * Theming css file path. Usually a path for the fundamental-styles css variables file.
     */
    themePath: string;
}

interface ThemingConfig {
    /**
     * Array of user-defined themes.
     */
    customThemes: ThemeDefinition[];
    /**
     * Default theme.
     */
    defaultTheme: string;
    /**
     * Whether to exclude default themes from the list of available options.
     */
    excludeDefaultThemes: boolean;
    /**
     * URL Query parameter flag to change theme based on the provided parameter.
     */
    themeQueryParam: string;
    /**
     * Whether to change theme if URL Query parameter flag has been found or changed.
     */
    changeThemeOnQueryParamChange: boolean;
    /**
     * Identifiers of theme style links.
     */
    themeStyleLinkIdentifiers: Record<ThemeStyleLink, string>;
}

/**
 * Theming Configuration.
 */
declare class BaseThemingConfig implements ThemingConfig {
    /**
     * Array of user-defined themes.
     */
    customThemes: ThemeDefinition[];
    /**
     * Default theme.
     */
    defaultTheme: string;
    /**
     * Whether to exclude default themes from the list of available options. By default, false.
     */
    excludeDefaultThemes: boolean;
    /**
     * URL Query parameter flag to change theme based on the provided parameter.
     */
    themeQueryParam: string;
    /**
     * Whether to change theme if URL Query parameter flag has been found or changed. Default is true.
     */
    changeThemeOnQueryParamChange: boolean;
    /**
     * Identifiers of theme style links.
     */
    themeStyleLinkIdentifiers: Record<ThemeStyleLink, string>;
}

/**
 * Provides theming configuration
 * @param config
 */
declare function provideTheming(config?: Partial<ThemingConfig>): Provider[];

declare const STANDARD_THEMES: ThemeDefinition[];

/**
 * Initializes theming service
 */
declare function themingInitializer(): EnvironmentProviders;

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class ThemingModule {
    /** Module with providers */
    static withConfig(config: Partial<ThemingConfig>): ModuleWithProviders<ThemingModule>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ThemingModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<ThemingModule, never, never, never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<ThemingModule>;
}

declare class ThemingService {
    private _rendererFactory;
    private _document;
    private _activatedRoute;
    private readonly _providedConfig;
    /**
     * Theming configuration.
     */
    readonly config: BaseThemingConfig;
    /**
     * Observable of the current theme, applied to the application.
     */
    get currentTheme(): Observable<CompleteThemeDefinition | null>;
    /** @hidden */
    private readonly _renderer;
    /** @hidden */
    private readonly _availableThemes;
    /** @hidden */
    private readonly _standardThemes;
    /** @hidden **/
    private readonly _destroyRef;
    /** @hidden */
    private readonly _currentThemeSubject;
    /**
     * @hidden
     */
    constructor(_rendererFactory: RendererFactory2, _document: Document, _activatedRoute: ActivatedRoute, _providedConfig: Partial<ThemingConfig>);
    /**
     * Initiates theme change based on query parameter or provided default theme in config.
     */
    init(): void;
    /**
     * Sets defined theme.
     * @param themeId ID of theme that needs to be used by the application.
     */
    setTheme(themeId: string): boolean;
    /**
     * Returns array of available themes.
     */
    getThemes(): CompleteThemeDefinition[];
    /**
     * Returns current theme definition.
     */
    getCurrentTheme(): Nullable<ThemeDefinition>;
    /**
     * @hidden
     * @param type
     * @param resourceUrl
     * @private
     */
    private _setThemeResource;
    /**
     * @hidden
     * @param type
     * @private
     */
    private _getStyleLinkElement;
    /**
     * @hidden
     * @param themes
     * @private
     */
    private _formatProvidedThemes;
    /** @hidden */
    private _getThemingResourceConfig;
    /** @hidden */
    private _getNativeParameterByName;
    /**
     * @hidden
     * Set theme according to additional URL parameter.
     * This parameter can be changed in function argument.
     **/
    private _setThemeByRoute;
    static ɵfac: i0.ɵɵFactoryDeclaration<ThemingService, [null, null, { optional: true; }, { optional: true; }]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ThemingService>;
}

declare const THEMING_CONFIG_TOKEN: InjectionToken<Partial<ThemingConfig>>;

export { BaseThemingConfig, STANDARD_THEMES, THEMING_CONFIG_TOKEN, ThemingModule, ThemingService, provideTheming, themingInitializer };
export type { BaseTheme, CompleteThemeDefinition, CompleteThemingResource, ThemeDefinition, ThemeStyleLink, ThemingConfig, ThemingResource };
