export interface FaroSourceMapUploaderPluginOptions { endpoint: string; appName: string; appId: string; apiKey: string; stackId: string; outputPath?: string; outputFiles?: string[] | RegExp; bundleId?: string; keepSourcemaps?: boolean; gzipContents?: boolean; verbose?: boolean; skipUpload?: boolean; maxUploadSize?: number; recursive?: boolean; proxy?: string; prefixPath?: string; prefixPathBasenameOnly?: boolean; gitHash?: string; } interface UploadSourceMapOptions { sourcemapEndpoint: string; apiKey: string; stackId: string; filePath: string; filename: string; keepSourcemaps: boolean; verbose?: boolean; proxy?: string; } interface UploadCompressedSourceMapsOptions { sourcemapEndpoint: string; apiKey: string; stackId: string; outputPath: string; files: string[]; keepSourcemaps: boolean; verbose?: boolean; proxy?: string; } /** * Detect a source map endpoint that points at a local/development receiver — i.e. one * not fronted by the Grafana Cloud gateway. Used to opt into sending an explicit * `X-Scope-OrgID` header alongside the bearer auth: production gateways derive the tenant * from the bearer token and overwrite client-supplied tenant headers, but a local * `kwl-endpoint` reads `X-Scope-OrgID` directly via `dskit/user` (it does not parse * `Authorization: Bearer x:y`). Returns `false` for any unparseable or non-local URL, * so production uploads stay byte-for-byte identical. */ export declare function isLocalEndpoint(endpoint: string): boolean; export declare const validateProxyUrl: (proxyUrl: string) => void; export declare const uploadSourceMap: (options: UploadSourceMapOptions) => Promise; export declare const uploadCompressedSourceMaps: (options: UploadCompressedSourceMapsOptions) => Promise; export declare const shouldProcessFile: (filename: string, outputFiles: string[] | RegExp | undefined) => boolean; /** * Prepend to JS bundles so `getBundleId(appName)` in `@grafana/faro-core` can read `meta.app.bundleId`. * Must resolve the **same** global as `globalObject` in faro-core (`globalThis` first). A previous * `window`-first order broke React Native Hermes when `window` exists but is not `globalThis`. */ export declare const faroBundleIdSnippet: (bundleId: string, appName: string) => string; export declare const faroGitHashSnippet: (gitHash: string, appName: string) => string; export declare function resolveGitHash(gitHash?: string): string | undefined; export declare function randomString(length?: number): string; export declare const consoleInfoOrange: (message: string) => void; export declare const WEBPACK_PLUGIN_NAME = "FaroSourceMapUploaderPlugin"; export declare const ROLLUP_PLUGIN_NAME = "rollup-plugin-faro-source-map-uploader"; export declare const ESBUILD_PLUGIN_NAME = "faro-esbuild-plugin"; export declare const THIRTY_MB_IN_BYTES: number; /** JS (and React Native bundle) source maps — excludes e.g. CSS maps. */ export declare const JS_SOURCEMAP_PATTERN: RegExp; export declare const cleanAppName: (appName: string) => string; /** * Exports the bundleId to an environment variable file for use in the CLI * @param bundleId The bundleId to export * @param appName The name of the app * @param verbose Whether to log the export */ export declare const exportBundleIdToFile: (bundleId: string, appName: string, verbose?: boolean) => void; /** * Normalizes a prefix path by ensuring it ends with a forward slash * @param prefix The prefix to normalize * @returns The normalized prefix */ export declare const normalizePrefix: (prefix: string) => string; /** * Ensures a source map has a file property, setting it from the source map filename if missing * @param filePath Path to the source map file * @param verbose Whether to log verbose messages */ export declare const ensureSourceMapFileProperty: (filePath: string, verbose?: boolean) => void; /** * Ensures all source maps in a directory have a file property when it is missing * by scanning JS files for sourceMappingURL comments. This handles bundlers like * Turbopack that use different hashes for JS files and their corresponding source * map files. Falls back to deriving the file property from the map filename if no * JS file references the map. Existing sourceMap.file values are preserved and are * not overwritten. * @param outputDir Directory containing JS and source map files * @param verbose Whether to log verbose messages * @param recursive Whether to recursively search subdirectories */ export declare const ensureSourceMapFileProperties: (outputDir: string, verbose?: boolean, recursive?: boolean) => void; /** * Modifies a source map file to prepend a prefix to the file property * @param filePath Path to the source map file * @param prefix Prefix to prepend to the file property (will be normalized) * @param verbose Whether to log verbose messages * @param basenameOnly Whether to only use the basename of the file */ export declare const modifySourceMapFileProperty: (filePath: string, prefix: string, verbose?: boolean, basenameOnly?: boolean) => void; export {};