import { HttpErrorResponse } from "@angular/common/http"; import * as i0 from "@angular/core"; import { ErrorHandler, FactoryProvider, InjectionToken, PipeTransform, Provider, Signal } from "@angular/core"; import { MatDialogRef } from "@angular/material/dialog"; import { MonoTypeOperatorFunction, Observable, OperatorFunction } from "rxjs"; import { SafeHtml } from "@angular/platform-browser"; export declare const GLOBAL_ERROR_DIALOG_OPTIONS: InjectionToken; export interface GlobalErrorDialogOptions { /** * Whether the dialog should be shown. Defaults to false. */ allowIgnore?: boolean; messages: { /** * The translation key to use for the title of the dialog. */ title: string; /** * The translation key to use for the title of the expansion panel. */ singleErrorDetails: string; /** * The translation key to use for the button to copy a single error to the clipboard. * Optional. Must be provided if `copy.singleError` is true or unset. */ copySingleError?: string; /** * The translation key to use for the button to copy all errors to the clipboard. * Optional. Must be provided if `copy.allErrors` is true or unset. */ copyAllErrors?: string; /** * The translation key to use for the button to go to the home page. * Optional. Must be provided if `navigation.home` is true or unset. */ goHome?: string; /** * The translation key to use for the button to reload the page. * Optional. Must be provided if `navigation.reload` is true or unset. */ reload?: string; /** * The translation key to use for the button to ignore the error. * Optional. Must be provided if `allowIgnore` is true. */ ignore?: string; /** * Message to show instead of the actual error messages. When this is set, the actual error messages are not shown. */ genericErrorMessage?: string; }; copy?: { /** * Whether copying a single error is supported. Defaults to true. */ singleError?: boolean; /** * Whether copying all errors is supported. Defaults to true. */ allErrors?: boolean; }; navigation?: { /** * Whether the "go home" button is supported. Defaults to true. */ home?: boolean; /** * Whether the "reload" button is supported. Defaults to true. */ reload?: boolean; }; } export declare class GlobalErrorDialogComponent { #private; readonly errors: Array; get messages(): GlobalErrorDialogOptions['messages']; get canIgnore(): boolean; get canGoHome(): boolean; get canCopyAllErrors(): boolean; get canCopySingleError(): boolean; get canReload(): boolean; get showGenericErrorMessage(): boolean; reloadPage(): void; toHome(): void; copyError(error: GlobalError): void; copyAllErrors(): void; private copyErrorsToClipboard; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export interface GlobalError { message?: string; errorInstance?: Error | null; } /** * Handle any errors thrown by Angular application. */ export declare class GlobalErrorHandler extends ErrorHandler { #private; dialogRef?: MatDialogRef; preventConsoleErrorLogging: boolean; pageIsBeingUnloaded: boolean; constructor(); handleError(error: Error | HttpErrorResponse | string): void; onPageUnloading(): void; extractErrorInstance(error: Error | HttpErrorResponse | string): Error | null; extractErrorMessage(error: Error | HttpErrorResponse | string): string; private get dialog(); private get zone(); private openDialog; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare const provideGlobalErrorHandler: ({ errorDialogOptions, errorHandlers }: { errorDialogOptions: GlobalErrorDialogOptions; errorHandlers?: Array; }) => Array; export interface PpwLoggerOptions { debug?: boolean; prefix?: string; } export declare const PPW_LOGGER: InjectionToken; export interface PpwLogger { readonly debugMode: boolean; readonly prefix: string; debug(message?: any, ...optionalParams: any[]): void; info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; error(message?: any, ...optionalParams: any[]): void; } export declare class Logger implements PpwLogger { readonly prefix: string; readonly debugMode: boolean; constructor(prefix: string, debugMode: boolean); debug(message?: any, ...optionalParams: any[]): void; info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; error(message?: any, ...optionalParams: any[]): void; private prefixMessage; } export declare const provideLogger: (options?: PpwLoggerOptions) => FactoryProvider; export interface InMemoryLogLine { type: 'debug' | 'info' | 'log' | 'warn' | 'error'; message: string; optionalParams: any[]; } export declare class InMemoryLogger implements PpwLogger { readonly prefix: string; readonly debugMode: boolean; readonly logLines: Array; constructor(prefix: string, debugMode: boolean); debug(message?: any, ...optionalParams: any[]): void; info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; error(message?: any, ...optionalParams: any[]): void; clear(): void; private prefixMessage; } export declare const provideInMemoryLogger: (options?: PpwLoggerOptions) => FactoryProvider; /** Defines a constructable type. */ export type Constructor = new (...args: Array) => T; /** * Defines that subscriptions can be handled. */ export interface CanHandleSubscriptions { /** Function to be used to wrap a stream with subscription handling. */ stopOnDestroy(stream$: Observable): Observable; } /** Constructable type that can handle subscriptions. */ export type CanHandleSubscriptionsCtor = Constructor; /** * Mixin to extend the given constructable with functionality to manage subscriptions. * Provides the following: * - A function to wrap a stream with the PPW way of subscription handling. * - An ngOnDestroy implementation to automatically unsubscribe to all known subscriptions. */ export declare const mixinHandleSubscriptions: >(base?: T) => CanHandleSubscriptionsCtor & T; /** * Defines helper functions to make responsive designed screen layouts. * For screensizes see here: https://material.angular.dev/cdk/layout/overview#predefined-breakpoints */ export interface CanResponsiveObservers { /** Observable to see if screen size is at least Small. * @deprecated It is advised to start using the isAtLeastSmall signal instead. */ isSmallScreen$: Observable; /** Observable to see if screen size is at least XSmall. * @deprecated It is advised to start using the isAtLeastXSmall signal instead. */ isXSmallScreen$: Observable; /** Observable to see if screen size is at least Medium. * @deprecated It is advised to start using the isAtLeastMedium signal instead. */ isMediumScreen$: Observable; /** Observable to see if screen size is at least Large. * @deprecated It is advised to start using the isAtLeastLarge signal instead. */ isLargeScreen$: Observable; /** Observable to see if screen size is at least XLarge. * @deprecated It is advised to start using the isAtLeastXLarge signal instead. */ isXLargeScreen$: Observable; /** Signal to see if screen size is at least XSmall. */ isAtLeastXSmall: Signal; /** Signal to see if screen size is at least Small. */ isAtLeastSmall: Signal; /** Signal to see if screen size is at least Medium. */ isAtLeastMedium: Signal; /** Signal to see if screen size is at least Large. */ isAtLeastLarge: Signal; /** Signal to see if screen size is at least XLarge. */ isAtLeastXLarge: Signal; /** Signal to see if screen size is XSmall. */ isXSmall: Signal; /** Signal to see if screen size is Small. */ isSmall: Signal; /** Signal to see if screen size is Medium. */ isMedium: Signal; /** Signal to see if screen size is Large. */ isLarge: Signal; /** Signal to see if screen size is XLarge. */ isXLarge: Signal; } /** Constructable type that offers responsive observers helper functions. */ export type CanResponsiveObserversCtor = Constructor; /** * Mixin to extend the given constructable with functionality to implement responsive design. * Provides the following: * - functions to know the current screensize. */ export declare const mixinResponsiveObservers: >(base?: T) => CanResponsiveObserversCtor & T; /** * Interface describing something that supports "pending" tracking. */ export interface CanTrackPending { /** Tracks the pending state. */ pending$: Observable; startPending: (trackingName?: string) => MonoTypeOperatorFunction; stopPending: (trackingName?: string) => MonoTypeOperatorFunction; /** Wraps the given observable with the startPending and stopPending tracking functions. */ trackPending(stream$: Observable, trackingName?: string): Observable; /** Gets an observable emitting the pending state of the tracker. */ isPending: (trackingName?: string, isInitiallyPending?: boolean) => Observable; } /** A constructable type that implements the CanPage interface. */ export type CanTrackPendingCtor = Constructor; /** * Enhances the given base class with functionality for tracking a "pending" state. * The initial state of the pending situation is "true". * @param isInitiallyPending Whether the pending state is true on initial creation of the class. * @param base An optional base class. */ export declare const mixinTrackPending: >(isInitiallyPending?: boolean, base?: T) => T & CanTrackPendingCtor; interface PpwTranslationMap { [key: string]: string; } export declare class PpwApiTranslatePipe implements PipeTransform { private locale; transform(value?: PpwTranslationMap): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Sanitizes an HTML string with Angular's built-in HTML sanitizer and returns the * sanitized result as `SafeHtml`. * * The pipe first removes unsafe markup such as scripts and dangerous attributes * by calling `DomSanitizer.sanitize(SecurityContext.HTML, value)`. It then wraps * the sanitized output with `bypassSecurityTrustHtml` so Angular can bind the * result to `[innerHTML]` without sanitizing it a second time. * * Use this pipe when the source value may contain user-provided or otherwise * untrusted HTML and you want to render the remaining safe markup in the view. * Typical usage is: * * `
` * * Do not use this pipe to preserve unsafe markup. Any content removed by the * sanitizer is intentionally discarded before the result is marked as trusted. */ export declare class PpwSanitizeHtmlPipe implements PipeTransform { private readonly sanitizer; /** Returns trusted HTML that has already been sanitized for safe rendering. */ transform(value: string | null): SafeHtml; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export declare function truthyFirst(): OperatorFunction; export declare function truthyFilter(): OperatorFunction; export declare const LOCAL_STORAGE_TOKEN: InjectionToken; export declare class LocalStorageMock implements Storage { private data; get length(): number; clear(): void; getItem(key: string): string | null; key(index: number): string | null; removeItem(key: string): void; setItem(key: string, value: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare const provideLocalStorage: () => Provider; export declare const provideLocalStorageMock: () => Provider; export declare const SESSION_STORAGE_TOKEN: InjectionToken; export declare class SessionStorageMock implements Storage { private data; get length(): number; clear(): void; getItem(key: string): string | null; key(index: number): string | null; removeItem(key: string): void; setItem(key: string, value: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare const provideSessionStorage: () => Provider; export declare const provideSessionStorageMock: () => Provider; export type ObservableConvertableValue = T | Signal | Observable; export declare const invert: (observable$: ObservableConvertableValue) => Observable; export declare const oneTrue: (...observables$: ObservableConvertableValue[]) => Observable; export declare const WINDOW: InjectionToken;