import * as i0 from '@angular/core';
import { ProviderToken, FactorySansProvider, Provider, OnDestroy, ModuleWithProviders, Signal, Injector, InjectionToken } from '@angular/core';
import { HasElementRef } from '@fundamental-ngx/cdk/utils';
import { BehaviorSubject, Observable } from 'rxjs';

declare enum ContentDensityMode {
    COZY = "cozy",
    CONDENSED = "condensed",
    COMPACT = "compact"
}

declare class ContentDensityObserverSettings {
    /** Classes to be added to the element. */
    modifiers?: Partial<Record<ContentDensityMode, string>>;
    /** Supported content densities. */
    supportedContentDensity?: ContentDensityMode[];
    /** Default content density. */
    defaultContentDensity?: ContentDensityMode | ProviderToken<ContentDensityMode> | FactorySansProvider;
    /** Whether in debug mode. */
    debug?: boolean;
    /** Whether to always add class modifiers. Useful for components that are detached from its parent component. */
    alwaysAddModifiers?: boolean;
    /** Whether to force child components to restrict supported content density with current component's one. */
    restrictChildContentDensity?: boolean;
}

declare const ContentDensityGlobalKeyword = "global";
declare const ContentDensityDefaultKeyword = "default";
type LocalContentDensityMode = ContentDensityMode | typeof ContentDensityGlobalKeyword | typeof ContentDensityDefaultKeyword;
interface BaseContentDensityModuleConfig {
    defaultGlobalContentDensity?: ContentDensityMode;
}
interface LocalStorageConfig {
    storage: 'localStorage';
    storageKey?: string;
}
interface UrlStorageConfig {
    storage: 'url';
    storageKey?: string;
}
interface CustomStorageConfig {
    storage: Provider;
}
interface MemoryStorageConfig {
    storage: 'memory';
}
type ContentDensityModuleConfig = (LocalStorageConfig | MemoryStorageConfig | UrlStorageConfig | CustomStorageConfig) & BaseContentDensityModuleConfig;
interface ContentDensityObserverTarget extends HasElementRef {
    contentDensitySettings?: ContentDensityObserverSettings;
}
type ContentDensityCallbackFn = (target: ContentDensityMode) => void;

/**
 * Directive to control the content density of the elements.
 * This Directive is used in density controllers and consumers
 */
declare class ContentDensityDirective extends BehaviorSubject<LocalContentDensityMode> implements OnDestroy {
    /**
     * Update the content density of the element on the fly
     */
    set fdContentDensity(val: `${ContentDensityMode}` | LocalContentDensityMode | '');
    /**
     * This input is basically syntax sugar, for not writing fdContentDensity="compact",
     * instead you can just write fdCompact="true" or [fdCompact]
     */
    set fdCompact(val: boolean);
    /**
     * This input is basically syntax sugar, for not writing fdContentDensity="condensed",
     * instead you can just write fdCondensed="true" or [fdCondensed]
     */
    set fdCondensed(val: boolean);
    /**
     * This input is basically syntax sugar, for not writing fdContentDensity="cozy",
     * instead you can just write fdCozy="true" or [fdCozy]
     */
    set fdCozy(val: boolean);
    /** @hidden */
    constructor();
    /** @hidden */
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ContentDensityDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ContentDensityDirective, "[fdContentDensity]:not([fdCompact]):not([fdCondensed]):not([fdCozy]),                [fdCompact]:not([fdContentDensity]):not([fdCondensed]):not([fdCozy]),                [fdCondensed]:not([fdContentDensity]):not([fdCompact]):not([fdCozy]),                [fdCozy]:not([fdContentDensity]):not([fdCompact]):not([fdCondensed])", ["fdContentDensity"], { "fdContentDensity": { "alias": "fdContentDensity"; "required": false; }; "fdCompact": { "alias": "fdCompact"; "required": false; }; "fdCondensed": { "alias": "fdCondensed"; "required": false; }; "fdCozy": { "alias": "fdCozy"; "required": false; }; }, {}, never, never, true, never>;
    static ngAcceptInputType_fdCompact: unknown;
    static ngAcceptInputType_fdCondensed: unknown;
    static ngAcceptInputType_fdCozy: unknown;
}

declare class ContentDensityModule {
    /** Module with providers */
    static forRoot(config?: ContentDensityModuleConfig): ModuleWithProviders<ContentDensityModule>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ContentDensityModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<ContentDensityModule, never, [typeof ContentDensityDirective], [typeof ContentDensityDirective]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<ContentDensityModule>;
}

