import * as _angular_core from '@angular/core';
import { TemplateRef, Type, WritableSignal, EventEmitter, ViewContainerRef, InjectionToken, OnDestroy, AfterViewChecked, ComponentRef, EmbeddedViewRef } from '@angular/core';
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
import { ClassValue } from 'clsx';
import { NgScrollbar } from 'ngx-scrollbar';
import { ComponentType, OverlayRef } from '@angular/cdk/overlay';
import { ZIcon } from '@shival99/z-ui/components/z-icon';
import { Observable } from 'rxjs';
import * as class_variance_authority_types from 'class-variance-authority/types';

declare class ZDrawerContentDirective {
    readonly templateRef: TemplateRef<any>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZDrawerContentDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ZDrawerContentDirective, "[z-drawer-content], [zDrawerContent]", never, {}, {}, never, never, true, never>;
}

declare class ZDrawerFooterDirective {
    readonly templateRef: TemplateRef<any>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZDrawerFooterDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ZDrawerFooterDirective, "[z-drawer-footer], [zDrawerFooter]", never, {}, {}, never, never, true, never>;
}

declare class ZDrawerHeaderDirective {
    readonly templateRef: TemplateRef<any>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZDrawerHeaderDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ZDrawerHeaderDirective, "[z-drawer-header], [zDrawerHeader]", never, {}, {}, never, never, true, never>;
}

type ZDrawerContentType<T> = ComponentType<T> | TemplateRef<T> | string;
type ZDrawerPlacement = 'left' | 'right' | 'top' | 'bottom';
declare const Z_DRAWER_DATA: InjectionToken<any>;
type ZDrawerOnClickCallBack<T> = (instance: T, drawerRef?: unknown) => false | void | object;
/**
 * Configuration options for z-drawer component.
 *
 * @template T - The type of the content component
 * @template U - The type of the data passed to the drawer
 */
declare class ZDrawerOptions<T, U> {
    /** Icon for the cancel button */
    zCancelIcon?: ZIcon;
    /** Text for the cancel button. Set to null to hide the button */
    zCancelText?: string | null;
    /** Whether the drawer is closable (shows close button) */
    zClosable?: boolean;
    /** Drawer content - can be a component, template, or string */
    zContent?: string | TemplateRef<T> | Type<T>;
    /** Custom CSS classes for the drawer */
    class?: ClassValue;
    /** Custom CSS classes for the drawer body */
    zBodyClass?: ClassValue;
    /** Data to be passed to the content component via Z_DRAWER_DATA token */
    zData?: U;
    /**
     * Observable for deferred data loading before showing drawer content.
     * Drawer will show a loading spinner until the Observable completes.
     * The resolved data will be available via Z_DRAWER_DATA.
     */
    zDefer?: Observable<U>;
    /** Description text shown below the title */
    zDescription?: string;
    /** Whether to hide the default footer */
    zHideFooter?: boolean;
    /** Whether to hide the default header */
    zHideHeader?: boolean;
    /**
     * WritableSignal to control loading state of the OK button.
     * Use this when submitting forms or calling APIs.
     */
    readonly zLoading?: WritableSignal<boolean>;
    /** Whether clicking mask closes the drawer */
    zMaskClosable?: boolean;
    /** Whether OK button has destructive (red) style */
    zOkDestructive?: boolean;
    /** Whether OK button is disabled */
    zOkDisabled?: boolean;
    /** Overlay style: 'dark' (black overlay) or 'blur' (backdrop blur) */
    zOverlay?: 'dark' | 'blur';
    /** Icon for the OK button */
    zOkIcon?: ZIcon;
    /** Text for the OK button. Set to null to hide the button */
    zOkText?: string | null;
    /** Callback or EventEmitter when cancel is clicked */
    zOnCancel?: EventEmitter<T> | ZDrawerOnClickCallBack<T>;
    /** Callback or EventEmitter when OK is clicked */
    zOnOk?: EventEmitter<T> | ZDrawerOnClickCallBack<T>;
    /** Drawer title - supports string, HTML string, or TemplateRef */
    zTitle?: string | TemplateRef<T>;
    /** ViewContainerRef for the drawer portal */
    zViewContainerRef?: ViewContainerRef;
    /** Drawer width for left/right placement (e.g., '400px', '80%') */
    zWidth?: string;
    /** Drawer height for top/bottom placement (e.g., '400px', '50%') */
    zHeight?: string;
    /** Placement of the drawer: 'left', 'right', 'top', 'bottom' */
    zPlacement?: ZDrawerPlacement;
    /** Force shadow on header/footer regardless of scroll state */
    zShadow?: boolean;
    /** Shape of the drawer: 'rounded' (with border-radius) or 'square' (no border-radius) */
    zShape?: 'rounded' | 'square';
    /** WritableSignal to control content loading state (shows skeleton when true) */
    readonly zContentLoading?: WritableSignal<boolean>;
    /** Number of skeleton rows to show when content is loading (default: 5 for left/right, 3 for top/bottom) */
    zSkeletonRows?: number;
}

