/**
 * Built-in Resource Observers
 *
 * This module provides the built-in observer implementations for common
 * use cases: auto-grant, auto-inject, logging, and metrics.
 *
 * @module declarative-api/observer/built-in-observers
 */
import type { IResourceObserver, ObserverType, ObserverPriority, ResourceCreatedEvent, ResourceModifiedEvent, ResourceDeletedEvent } from '../../../lib/runtime-web/types/declarative-api';
/**
 * Base class for resource observers.
 *
 * Provides default no-op implementations for all event handlers.
 * Subclasses can override only the methods they need.
 *
 * @example
 * ```typescript
 * class MyObserver extends BaseResourceObserver {
 *   constructor() {
 *     super('my-observer', 'custom', OBSERVER_PRIORITIES.NORMAL);
 *   }
 *
 *   onResourceCreated(event: ResourceCreatedEvent): void {
 *     // Custom logic
 *   }
 * }
 * ```
 */
export declare abstract class BaseResourceObserver implements IResourceObserver {
    readonly observerId: string;
    readonly observerType: ObserverType;
    readonly priority: ObserverPriority;
    constructor(observerId: string, observerType: ObserverType, priority: ObserverPriority);
    /**
     * React to resource creation.
     * Default implementation is a no-op.
     *
     * @param _event - The resource created event
     */
    onResourceCreated(_event: ResourceCreatedEvent): void | Promise<void>;
    /**
     * React to resource modification.
     * Default implementation is a no-op.
     *
     * @param _event - The resource modified event
     */
    onResourceModified(_event: ResourceModifiedEvent): void | Promise<void>;
    /**
     * React to resource deletion.
     * Default implementation is a no-op.
     *
     * @param _event - The resource deleted event
     */
    onResourceDeleted(_event: ResourceDeletedEvent): void | Promise<void>;
}
/**
 * Configuration for AutoGrantObserver.
 */
export interface AutoGrantConfig {
    /** Lambda role ARN to grant permissions to */
    readonly roleArn?: string;
    /** Permission level to grant */
    readonly permissionLevel?: 'read' | 'write' | 'full';
    /** Resource types to auto-grant (empty = all types) */
    readonly resourceTypes?: readonly string[];
}
/**
 * Auto-Grant Observer.
 *
 * Automatically grants IAM permissions to Lambda roles when resources
 * are created. This observer runs at HIGH priority to ensure permissions
 * are set up early.
 *
 * Validates: Requirements 6.3
 */
export declare class AutoGrantObserver extends BaseResourceObserver {
    private readonly config;
    private readonly grantLog;
    constructor(observerId?: string, config?: AutoGrantConfig);
    /**
     * Grant permissions when a resource is created.
     *
     * @param event - The resource created event
     */
    onResourceCreated(event: ResourceCreatedEvent): void;
    /**
     * Check if permissions should be granted for this resource.
     *
     * @param resource - The resource to check
     * @returns True if permissions should be granted
     */
    private shouldGrant;
    /**
     * Get the grant log for auditing.
     *
     * @returns Array of grant log entries
     */
    getGrantLog(): readonly typeof this.grantLog[number][];
    /**
     * Clear the grant log.
     */
    clearGrantLog(): void;
}
/**
 * Configuration for AutoInjectObserver.
 */
export interface AutoInjectConfig {
    /** Environment variable prefix */
    readonly envVarPrefix?: string;
    /** Whether to include ARN in environment */
    readonly includeArn?: boolean;
    /** Whether to include name in environment */
    readonly includeName?: boolean;
    /** Resource types to auto-inject (empty = all types) */
    readonly resourceTypes?: readonly string[];
}
/**
 * Auto-Inject Observer.
 *
 * Automatically injects resource identifiers into Lambda environment
 * variables when resources are created. This observer runs at HIGH
 * priority alongside auto-grant.
 *
 * Validates: Requirements 6.3
 */
export declare class AutoInjectObserver extends BaseResourceObserver {
    private readonly config;
    private readonly injectionLog;
    constructor(observerId?: string, config?: AutoInjectConfig);
    /**
     * Inject environment variables when a resource is created.
     *
     * @param event - The resource created event
     */
    onResourceCreated(event: ResourceCreatedEvent): void;
    /**
     * Check if environment variables should be injected for this resource.
     *
     * @param resource - The resource to check
     * @returns True if environment variables should be injected
     */
    private shouldInject;
    /**
     * Generate environment variable names and values for a resource.
     *
     * @param resource - The resource to generate env vars for
     * @returns Record of environment variable names to values
     */
    private generateEnvVars;
    /**
     * Get the injection log for auditing.
     *
     * @returns Array of injection log entries
     */
    getInjectionLog(): readonly typeof this.injectionLog[number][];
    /**
     * Clear the injection log.
     */
    clearInjectionLog(): void;
}
/**
 * Log level for LoggingObserver.
 */
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
/**
 * Configuration for LoggingObserver.
 */
