import * as i0 from '@angular/core';
import { Type, ElementRef, ChangeDetectorRef, OnDestroy } from '@angular/core';
import { Color } from '@sdcorejs/utils/models';
import { Subject, BehaviorSubject } from 'rxjs';
import { CdkDragDrop } from '@angular/cdk/drag-drop';

interface SdTabInfo {
    name: string;
    icon?: string;
    tooltip?: string;
    color?: Color;
}
interface SdTab {
    component: Type<any>;
    injector?: any;
    key: string;
    isActive: boolean;
    url: string;
    params?: Record<string, string | number>;
    queryParams?: Record<string, string | number>;
    data?: Record<string, any>;
    tabInfoChanges: Subject<SdTabInfo>;
    beforeClose?: () => boolean | Promise<boolean>;
}

declare class SdTabRouterNavComponent {
    tabRouterNav: i0.Signal<ElementRef<any> | undefined>;
    tabs: i0.InputSignal<SdTab[]>;
    mode: 'default' | 'compact';
    cdRef: ChangeDetectorRef;
    elementRef: ElementRef<any>;
    onResize(): void;
    checkUI: () => void;
    onDrop: (event: CdkDragDrop<SdTab[]>) => void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SdTabRouterNavComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SdTabRouterNavComponent, "sd-tab-router-nav", never, { "tabs": { "alias": "tabs"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class SdTabRouterOutletComponent implements OnDestroy {
    #private;
    disabled: i0.InputSignalWithTransform<boolean, unknown>;
    tabRouterNav: i0.Signal<SdTabRouterNavComponent | undefined>;
    tabs: i0.WritableSignal<SdTab[]>;
    constructor();
    ngOnDestroy(): void;
    tabTrackBy: (index: number, tab: SdTab) => string;
    static ɵfac: i0.ɵɵFactoryDeclaration<SdTabRouterOutletComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SdTabRouterOutletComponent, "sd-tab-router-outlet", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

interface SdTabAction {
    type: 'close';
    tab: SdTab;
}

interface SdTabComponentArgs {
    url?: string;
    params?: any;
    queryParams?: any;
    data?: Record<string, any>;
}
declare interface SdTabComponentBuilder {
    component: Type<any>;
    name: string | ((args: SdTabComponentArgs) => string);
    icon?: string | ((args: SdTabComponentArgs) => string);
    tooltip?: string | ((args: SdTabComponentArgs) => string);
    color?: Color | ((args: SdTabComponentArgs) => Color);
}
declare function SdTabComponent<T>(builder: SdTabComponentBuilder): (constructor: T) => void;

declare class SdTabBase {
    #private;
    constructor(tab: SdTab | undefined);
    get tab(): SdTab | undefined;
}
declare class SdTabActivated extends SdTabBase {
}
declare class SdTabDeactivated extends SdTabBase {
}
declare type SdTabEvent = SdTabActivated | SdTabDeactivated;

declare class SdTabRouterService {
    #private;
    events: BehaviorSubject<SdTabEvent>;
    actions: BehaviorSubject<SdTabAction | undefined>;
    builders: BehaviorSubject<SdTabComponentBuilder[]>;
    currentTabChanges: BehaviorSubject<SdTab | undefined>;
    newTabs: BehaviorSubject<SdTab | undefined>;
    updateTabs: BehaviorSubject<SdTab | undefined>;
    constructor();
    addBuilder: (builder: SdTabComponentBuilder) => void;
    get currentTab(): SdTab | undefined;
    get currentKey(): string | null;
    setCurrentTab: (tab: SdTab) => void;
    pushEvent: (tab: SdTab, Event: Type<SdTabEvent>) => void;
    setOptions: () => void;
    close: (tab?: SdTab) => void;
    updateTab: (tab: SdTab) => void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SdTabRouterService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SdTabRouterService>;
}

export { SdTabComponent, SdTabRouterOutletComponent, SdTabRouterService };
export type { SdTab, SdTabComponentArgs, SdTabComponentBuilder, SdTabInfo };