declare class ZDrawerRef<T = any, R = any, U = any> {
    private readonly _overlayRef;
    private readonly _config;
    private readonly _containerInstance;
    private readonly _platformId;
    private readonly _destroy$;
    private _isClosing;
    private _result?;
    componentInstance: T | null;
    readonly loading: _angular_core.WritableSignal<boolean>;
    readonly zAfterClose: EventEmitter<R | undefined>;
    constructor(_overlayRef: OverlayRef, _config: ZDrawerOptions<T, U>, _containerInstance: ZDrawerComponent<T, U>, _platformId: object);
    setLoading(value: boolean): void;
    close(result?: R): void;
    private _trigger;
    private _getContentComponent;
    private _closeWithResult;
}

type ZDrawerShape = 'rounded' | 'square';
declare const zDrawerVariants: (props?: ({
    placement?: "left" | "right" | "top" | "bottom" | null | undefined;
    shape?: "rounded" | "square" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;

declare class ZDrawerComponent<T, U> extends BasePortalOutlet implements OnDestroy, AfterViewChecked {
    readonly zOnOk: _angular_core.OutputEmitterRef<void>;
    readonly zOnCancel: _angular_core.OutputEmitterRef<void>;
    readonly zAfterClose: _angular_core.OutputEmitterRef<void>;
    readonly zScrollbar: _angular_core.OutputEmitterRef<NgScrollbar>;
    readonly class: _angular_core.InputSignal<ClassValue>;
    readonly zBodyClass: _angular_core.InputSignal<ClassValue>;
    readonly zVisible: _angular_core.ModelSignal<boolean>;
    readonly zTitle: _angular_core.InputSignal<string | TemplateRef<unknown> | undefined>;
    readonly zDescription: _angular_core.InputSignal<string | TemplateRef<unknown> | undefined>;
    readonly zWidth: _angular_core.InputSignal<string>;
    readonly zHeight: _angular_core.InputSignal<string>;
    readonly zPlacement: _angular_core.InputSignal<ZDrawerPlacement>;
    readonly zClosable: _angular_core.InputSignal<boolean>;
    readonly zMaskClosable: _angular_core.InputSignal<boolean>;
    readonly zHideFooter: _angular_core.InputSignal<boolean>;
    readonly zHideHeader: _angular_core.InputSignal<boolean>;
    readonly zOkText: _angular_core.InputSignal<string | null>;
    readonly zCancelText: _angular_core.InputSignal<string | null>;
    readonly zOkDestructive: _angular_core.InputSignal<boolean>;
    readonly zOkDisabled: _angular_core.InputSignal<boolean>;
    readonly zLoading: _angular_core.InputSignal<boolean>;
    readonly zOverlay: _angular_core.InputSignal<"dark" | "blur">;
    readonly zShadow: _angular_core.InputSignal<boolean>;
    readonly zShape: _angular_core.InputSignal<ZDrawerShape>;
    readonly zContentLoading: _angular_core.InputSignal<boolean>;
    readonly zSkeletonRows: _angular_core.InputSignal<number | null>;
    protected readonly customHeader: _angular_core.Signal<ZDrawerHeaderDirective | undefined>;
    protected readonly customContent: _angular_core.Signal<ZDrawerContentDirective | undefined>;
    protected readonly customFooter: _angular_core.Signal<ZDrawerFooterDirective | undefined>;
    drawerRef?: ZDrawerRef<T>;
    readonly portalOutlet: _angular_core.Signal<CdkPortalOutlet | undefined>;
    protected readonly dummyTemplateRef: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    protected readonly mainContentRef: _angular_core.Signal<NgScrollbar | undefined>;
    protected readonly config: ZDrawerOptions<T, U>;
    private readonly _platformId;
    private readonly _host;
    private readonly _overlay;
    private readonly _viewContainerRef;
    private readonly _cdr;
    private readonly _destroyRef;
    private readonly _zTranslate;
    private readonly _overlayContainerService;
    private readonly _zIndexService;
    private _templateOverlayRef;
    private _originalParent;
    private _originalNextSibling;
    private _backdropSubscription;
    private _closeTimeout;
    protected readonly isLeaving: _angular_core.WritableSignal<boolean>;
    protected readonly hasScrollableContent: _angular_core.WritableSignal<boolean>;
    protected readonly isScrolledFromTop: _angular_core.WritableSignal<boolean>;
    protected readonly isScrolledToBottom: _angular_core.WritableSignal<boolean>;
    protected readonly isServiceMode: _angular_core.Signal<boolean>;
    protected readonly isTemplateMode: _angular_core.Signal<boolean>;
    protected readonly shouldRenderContent: _angular_core.Signal<boolean>;
    protected readonly isStringContent: _angular_core.Signal<boolean>;
    protected readonly shouldShowShadow: _angular_core.Signal<boolean>;
    private _lastScrollHeight;
    ngAfterViewChecked(): void;
    private _checkScrollState;
    onContentScroll(event: Event): void;
    protected readonly effectiveTitle: _angular_core.Signal<string | TemplateRef<unknown> | undefined>;
    protected readonly effectiveDescription: _angular_core.Signal<string | TemplateRef<unknown> | undefined>;
    protected readonly hasEffectiveDescription: _angular_core.Signal<boolean>;
    protected readonly headerContentClasses: _angular_core.Signal<string>;
    protected readonly effectiveBodyClass: _angular_core.Signal<ClassValue>;
    protected readonly bodyClasses: _angular_core.Signal<string>;
    protected readonly effectiveClosable: _angular_core.Signal<boolean>;
    protected readonly effectiveHideFooter: _angular_core.Signal<boolean | undefined>;
    protected readonly effectiveHideHeader: _angular_core.Signal<boolean>;
    protected readonly effectiveOkText: _angular_core.Signal<string | null | undefined>;
    protected readonly effectiveCancelText: _angular_core.Signal<string | null | undefined>;
    protected readonly effectiveOkDestructive: _angular_core.Signal<boolean | undefined>;
    protected readonly effectiveOkDisabled: _angular_core.Signal<boolean | undefined>;
    protected readonly effectiveLoading: _angular_core.Signal<boolean>;
    protected readonly effectiveContentLoading: _angular_core.Signal<boolean>;
    protected readonly effectiveSkeletonRows: _angular_core.Signal<number>;
    protected readonly effectivePlacement: _angular_core.Signal<ZDrawerPlacement>;
    protected readonly effectiveShadow: _angular_core.Signal<boolean>;
    protected readonly effectiveShape: _angular_core.Signal<ZDrawerShape>;
    protected readonly effectiveWidth: _angular_core.Signal<string | null>;
    protected readonly effectiveHeight: _angular_core.Signal<string | null>;
    protected readonly isDeferLoading: _angular_core.Signal<boolean>;
    protected readonly classes: _angular_core.Signal<string>;
    protected readonly hostClasses: _angular_core.Signal<string>;
    constructor();
    ngOnDestroy(): void;
    isDestroyed(): boolean;
    getNativeElement(): HTMLElement;
    attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
    attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
    onOkClick(): void;
    onCloseClick(): void;
    onBackdropClick(): void;
    open(): void;
    close(): void;
    private _createOverlay;
    private _openTemplateOverlay;
    private _closeWithAnimation;
    private _clearCloseTimeout;
    private _disposeTemplateOverlay;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZDrawerComponent<any, any>, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZDrawerComponent<any, any>, "z-drawer", ["zDrawer"], { "class": { "alias": "class"; "required": false; "isSignal": true; }; "zBodyClass": { "alias": "zBodyClass"; "required": false; "isSignal": true; }; "zVisible": { "alias": "zVisible"; "required": false; "isSignal": true; }; "zTitle": { "alias": "zTitle"; "required": false; "isSignal": true; }; "zDescription": { "alias": "zDescription"; "required": false; "isSignal": true; }; "zWidth": { "alias": "zWidth"; "required": false; "isSignal": true; }; "zHeight": { "alias": "zHeight"; "required": false; "isSignal": true; }; "zPlacement": { "alias": "zPlacement"; "required": false; "isSignal": true; }; "zClosable": { "alias": "zClosable"; "required": false; "isSignal": true; }; "zMaskClosable": { "alias": "zMaskClosable"; "required": false; "isSignal": true; }; "zHideFooter": { "alias": "zHideFooter"; "required": false; "isSignal": true; }; "zHideHeader": { "alias": "zHideHeader"; "required": false; "isSignal": true; }; "zOkText": { "alias": "zOkText"; "required": false; "isSignal": true; }; "zCancelText": { "alias": "zCancelText"; "required": false; "isSignal": true; }; "zOkDestructive": { "alias": "zOkDestructive"; "required": false; "isSignal": true; }; "zOkDisabled": { "alias": "zOkDisabled"; "required": false; "isSignal": true; }; "zLoading": { "alias": "zLoading"; "required": false; "isSignal": true; }; "zOverlay": { "alias": "zOverlay"; "required": false; "isSignal": true; }; "zShadow": { "alias": "zShadow"; "required": false; "isSignal": true; }; "zShape": { "alias": "zShape"; "required": false; "isSignal": true; }; "zContentLoading": { "alias": "zContentLoading"; "required": false; "isSignal": true; }; "zSkeletonRows": { "alias": "zSkeletonRows"; "required": false; "isSignal": true; }; }, { "zOnOk": "zOnOk"; "zOnCancel": "zOnCancel"; "zAfterClose": "zAfterClose"; "zScrollbar": "zScrollbar"; "zVisible": "zVisibleChange"; }, ["customHeader", "customContent", "customFooter"], ["*"], true, never>;
}

declare class ZDrawerService {
    private readonly _overlay;
    private readonly _injector;
    private readonly _platformId;
    private readonly _zIndexService;
    create<T, U>(config: ZDrawerOptions<T, U>): ZDrawerRef<T>;
    private _open;
    private _createOverlay;
    private _attachDrawerContainer;
    private _attachDrawerContent;
    private _createInjector;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZDrawerService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<ZDrawerService>;
}

export { ZDrawerComponent, ZDrawerContentDirective, ZDrawerFooterDirective, ZDrawerHeaderDirective, ZDrawerOptions, ZDrawerRef, ZDrawerService, Z_DRAWER_DATA, zDrawerVariants };
export type { ZDrawerContentType, ZDrawerPlacement };
