/** * @license * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { FirebaseApp } from '@firebase/app'; import { CRASHLYTICS_TYPE } from './constants'; import { Crashlytics, CrashlyticsOptions } from './public-types'; import { AnyValueMap } from '@opentelemetry/api-logs'; import { CrashlyticsService } from './service'; import { flush } from './helpers'; declare module '@firebase/component' { interface NameServiceMapping { [CRASHLYTICS_TYPE]: CrashlyticsService; } } /** * 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; /** * 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; export { flush }; /** * 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;