/** * @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 { Attributes } from '@opentelemetry/api'; 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}. * * @beta */ export declare function getCrashlytics(app?: FirebaseApp, options?: CrashlyticsOptions): Crashlytics; /** * Queues an error to be uploaded to the Firebase Crashlytics API. * * @beta * * @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; /** * (EXPERIMENTAL) Queues a log message to be uploaded to the Firebase Crashlytics API. * * @public * * @param crashlytics - The {@link Crashlytics} instance. * @param message - The message to log. * @param attributes - Optional, arbitrary attributes to attach to the log. */ export declare function log(crashlytics: Crashlytics, message: string, attributes?: AnyValueMap): void; /** * Creates a log for view boundary on navigation event * * @internal * * @param crashlytics - The {@link Crashlytics} instance. * @param urlTemplate - The new URL pattern being navigated to. * @param attributes - Optional, arbitrary attributes to attach to the view boundary log */ export declare function logViewBoundary(crashlytics: Crashlytics, urlTemplate: string, attributes?: Attributes): void; export { flush };