import * as i0 from '@angular/core';
import { Signal, InjectionToken } from '@angular/core';
import * as _angular_router from '@angular/router';
import { CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { MaybeAsync } from '@sdcorejs/utils/models';
import { Observable } from 'rxjs';

interface SdAuthInfo<T = any> {
    id?: string;
    username?: string;
    firstName?: string;
    lastName?: string;
    email?: string;
    data?: T;
}

declare class SdAuthService {
    #private;
    private authConfiguration;
    getAuthInfo?: Signal<SdAuthInfo | undefined>;
    signout$?: Observable<void>;
    changePassword$?: Observable<void>;
    constructor(authConfiguration: ISdAuthConfiguration);
    signout: () => void;
    changePassword: () => void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SdAuthService, [{ optional: true; }]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SdAuthService>;
}

interface ISdAuthConfiguration {
    action?: IAuthConfigurationAction;
    guard?: IAuthConfigurationGuard;
}
declare const SD_AUTH_CONFIGURATION: InjectionToken<ISdAuthConfiguration>;
interface IAuthConfigurationAction {
    signout: () => MaybeAsync<void>;
    changePassword?: () => MaybeAsync<void>;
}
interface IAuthConfigurationGuard {
    auth?: CanActivate['canActivate'];
    portal?: CanActivate['canActivate'];
    authInfo: () => MaybeAsync<SdAuthInfo>;
}

declare class SdAuthGuard implements CanActivate {
    private authConfiguration;
    protected readonly router: Router;
    constructor(authConfiguration: ISdAuthConfiguration, router: Router);
    canActivate: (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => _angular_router.MaybeAsync<_angular_router.GuardResult>;
    static ɵfac: i0.ɵɵFactoryDeclaration<SdAuthGuard, [{ optional: true; }, null]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SdAuthGuard>;
}

declare class SdPortalGuard implements CanActivate {
    private authConfiguration;
    protected readonly router: Router;
    constructor(authConfiguration: ISdAuthConfiguration, router: Router);
    canActivate: (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => _angular_router.MaybeAsync<_angular_router.GuardResult>;
    static ɵfac: i0.ɵɵFactoryDeclaration<SdPortalGuard, [{ optional: true; }, null]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SdPortalGuard>;
}

export { SD_AUTH_CONFIGURATION, SdAuthGuard, SdAuthService, SdPortalGuard };
export type { ISdAuthConfiguration, SdAuthInfo };