export interface LoggingConfig {
    /** Log level */
    readonly level?: LogLevel;
    /** Whether to include metadata in logs */
    readonly includeMetadata?: boolean;
    /** Custom logger function */
    readonly logger?: (level: LogLevel, message: string, data?: unknown) => void;
}
/**
 * Log entry structure.
 */
export interface LogEntry {
    readonly level: LogLevel;
    readonly message: string;
    readonly timestamp: Date;
    readonly data?: unknown;
}
/**
 * Logging Observer.
 *
 * Logs resource lifecycle events for debugging and auditing.
 * This observer runs at LOW priority to capture the final state
 * of resources after other observers have processed them.
 *
 * Validates: Requirements 6.3
 */
export declare class LoggingObserver extends BaseResourceObserver {
    private readonly config;
    private readonly logs;
    constructor(observerId?: string, config?: LoggingConfig);
    /**
     * Log resource creation.
     *
     * @param event - The resource created event
     */
    onResourceCreated(event: ResourceCreatedEvent): void;
    /**
     * Log resource modification.
     *
     * @param event - The resource modified event
     */
    onResourceModified(event: ResourceModifiedEvent): void;
    /**
     * Log resource deletion.
     *
     * @param event - The resource deleted event
     */
    onResourceDeleted(event: ResourceDeletedEvent): void;
    /**
     * Log a message.
     *
     * @param level - Log level
     * @param message - Log message
     * @param data - Optional data to include
     */
    private log;
    /**
     * Get all log entries.
     *
     * @returns Array of log entries
     */
    getLogs(): readonly LogEntry[];
    /**
     * Get log entries by level.
     *
     * @param level - Log level to filter by
     * @returns Array of log entries at the specified level
     */
    getLogsByLevel(level: LogLevel): readonly LogEntry[];
    /**
     * Clear all log entries.
     */
    clearLogs(): void;
}
/**
 * Metric type for MetricsObserver.
 */
export type MetricType = 'counter' | 'gauge' | 'histogram';
/**
 * Metric entry structure.
 */
export interface MetricEntry {
    readonly name: string;
    readonly type: MetricType;
    readonly value: number;
    readonly labels: Record<string, string>;
    readonly timestamp: Date;
}
/**
 * Configuration for MetricsObserver.
 */
export interface MetricsConfig {
    /** Metric name prefix */
    readonly prefix?: string;
    /** Custom metrics reporter function */
    readonly reporter?: (metric: MetricEntry) => void;
}
/**
 * Metrics Observer.
 *
 * Collects metrics about resource lifecycle events for monitoring.
 * This observer runs at LOWEST priority to ensure all other processing
 * is complete before metrics are recorded.
 *
 * Validates: Requirements 6.3
 */
export declare class MetricsObserver extends BaseResourceObserver {
    private readonly config;
    private readonly metrics;
    private readonly counters;
    constructor(observerId?: string, config?: MetricsConfig);
    /**
     * Record metrics for resource creation.
     *
     * @param event - The resource created event
     */
    onResourceCreated(event: ResourceCreatedEvent): void;
    /**
     * Record metrics for resource modification.
     *
     * @param event - The resource modified event
     */
    onResourceModified(event: ResourceModifiedEvent): void;
    /**
     * Record metrics for resource deletion.
     *
     * @param event - The resource deleted event
     */
    onResourceDeleted(event: ResourceDeletedEvent): void;
    /**
     * Increment a counter metric.
     *
     * @param name - Metric name
     * @param labels - Metric labels
     */
    private incrementCounter;
    /**
     * Record a gauge metric.
     *
     * @param name - Metric name
     * @param value - Metric value
     * @param labels - Metric labels
     */
    private recordGauge;
    /**
     * Record a metric entry.
     *
     * @param name - Metric name
     * @param type - Metric type
     * @param value - Metric value
     * @param labels - Metric labels
     */
    private recordMetric;
    /**
     * Get the full metric name with prefix.
     *
     * @param name - Base metric name
     * @returns Full metric name
     */
    private getFullName;
    /**
     * Get a unique key for a counter with labels.
     *
     * @param name - Metric name
     * @param labels - Metric labels
     * @returns Unique counter key
     */
    private getCounterKey;
    /**
     * Get all recorded metrics.
     *
     * @returns Array of metric entries
     */
    getMetrics(): readonly MetricEntry[];
    /**
     * Get metrics by name.
     *
     * @param name - Metric name to filter by
     * @returns Array of metric entries with the specified name
     */
    getMetricsByName(name: string): readonly MetricEntry[];
    /**
     * Get the current value of a counter.
     *
     * @param name - Counter name
     * @param labels - Counter labels
     * @returns Current counter value or 0 if not found
     */
    getCounterValue(name: string, labels: Record<string, string>): number;
    /**
     * Clear all metrics.
     */
    clearMetrics(): void;
}
