import type { CustomTransform, InstrumentationConfig } from '@apm-js-collab/code-transformer';
type Diagnostics = {
    transformedModules: string[];
    failedModules: string[];
};
export declare const COMMENT_USE_STRICT_REGEX: RegExp;
/**
 * Checks if a file is a JavaScript file based on its extension.
 * Handles query strings and hashes in the filename.
 */
export declare function isJsFile(fileName: string): boolean;
/**
 * Checks if a chunk contains only import/export statements and no substantial code.
 *
 * In Vite MPA (multi-page application) mode, HTML entry points create "facade" chunks
 * that only contain import statements to load shared modules. These should not have
 * Sentry code injected. However, in SPA mode, the main bundle also has an HTML facade
 * but contains substantial application code that SHOULD have debug IDs injected.
 *
 * @ref https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829
 * @ref https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/839
 */
export declare function containsOnlyImports(code: string): boolean;
/**
 * Checks if a chunk should be skipped for code injection
 *
 * This is necessary to handle Vite's MPA (multi-page application) mode where
 * HTML entry points create "facade" chunks that should not contain injected code.
 * See: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829
 *
 * However, in SPA mode, the main bundle also has an HTML facade but contains
 * substantial application code. We should NOT skip injection for these bundles.
 *
 * @param code - The chunk's code content
 * @param facadeModuleId - The facade module ID (if any) - HTML files create facade chunks
 * @returns true if the chunk should be skipped
 */
export declare function shouldSkipCodeInjection(code: string, facadeModuleId: string | null | undefined): boolean;
/**
 * A matcher for module ids, mirroring the shape accepted by the bundler
 * transform hook filter (Rollup >= 4.38, Rolldown, Vite). A single string/RegExp
 * (or array) is treated as an `include`; the object form allows both.
 */
export type TransformIdFilter = string | RegExp | Array<string | RegExp> | {
    include?: string | RegExp | Array<string | RegExp>;
    exclude?: string | RegExp | Array<string | RegExp>;
};
export interface CodeTransformerPluginOptions {
    /** Array of instrumentation configurations */
    instrumentations: InstrumentationConfig[];
    /** Optional path to a polyfill module for diagnostics_channel */
    dcModule?: string;
    /** Optional callback that that injects the code returned */
    injectDiagnostics?: (diagnostics: Diagnostics) => string | undefined;
    /**
     * Custom transforms registered on the matcher via orchestrion's
     * `addTransform`. An `InstrumentationConfig` opts in by naming one of these
     * in its `transform` field; the function is then called for every AST node
     * matched by that config's `functionQuery`/`astQuery` with
     * `(state, node, parent, ancestry)`, where `state` is the matched config
     * spread together with `{ dcModule, moduleType, moduleVersion }`.
     *
     * A single transform can serve many configs — each invocation can branch on
     * `state.module.name` or `state.channelName` to tell the sites apart.
     */
    customTransforms?: Record<string, CustomTransform>;
    /**
     * Restricts which modules the transform hook runs on, via the bundler's hook
     * filter (Rollup >= 4.38, Rolldown, Vite). All built-in instrumentations live
     * within `node_modules`, which is the default. Provide your own matcher to
     * broaden or narrow this — e.g. to also transform your own source — or pass
     * `false` to disable filtering entirely.
     *
     * Bundlers without hook-filter support (esbuild, webpack) ignore this; the
     * transformer skips non-matching modules regardless.
     *
     * @default /node_modules/
     */
    transformFilter?: TransformIdFilter | false;
}
export interface TransformResult {
    code: string;
    map?: string;
}
/**
 * Build a reusable code transformer from plugin options. The returned
 * `transform` function returns `null` for files that should not be modified.
 * Call `dispose` when the bundler tears the plugin down.
 */
export declare function createCodeTransformer(options: CodeTransformerPluginOptions): {
    transform: (code: string, id: string, inputSourceMap?: string | object | null) => TransformResult | null;
    getCodeToInject: () => string | undefined;
};
export type { CustomTransform, InstrumentationConfig, ModuleMatcher, FunctionBehavior, FunctionQuery } from '@apm-js-collab/code-transformer';
export { serializeInstrumentations, deserializeInstrumentations } from './instrumentation-serde.js';
export type { SerializedRegExp, SerializableInstrumentationConfig, AnyInstrumentationConfig, } from './instrumentation-serde.js';
