import { EnvironmentProviders } from '@angular/core';

/** Whether a render was meaningful (DOM changed) or wasted (DOM unchanged). */
type RenderKind = 'render' | 'unnecessary';
/** Accumulated stats for a single component across its lifetime. */
interface ComponentStats {
    componentName: string;
    hostElement: Element;
    totalRenders: number;
    unnecessaryRenders: number;
    lastRenderKind: RenderKind;
    lastRenderTimestamp: number;
}
/** Options for configuring angular-scan. */
interface AngularScanOptions {
    /** Set to false to disable scanning entirely. Default: true. */
    enabled?: boolean;
    /** Duration of the canvas flash in milliseconds. Default: 500. */
    flashDurationMs?: number;
    /** Show render count badges on component host elements. Default: true. */
    showBadges?: boolean;
    /** Show the floating toolbar HUD. Default: true. */
    showToolbar?: boolean;
}

/**
 * Provides angular-scan for development-time render tracking.
 *
 * Add to your application providers:
 * ```ts
 * bootstrapApplication(AppComponent, {
 *   providers: [provideAngularScan()]
 * });
 * ```
 *
 * This is a complete no-op in production builds (`isDevMode() === false`),
 * so it can safely be left in your app config.
 */
declare function provideAngularScan(options?: AngularScanOptions): EnvironmentProviders;

/**
 * Imperative API for angular-scan.
 *
 * Use this when you cannot modify application providers (e.g. micro-frontends,
 * third-party apps). Call before `bootstrapApplication()`.
 *
 * ```ts
 * // main.ts
 * import { scan } from 'angular-scan';
 * scan();
 * bootstrapApplication(AppComponent, appConfig);
 * ```
 *
 * @returns A teardown function that stops scanning and removes the overlay.
 */
declare function scan(options?: AngularScanOptions): () => void;

export { provideAngularScan, scan };
export type { AngularScanOptions, ComponentStats, RenderKind };
