import * as i0 from '@angular/core'; import { ModuleWithProviders, Injector, InjectionToken, Provider } from '@angular/core'; import * as angular_oauth2_oidc from 'angular-oauth2-oidc'; import { OAuthStorage, OAuthErrorEvent, OAuthService, AuthConfig } from 'angular-oauth2-oidc'; import * as _abp_ng_core from '@abp/ng.core'; import { PipeToLoginFn, CheckAuthenticationStateFn, IAuthService, LoginParams, AbpAuthResponse, AbstractAuthErrorFilter, AuthErrorFilter, AbpLocalStorageService, AbpCookieStorageService, HttpErrorReporterService, EnvironmentService, ConfigStateService, SessionStateService, AbpWindowService, IApiInterceptor, IAbpGuard, AuthService } from '@abp/ng.core'; import * as rxjs from 'rxjs'; import { Observable } from 'rxjs'; import { Params, Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, CanActivateFn } from '@angular/router'; import { HttpHeaders, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http'; /** * @deprecated AbpOAuthModule is deprecated use `provideAbpOAuth` *function* instead. */ declare class AbpOAuthModule { static forRoot(): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class MockStorage implements Storage { private data; get length(): number; clear(): void; getItem(key: string): string; key(index: number): string; removeItem(key: string): void; setItem(key: string, value: string): void; } declare function oAuthStorageFactory(): OAuthStorage; declare const pipeToLogin: PipeToLoginFn; declare function isTokenExpired(expireDate: number): boolean; declare function clearOAuthStorage(injector: Injector): void; declare const checkAccessToken: CheckAuthenticationStateFn; declare class AbpOAuthService implements IAuthService { protected injector: Injector; private appStartedWithSsr; private platformId; private document; private strategy; private readonly oAuthService; get oidc(): boolean; set oidc(value: boolean); get isInternalAuth(): boolean; constructor(); init(): Promise; logout(queryParams?: Params): Observable; navigateToLogin(queryParams?: Params): void; login(params: LoginParams): Observable; get isAuthenticated(): boolean; loginUsingGrant(grantType: string, parameters: object, headers?: HttpHeaders): Promise; getRefreshToken(): string; getAccessToken(): string; refreshToken(): Promise; getAccessTokenExpiration(): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class OAuthErrorFilterService extends AbstractAuthErrorFilter, OAuthErrorEvent> { protected readonly _filters: i0.WritableSignal[]>; readonly filters: i0.Signal[]>; get(id: string): AuthErrorFilter; add(filter: AuthErrorFilter): void; patch(item: Partial>): void; remove(id: string): void; run(event: OAuthErrorEvent): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class RememberMeService { #private; protected readonly localStorageService: AbpLocalStorageService; protected readonly cookieStorageService: AbpCookieStorageService; private appStartedWithSsr; set(remember: boolean): void; remove(): void; get(): boolean; getFromToken(accessToken: string): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class BrowserTokenStorageService implements OAuthStorage { getItem(key: string): string; removeItem(key: string): void; setItem(key: string, data: string): void; readCookie(name: string): string | null; writeCookie(name: string, value: string, days?: number): void; removeCookie(name: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ServerTokenStorageService implements OAuthStorage { private req; private cookies; private cookiesStr; constructor(req: Request | null); getItem(key: string): string; setItem(_k: string, _v: string): void; removeItem(_k: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class MemoryTokenStorageService implements OAuthStorage { private static workerUrl; private keysShouldStoreInMemory; private keysShouldStoreInSession; private worker?; private port?; private cache; private localStorageService; private _document; private destroyRef; private useSharedWorker; constructor(); private initializeStorage; getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; clear(): void; private cleanupPort; private setupCleanup; private checkAuthStateChanges; private refreshDocument; private getSessionStorage; private getSessionItem; private setSessionItem; private removeSessionItem; private createWorkerDataUrl; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare abstract class AuthFlowStrategy { protected injector: Injector; abstract readonly isInternalAuth: boolean; protected httpErrorReporter: HttpErrorReporterService; protected environment: EnvironmentService; protected configState: ConfigStateService; protected oAuthService: OAuthService; protected oAuthConfig: AuthConfig; protected sessionState: SessionStateService; protected localStorageService: AbpLocalStorageService; protected rememberMeService: RememberMeService; protected windowService: AbpWindowService; protected tenantKey: string; protected router: Router; protected readonly oAuthErrorFilterService: OAuthErrorFilterService; abstract checkIfInternalAuth(queryParams?: Params): boolean; abstract navigateToLogin(queryParams?: Params): void; abstract logout(queryParams?: Params): Observable; abstract login(params?: LoginParams | Params): Observable; private catchError; constructor(injector: Injector); init(): Promise; protected navigateToPreviousUrl(): void; protected refreshToken(): Promise; protected listenToOauthErrors(): void; } declare class AuthCodeFlowStrategy extends AuthFlowStrategy { protected injector: Injector; readonly isInternalAuth = false; private platformId; protected appStartedWithSSR: boolean; protected document: Document; constructor(injector: Injector); init(): Promise; private checkRememberMeOption; private getCultureParams; protected setUICulture(): void; protected replaceURLParams(): void; protected listenToTokenReceived(): void; navigateToLogin(queryParams?: Params): void; checkIfInternalAuth(queryParams?: Params): boolean; logout(queryParams?: Params): rxjs.Observable; login(queryParams?: Params): rxjs.Observable; } declare class AuthPasswordFlowStrategy extends AuthFlowStrategy { readonly isInternalAuth = true; private listenToTokenExpiration; init(): Promise; private checkRememberMeOption; navigateToLogin(queryParams?: Params): Promise; checkIfInternalAuth(): boolean; login(params: LoginParams): Observable; logout(): Observable<{ localization?: { values?: { [x: string]: { [x: string]: string; }; }; resources?: { [x: string]: { texts?: { [x: string]: string; }; baseResources?: string[]; }; }; languages?: _abp_ng_core.LanguageInfo[]; currentCulture?: { displayName?: string; englishName?: string; threeLetterIsoLanguageName?: string; twoLetterIsoLanguageName?: string; isRightToLeft?: boolean; cultureName?: string; name?: string; nativeName?: string; dateTimeFormat?: { calendarAlgorithmType?: string; dateTimeFormatLong?: string; shortDatePattern?: string; fullDateTimePattern?: string; dateSeparator?: string; shortTimePattern?: string; longTimePattern?: string; }; }; defaultResourceName?: string; languagesMap?: { [x: string]: _abp_ng_core.NameValue[]; }; languageFilesMap?: { [x: string]: _abp_ng_core.NameValue[]; }; useRouteBasedCulture?: boolean; }; auth?: { grantedPolicies?: { [x: string]: boolean; }; }; setting?: { values?: { [x: string]: string; }; }; currentUser?: { isAuthenticated?: boolean; id?: string; tenantId?: string; impersonatorUserId?: string; impersonatorTenantId?: string; impersonatorUserName?: string; impersonatorTenantName?: string; userName?: string; name?: string; surName?: string; email?: string; emailVerified?: boolean; phoneNumber?: string; phoneNumberVerified?: boolean; roles?: string[]; }; features?: { values?: { [x: string]: string; }; }; globalFeatures?: { enabledFeatures?: string[]; }; multiTenancy?: { isEnabled?: boolean; userSharingStrategy?: _abp_ng_core.TenantUserSharingStrategy; }; currentTenant?: { id?: string; name?: string; isAvailable?: boolean; }; timing?: { timeZone?: { iana?: { timeZoneName?: string; }; windows?: { timeZoneId?: string; }; }; }; clock?: { kind?: string; }; objectExtensions?: { modules?: { [x: string]: { entities?: { [x: string]: { properties?: { [x: string]: { type?: string; typeSimple?: string; displayName?: { name?: string; resource?: string; }; api?: { onGet?: { isAvailable?: boolean; }; onCreate?: { isAvailable?: boolean; }; onUpdate?: { isAvailable?: boolean; }; }; ui?: { onTable?: { isVisible?: boolean; }; onCreateForm?: { isVisible?: boolean; }; onEditForm?: { isVisible?: boolean; }; lookup?: { url?: string; resultListPropertyName?: string; displayPropertyName?: string; valuePropertyName?: string; filterParamName?: string; }; }; attributes?: _abp_ng_core.ExtensionPropertyAttributeDto[]; configuration?: { [x: string]: object; }; defaultValue?: object; }; }; configuration?: { [x: string]: object; }; }; }; configuration?: { [x: string]: object; }; }; }; enums?: { [x: string]: { fields?: _abp_ng_core.ExtensionEnumFieldDto[]; localizationResource?: string; }; }; }; extraProperties?: { [x: string]: object; }; }>; protected refreshToken(): Promise; } declare const AUTH_FLOW_STRATEGY: { Code(injector: Injector): AuthCodeFlowStrategy; Password(injector: Injector): AuthPasswordFlowStrategy; }; declare const COOKIES: InjectionToken; declare class OAuthConfigurationHandler { private oAuthService; private environmentService; private options; constructor(); private listenToSetEnvironment; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class OAuthApiInterceptor implements IApiInterceptor { private oAuthService; private sessionState; private httpWaitService; private tenantKey; intercept(request: HttpRequest, next: HttpHandler): Observable>; getAdditionalHeaders(existingHeaders?: HttpHeaders): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * @deprecated Use `abpOAuthGuard` *function* instead. */ declare class AbpOAuthGuard implements IAbpGuard { protected readonly oAuthService: OAuthService; protected readonly authService: AuthService; canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean | UrlTree; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const abpOAuthGuard: CanActivateFn; declare const buildLoginUrl: (path: string, params?: Params) => string; declare const asyncAbpOAuthGuard: CanActivateFn; declare const NavigateToManageProfileProvider: Provider; declare function provideAbpOAuth(): i0.EnvironmentProviders; export { AUTH_FLOW_STRATEGY, AbpOAuthGuard, AbpOAuthModule, AbpOAuthService, AuthCodeFlowStrategy, AuthFlowStrategy, AuthPasswordFlowStrategy, BrowserTokenStorageService, COOKIES, MemoryTokenStorageService, MockStorage, NavigateToManageProfileProvider, OAuthApiInterceptor, OAuthConfigurationHandler, OAuthErrorFilterService, RememberMeService, ServerTokenStorageService, abpOAuthGuard, asyncAbpOAuthGuard, buildLoginUrl, checkAccessToken, clearOAuthStorage, isTokenExpired, oAuthStorageFactory, pipeToLogin, provideAbpOAuth };