/**
 * Lambda Context Simulation for Awake Lambda Development
 *
 * Creates a context object semantically equivalent to AWS Lambda's context,
 * including all required fields and the getRemainingTimeInMillis() function.
 *
 * @module bin/commands/dev/lambda-context
 *
 * @see Requirements 8.3, 8.4
 */
import type { Context } from 'aws-lambda';
import type { RuntimeAwakeContext, RuntimeAwakeRequest } from '../../../lib/runtime-web/runtime-awake';
/**
 * Configuration for creating a simulated Lambda context.
 */
export interface SimulatedContextConfig {
    /** Function name */
    readonly functionName: string;
    /** Function version */
    readonly functionVersion: string;
    /** Invoked function ARN */
    readonly invokedFunctionArn: string;
    /** Memory limit in MB */
    readonly memoryLimitInMB: number;
    /** AWS request ID */
    readonly awsRequestId: string;
    /** CloudWatch log group name */
    readonly logGroupName: string;
    /** CloudWatch log stream name */
    readonly logStreamName: string;
    /** Remaining time in milliseconds when request was sent */
    readonly remainingTimeMs: number;
    /** Timestamp when request was received locally */
    readonly requestReceivedAt: number;
}
/**
 * Create a simulated Lambda context from RuntimeAwakeContext.
 *
 * Creates a context object that is semantically equivalent to AWS Lambda's
 * Context interface, including all required fields and the
 * getRemainingTimeInMillis() function.
 *
 * @param config - Context configuration
 * @returns Simulated Lambda context
 *
 * @see Requirements 8.3, 8.4
 *
 * @example
 * ```typescript
 * const context = createSimulatedContext({
 *   functionName: 'payments-charge',
 *   functionVersion: '$LATEST',
 *   invokedFunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:payments-charge',
 *   memoryLimitInMB: 256,
 *   awsRequestId: 'abc-123',
 *   logGroupName: '/aws/lambda/payments-charge',
 *   logStreamName: '2025/01/14/[$LATEST]abc123',
 *   remainingTimeMs: 25000,
 *   requestReceivedAt: Date.now(),
 * });
 *
 * // Use in handler invocation
 * const result = await handler(event, context);
 * ```
 */
export declare function createSimulatedContext(config: SimulatedContextConfig): Context;
/**
 * Create a simulated Lambda context from a RuntimeAwakeRequest.
 *
 * Convenience function that extracts context information from a
 * RuntimeAwakeRequest message and creates a simulated context.
 *
 * @param request - Live Dev request message
 * @param requestReceivedAt - Timestamp when request was received locally (default: now)
 * @returns Simulated Lambda context
 *
 * @see Requirements 8.3, 8.4
 *
 * @example
 * ```typescript
 * const context = createContextFromRequest(request);
 * const result = await handler(event, context);
 * ```
 */
export declare function createContextFromRequest(request: RuntimeAwakeRequest, requestReceivedAt?: number): Context;
/**
 * Create a RuntimeAwakeContext from a simulated context configuration.
 *
 * Extracts the RuntimeAwakeContext fields from a SimulatedContextConfig.
 * Useful for creating request messages.
 *
 * @param config - Context configuration
 * @returns RuntimeAwakeContext object
 */
export declare function createRuntimeAwakeContext(config: SimulatedContextConfig): RuntimeAwakeContext;
/**
 * Validate that a context object has all required Lambda context fields.
 *
 * Checks that the context object contains all fields required by the
 * AWS Lambda Context interface.
 *
 * @param context - Context object to validate
 * @returns True if context has all required fields
 *
 * @see Requirements 8.3, 8.4
 */
export declare function isValidLambdaContext(context: unknown): context is Context;
/**
 * Get the list of required Lambda context fields.
 *
 * @returns Array of required field names
 */
export declare function getRequiredContextFields(): string[];
/**
 * Check if a context's remaining time is below a threshold.
 *
 * Useful for detecting when a handler is approaching timeout.
 *
 * @param context - Lambda context
 * @param thresholdMs - Threshold in milliseconds (default: 5000)
 * @returns True if remaining time is below threshold
 */
export declare function isApproachingTimeout(context: Context, thresholdMs?: number): boolean;
/**
 * Calculate the percentage of time remaining.
 *
 * @param context - Lambda context
 * @param totalTimeMs - Total timeout in milliseconds
 * @returns Percentage of time remaining (0-100)
 */
export declare function getRemainingTimePercentage(context: Context, totalTimeMs: number): number;
