import { ErrorHandler } from '@angular/core'; import { FirebaseApp } from '@firebase/app'; /** * An instance of the Firebase Crashlytics SDK. * * Do not create this instance directly. Instead, use {@link getCrashlytics | getCrashlytics()}. * * @public */ export declare interface Crashlytics { /** * The {@link @firebase/app#FirebaseApp} this {@link Crashlytics} instance is associated with. */ app: FirebaseApp; } /** * Options for initializing the Crashlytics service using {@link getCrashlytics | getCrashlytics()}. * * @public */ export declare interface CrashlyticsOptions { /** * The URL for the endpoint to which Crashlytics data should be sent, in the OpenTelemetry format. * By default, data will be sent to Firebase. */ endpointUrl?: string; /** * The Google Cloud region where the Crashlytics data should be sent. * * By default, data will be sent to the "global" region. * * Refer to https://cloud.google.com/logging/docs/regions for the list of available regions. */ region?: string; /** * The version of the application. This should be a unique string that identifies the snapshot of * code to be deployed, such as "1.0.2". If not specified, other default locations will be checked * for an identifier. Setting a value here takes precedence over any other values. */ appVersion?: string; } /** * A custom ErrorHandler that captures uncaught errors and sends them to Firebase Crashlytics. * * This should be provided in your application's root module. * * @example * Basic usage: * ```typescript * import { ApplicationConfig, ErrorHandler } from '@angular/core'; * import { FirebaseErrorHandler } from 'firebase/crashlytics-angular'; * * export const appConfig: ApplicationConfig = { * providers: [ * { * provide: ErrorHandler, * useFactory: () => new FirebaseErrorHandler(firebaseApp) * } * ], * // ... * }; * ``` * * @example * Providing telemetry options: * ```typescript * import { ApplicationConfig, ErrorHandler } from '@angular/core'; * import { FirebaseErrorHandler } from 'firebase/crashlytics-angular'; * * export const appConfig: ApplicationConfig = { * providers: [ * { * provide: ErrorHandler, * useFactory: () => new FirebaseErrorHandler(firebaseApp, { appVersion: '1.2.3' }) * } * ], * // ... * }; * ``` * * @param firebaseApp - The {@link @firebase/app#FirebaseApp} instance to use. * @param crashlyticsOptions - Optional. {@link CrashlyticsOptions} that configure the Crashlytics instance. * To provide these options, you must use a `useFactory` provider as shown in the example above. * * @public */ export declare class FirebaseErrorHandler implements ErrorHandler { private readonly router; private readonly crashlytics; constructor(app: FirebaseApp, crashlyticsOptions?: CrashlyticsOptions); handleError(error: unknown): void; /** * Returns a record of framework-specific attributes based on the current application state to be * attached to the error log. */ private getAttributes; /** * Constructs the safe, templated route path from the router state. * Example output: '/users/:id/posts' */ private getSafeRoutePath; } export { }