/** * @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 { Crashlytics, CrashlyticsOptions } from './public-types'; import { CrashlyticsFeatureInternal } from './types'; import { type TimeInput } from '@opentelemetry/api'; /** * Returns the breadcrumbs feature implementation if enabled in options. * * @internal */ export declare function getBreadcrumbsFeature(options?: CrashlyticsOptions): CrashlyticsFeatureInternal | undefined; /** * Converts OpenTelemetry TimeInput to milliseconds since epoch. */ export declare function timeInputToMilliseconds(time: TimeInput): number; /** * Generates a unique UUID v4 format string using the Web Crypto API. * Uses `crypto.randomUUID()` when available (Secure Contexts), otherwise falls back to * `crypto.getRandomValues()` for non-HTTPS contexts. * * @internal */ export declare function generateUuid(): string; /** * Generate a new session UUID. We record it in two places: * 1. The client browser's sessionStorage (via attributesStore) * 2. In Cloud Logging as its own log entry */ export declare function startNewSession(crashlytics: Crashlytics): void; /** * Registers event listeners to flush logs when the page is hidden. In some cases multiple listeners * may trigger at the same time, but flushing only occurs once per batch. */ export declare function registerListeners(crashlytics: Crashlytics): () => 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; /** * Flushes all enqueued Crashlytics data immediately, instead of waiting for default batching. * * @beta * * @param crashlytics - The {@link Crashlytics} instance. * @returns a promise which is resolved when all flushes are complete */ export declare function flush(crashlytics: Crashlytics): Promise; /** * Logs a page visibility transition event (foreground or background). * * @internal * * @param crashlytics - The {@link Crashlytics} instance. * @param visibilityState - The current page visibility state ('visible' or 'hidden'). */ export declare function logVisibilityEvent(crashlytics: Crashlytics, visibilityState: 'visible' | 'hidden'): void; /** * Resolves the base telemetry endpoint URL based on the provided options. * Uses the regional endpoint (REP) format (`https://clienttelemetry.{region}.rep.googleapis.com`) * when a non-global region is specified and no custom `endpointUrl` override is provided. * * @internal */ export declare function getTelemetryEndpointUrl(crashlyticsOptions?: CrashlyticsOptions): string; /** * Determines whether a given URL string targets the Firebase Crashlytics telemetry ingestion endpoint. * Used to automatically drop self-referential telemetry records (e.g. from ResourceTiming or Fetch instrumentations). * * @internal */ export declare function isTelemetryUrl(url: unknown, customEndpoint?: string): boolean;