/**
 * Abstract provider class for providing content density storage functionality
 * Default implementation is MemoryContentDensityStorage
 */
declare abstract class ContentDensityStorage {
    /**
     * Get listener for current density updates
     */
    abstract getContentDensity(): Observable<ContentDensityMode>;
    /**
     * Save updated configuration
     * @param density
     */
    abstract setContentDensity(density: ContentDensityMode): Observable<void>;
}

/**
 * Creates provider for ContentDensityObserver
 */
declare function contentDensityObserverProviders(params?: ContentDensityObserverSettings): Provider[];

declare class ContentDensityObserver extends BehaviorSubject<ContentDensityMode> {
    /** @hidden */
    readonly contentDensity$: Signal<ContentDensityMode | undefined>;
    /** @hidden */
    readonly config: ContentDensityObserverSettings;
    /** @hidden */
    readonly isCompact$: Observable<boolean>;
    /** @hidden */
    readonly isCozy$: Observable<boolean>;
    /** @hidden */
    readonly isCondensed$: Observable<boolean>;
    /** @hidden */
    readonly isCompactSignal: Signal<boolean>;
    /** @hidden */
    readonly isCozySignal: Signal<boolean>;
    /** @hidden */
    readonly isCondensedSignal: Signal<boolean>;
    /** @hidden */
    get isCompact(): boolean;
    /** @hidden */
    get isCozy(): boolean;
    /** @hidden */
    get isCondensed(): boolean;
    /** @hidden */
    private readonly _isCompact$;
    /** @hidden */
    private readonly _isCozy$;
    /** @hidden */
    private readonly _isCondensed$;
    /** @hidden */
    private _globalContentDensityService;
    /** @hidden */
    private _contentDensityDirective;
    /** @hidden */
    private _parentContentDensityObserver;
    /** @hidden */
    private _renderer;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    private _elementRef;
    /** @hidden */
    private _elements;
    /** @hidden */
    private _alternativeTo;
    /** @hidden */
    constructor(_injector: Injector, _providedConfig?: ContentDensityObserverSettings);
    /** @hidden */
    consume(...consumers: ContentDensityObserverTarget[]): void;
    /**
     * Completes the stream and closes all internal subscriptions.
     */
    complete(): void;
    /** @hidden */
    removeConsumer(consumer: ContentDensityObserverTarget): void;
    /** @hidden */
    private _applyClass;
    /** Check if the given density is supported */
    private _isSupported;
    static ɵfac: i0.ɵɵFactoryDeclaration<ContentDensityObserver, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ContentDensityObserver>;
}

/**
 * Service for managing global content density state.
 */
declare class GlobalContentDensityService implements OnDestroy {
    private _storage;
    /**
     * Current content density.
     */
    currentContentDensity: ContentDensityMode;
    /** @hidden */
    private _subscription;
    /** @hidden */
    constructor(_storage: ContentDensityStorage);
    /** Listen to current content density changes */
    contentDensityListener(): Observable<ContentDensityMode>;
    /** Update content density */
    updateContentDensity(density: ContentDensityMode): Observable<void>;
    /** @hidden */
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<GlobalContentDensityService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<GlobalContentDensityService>;
}

declare const isCompact: (density: any) => boolean;
declare const isCondensed: (density: any) => boolean;
declare const isCozy: (density: any) => boolean;
declare const isContentDensityMode: (density: any) => boolean;

declare const CONTENT_DENSITY_DIRECTIVE: InjectionToken<Observable<LocalContentDensityMode>>;

/** @hidden */
declare function mockedLocalContentDensityDirective(defaultValue?: LocalContentDensityMode): {
    contentDensityDirectiveProvider: Provider;
    setContentDensity: (cd: LocalContentDensityMode) => void;
};

declare const defaultContentDensityObserverConfigs: Required<ContentDensityObserverSettings>;

/**
 * Provides content density services and configurations
 * @param config
 */
declare function provideContentDensity(config?: ContentDensityModuleConfig): Provider[];

export { CONTENT_DENSITY_DIRECTIVE, ContentDensityDefaultKeyword, ContentDensityDirective, ContentDensityGlobalKeyword, ContentDensityMode, ContentDensityModule, ContentDensityObserver, ContentDensityObserverSettings, ContentDensityStorage, GlobalContentDensityService, contentDensityObserverProviders, defaultContentDensityObserverConfigs, isCompact, isCondensed, isContentDensityMode, isCozy, mockedLocalContentDensityDirective, provideContentDensity };
export type { ContentDensityCallbackFn, ContentDensityModuleConfig, ContentDensityObserverTarget, LocalContentDensityMode };
