/**
 * Config Layer Generator for Lambda Kata CDK Integration
 *
 * This module provides functionality to create a Lambda Layer containing
 * the kata configuration. The configuration includes the original Node.js
 * handler path, which the Lambda Kata runtime reads during initialization.
 *
 * The config layer replaces the JS_HANDLER_PATH environment variable approach,
 * providing cleaner separation between runtime configuration and environment variables.
 *
 * @module config-layer
 */
import { Construct } from 'constructs';
import { LayerVersion } from 'aws-cdk-lib/aws-lambda';
/**
 * Configuration for the kata config layer.
 *
 * @example
 * ```typescript
 * const props: KataConfigLayerProps = {
 *   originalHandler: 'bundle.handler'
 * };
 * ```
 *
 * @example
 * ```typescript
 * // With custom bundle path and middleware
 * const props: KataConfigLayerProps = {
 *   originalHandler: 'index.handler',
 *   bundlePath: '/var/task/index.js',
 *   middlewarePath: './middleware.ts'
 * };
 * ```
 */
export interface KataConfigLayerProps {
    /**
     * The original Node.js handler path (e.g., "bundle.handler").
     *
     * This value will be stored in the config layer and read by the
     * Lambda Kata runtime during initialization.
     *
     * Format: "<module>.<function>" or "<path/module>.<function>"
     * Examples: "bundle.handler", "src/index.handler", "dist/main.handler"
     */
    originalHandler: string;
    /**
     * Path to the JavaScript bundle.
     *
     * When specified, the Lambda Kata runtime will load the bundle from this path
     * instead of the default location. This allows using custom project layouts
     * where the bundle is located in a different directory.
     *
     * If not specified, defaults to /opt/js_runtime/bundle.js
     *
     * @example "/var/task/index.js"
     * @example "/var/task/dist/bundle.js"
     *
     * @remarks
     * Validates: Requirement 4.1
     */
    bundlePath?: string;
    /**
     * Path to the middleware TypeScript/JavaScript source file.
     *
     * When specified, the middleware file will be compiled with esbuild and
     * included in the config layer at /opt/.kata/middleware.js. The middleware
     * module must export a function with signature: (bundle, context) => handler
     *
     * The context parameter includes:
     * - originalHandler: The handler path (e.g., "index.handler")
     *
     * @example "./middleware.ts"
     * @example "./src/custom-resolver.js"
     *
     * @remarks
     * Validates: Requirement 5.1
     */
    middlewarePath?: string;
    /**
     * Inline handler resolver function.
     *
     * When specified, this function will be serialized to a temporary TypeScript file,
     * compiled with esbuild, and included in the config layer at /opt/.kata/middleware.js.
     *
     * The function receives the loaded bundle and context with originalHandler,
     * and must return the handler function.
     *
     * Note: The function must be pure (no closures over external variables)
     * because it will be serialized via .toString()
     *
     * Cannot be used together with middlewarePath.
     *
     * @example
     * ```typescript
     * handlerResolver: (bundle, ctx) => {
     *   const handlerName = ctx.originalHandler.split('.').pop();
     *   return bundle[handlerName];
     * }
     * ```
     */
    handlerResolver?: (bundle: unknown, context: {
        originalHandler: string;
    }) => Function;
}
/**
 * The path where the config file will be located in the Lambda Layer.
 * When the layer is attached to a Lambda, this file will be at /opt/.kata/original_handler.json
 */
export declare const CONFIG_DIR_NAME = ".kata";
/**
 * The name of the config file within the .kata directory.
 */
export declare const CONFIG_FILE_NAME = "original_handler.json";
/**
 * The key used in the JSON config file to store the handler path.
 */
export declare const HANDLER_CONFIG_KEY = "original_js_handler";
/**
 * The name of the compiled middleware file within the .kata directory.
 */
export declare const MIDDLEWARE_FILE_NAME = "middleware.js";
/**
 * Creates a Lambda Layer containing the kata configuration.
 *
 * The layer contains a single JSON file at /opt/.kata/original_handler.json
 * with the original handler path. This file is read by the Lambda Kata
 * runtime during initialization to determine which JavaScript handler to invoke.
 *
 * @param scope - The CDK construct scope
 * @param id - The unique identifier for this layer within the scope
 * @param props - Configuration properties including the original handler path
 * @returns A LayerVersion construct containing the configuration
 *
 * @example
 * ```typescript
 * import { createKataConfigLayer } from './config-layer';
 *
 * const configLayer = createKataConfigLayer(this, 'KataConfigLayer', {
 *   originalHandler: 'bundle.handler'
 * });
 *
 * myFunction.addLayers(configLayer);
 * ```
 *
 * @remarks
 * Validates: Requirements 1.1, 1.2, 1.3, 3.1, 3.2, 3.5
 */
export declare function createKataConfigLayer(scope: Construct, id: string, props: KataConfigLayerProps): LayerVersion;
/**
 * Generates the JSON configuration content for the config layer.
 *
 * This function creates a properly formatted JSON string containing
 * the original handler path. The output is formatted with 2-space
 * indentation for readability.
 *
 * @param originalHandler - The original Node.js handler path
 * @returns The JSON configuration content as a string
 *
 * @example
 * ```typescript
 * const content = generateConfigContent('bundle.handler');
 * // Returns: '{\n  "original_js_handler": "bundle.handler"\n}'
 * ```
 *
 * @remarks
 * Validates: Requirements 1.2, 3.2
 */
export declare function generateConfigContent(originalHandler: string): string;
