import { AnyValueMap } from '@opentelemetry/api-logs'; import { FirebaseApp } from '@firebase/app'; import { Instrumentation } from 'next'; /** * 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; } /** * Flushes all enqueued Crashlytics data immediately, instead of waiting for default batching. * * @public * * @param crashlytics - The {@link Crashlytics} instance. * @returns a promise which is resolved when all flushes are complete */ export declare function flush(crashlytics: Crashlytics): Promise; /** * Returns the default {@link Crashlytics} instance that is associated with the provided * {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new instance with the * default settings. * * @example * ```javascript * const crashlytics = getCrashlytics(app); * ``` * * @param app - The {@link @firebase/app#FirebaseApp} to use. * @param options - {@link CrashlyticsOptions} that configure the Crashlytics instance. * @returns The default {@link Crashlytics} instance for the given {@link @firebase/app#FirebaseApp}. * * @public */ export declare function getCrashlytics(app?: FirebaseApp, options?: CrashlyticsOptions): Crashlytics; export { Instrumentation } /** * Automatically report uncaught errors from server routes to Firebase Crashlytics. * * @example * ```javascript * // In instrumentation.ts (https://nextjs.org/docs/app/guides/instrumentation): * import { nextOnRequestError } from 'firebase/crashlytics' * export const onRequestError = nextOnRequestError(); * ``` * * @param crashlyticsOptions - {@link CrashlyticsOptions} that configure the Crashlytics instance. * @returns A request error handler for use in Next.js' instrumentation file * * @public */ export declare function nextOnRequestError(crashlyticsOptions?: CrashlyticsOptions): Instrumentation.onRequestError; /** * Enqueues an error to be uploaded to the Firebase Crashlytics API. * * @public * * @param crashlytics - The {@link Crashlytics} instance. * @param error - The caught exception, typically an Error object * @param attributes - Optional, arbitrary attributes to attach to the error log */ export declare function recordError(crashlytics: Crashlytics, error: unknown, attributes?: AnyValueMap): void; /** * Registers global event listeners for uncaught errors and promise rejections. * Automatically avoids double logging if the error was already logged. * * @internal */ export declare function registerGlobalErrorListeners(crashlytics: Crashlytics): () => void; export { }