import * as i0 from '@angular/core';
import { ElementRef, StaticProvider, Injector, EnvironmentInjector, TemplateRef } from '@angular/core';
import { Subject, ReplaySubject } from 'rxjs';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

/**
 * Reference to a modal dialog
 * @typeParam T - the type of the content
 * @typeParam CT - the close type
 */
declare class ModalRef<T = never, CT = any> {
    /** Emits the close value when the modal is hidden. */
    hidden: Subject<CT | undefined>;
    /** Allows messaging state to consumer w/o closing the dialog. */
    message: Subject<CT | undefined>;
    /** Emits the modal element reference when it is shown. */
    shown: ReplaySubject<ElementRef<any>>;
    /**
     * The modal options passed during creation.
     *
     * @defaultValue `{}`
     * @see {@link SiModalService}
     */
    data: ModalOptions;
    /** @defaultValue true */
    ignoreBackdropClick: boolean;
    /**
     * Custom class for modal-dialog
     *
     * @defaultValue ''
     */
    dialogClass: string;
    /**
     * The layer of the modal. The modal with the highest layer will be shown on top.
     *
     * @defaultValue 0
     */
    layer: number;
    /** The default close value of the modal. */
    closeValue?: CT;
    get content(): T;
    /** Set the input of a component shown in the modal. */
    setInput(input: string, value: unknown): void;
    /**
     * @defaultValue `() => false`
     */
    isCurrent: () => boolean;
    /**
     * @defaultValue `() => {}`
     */
    detach: () => void;
    /**
     * Close the modal with a custom close value.
     *
     * @defaultValue `() => {}`
     */
    hide: (reason?: CT) => void;
    /**
     * When `data.disableAutoHide` is set, messages the `reason`, otherwise calls {@link hide}.
     */
    messageOrHide(reason?: CT): void;
}

interface ModalDependencyInjectionOptions {
    /** Additional providers for the modal. */
    providers?: StaticProvider[];
    /** Optional element Injector. */
    injector?: Injector;
    /** Optional environment Injector. */
    environmentInjector?: EnvironmentInjector;
}
interface ModalOptions<T = Record<string, any>> extends ModalDependencyInjectionOptions {
    /**
     * Use this to assign values to either `@Input()` or `input()` fields of the provided component.
     * If a template is used, the values are available in the template context.
     */
    inputValues?: Record<string, unknown>;
    /** When set to true, clicking the backdrop has no effect. */
    ignoreBackdropClick?: boolean;
    /** When set to true, backdrop click or Esc don't close the modal. Instead a message will be sent. */
    messageInsteadOfAutoHide?: boolean;
    /** Handle Esc to close/message. */
    keyboard?: boolean;
    /** Whether to enable animation. */
    animated?: boolean;
    /** Additional CSS class. */
    class?: string;
    /** aria-labelled-by value. */
    ariaLabelledBy?: string;
}
declare class SiModalService {
    private modalsCount;
    private readonly overlay;
    private appRef;
    private injector;
    private environmentInjector;
    /**
     * Shows a modal with the given content and configuration.
     * @param content - Content to be displayed in the modal can  be a template reference or a component.
     * @param config - Configuration for the modal.
     * @param closeValue - Default closing value which can be overridden by calling `modalRef.hide(value)`.
     * @returns A reference to the modal.
     */
    show<T, CT = any>(content: TemplateRef<any> | (new (...args: any[]) => T), config: ModalOptions<T>, closeValue?: CT): ModalRef<T, CT>;
    private attachComponent;
    private getContentProjectableNodes;
    protected detach(modalRef: ModalRef<unknown, any>): void;
    protected buildInjector(): Injector;
    static ɵfac: i0.ɵɵFactoryDeclaration<SiModalService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SiModalService>;
}

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

declare const createModalConfig: (inputs?: {
    [key: string]: any;
}) => ModalOptions;

export { ModalRef, SiModalService, createModalConfig };
export type { ModalDependencyInjectionOptions, ModalOptions };
