/**
 * Integration Strategy Types
 *
 * This module defines the types for the Strategy pattern used to integrate
 * resources with Lambda functions. Strategies define how permissions are
 * granted and environment variables are injected.
 *
 * @module declarative-api/strategy.types
 */
import type { IResourceEntity } from './resource.types';
/**
 * Integration strategy type discriminator.
 *
 * Identifies the type of integration strategy being used:
 * - full-access: Full read/write permissions
 * - read-only: Read-only permissions
 * - write-only: Write-only permissions
 * - custom: Custom permissions defined by actions
 * - composite: Combination of multiple strategies
 *
 * Validates: Requirements 4.1, 4.2
 */
export type IntegrationStrategyType = 'full-access' | 'read-only' | 'write-only' | 'custom' | 'composite';
/**
 * All valid integration strategy types as a readonly array.
 * Useful for validation and iteration.
 */
export declare const INTEGRATION_STRATEGY_TYPES: readonly IntegrationStrategyType[];
/**
 * Type guard to check if a value is a valid IntegrationStrategyType.
 *
 * @param value - The value to check
 * @returns True if the value is a valid IntegrationStrategyType
 */
export declare function isValidIntegrationStrategyType(value: unknown): value is IntegrationStrategyType;
/**
 * Options for granting permissions to a Lambda role.
 *
 * Allows customization of the permissions granted, including
 * specific actions and IAM conditions.
 *
 * @example
 * ```typescript
 * const options: GrantOptions = {
 *   actions: ['dynamodb:GetItem', 'dynamodb:Query'],
 *   conditions: {
 *     StringEquals: { 'dynamodb:LeadingKeys': ['${aws:userid}'] }
 *   }
 * };
 * ```
 *
 * Validates: Requirements 4.1
 */
export interface GrantOptions {
    /**
     * Specific IAM actions to grant.
     * If not specified, the strategy determines the actions.
     */
    readonly actions?: readonly string[];
    /**
     * IAM conditions to apply to the grant.
     * Allows fine-grained access control.
     */
    readonly conditions?: Readonly<Record<string, unknown>>;
}
/**
 * Options for injecting environment variables into a Lambda function.
 *
 * Controls which resource identifiers are injected and how they are named.
 *
 * @example
 * ```typescript
 * const options: InjectOptions = {
 *   envVarPrefix: 'USERS_TABLE',
 *   includeArn: true,
 *   includeName: true,
 *   includeUrl: false,
 * };
 * ```
 *
 * Validates: Requirements 4.1
 */
export interface InjectOptions {
    /**
     * Prefix for environment variable names.
     * If not specified, derived from resource ID.
     */
    readonly envVarPrefix?: string;
    /**
     * Whether to include the resource ARN.
     * @default true
     */
    readonly includeArn?: boolean;
    /**
     * Whether to include the resource name.
     * @default true
     */
    readonly includeName?: boolean;
    /**
     * Whether to include the resource URL (if applicable).
     * @default false
     */
    readonly includeUrl?: boolean;
}
/**
 * Result of a grant operation.
 *
 * Contains information about the permissions that were granted,
 * useful for auditing and debugging.
 */
export interface GrantResult {
    /**
     * Whether the grant was successful.
     */
    readonly success: boolean;
    /**
     * The resource that was granted access to.
     */
    readonly resourceId: string;
    /**
     * The actions that were granted.
     */
    readonly actions: readonly string[];
    /**
     * Any conditions applied to the grant.
     */
    readonly conditions?: Readonly<Record<string, unknown>>;
    /**
     * Error message if the grant failed.
     */
    readonly error?: string;
}
/**
 * Result of an inject operation.
 *
 * Contains information about the environment variables that were injected.
 */
export interface InjectResult {
    /**
     * Whether the injection was successful.
     */
    readonly success: boolean;
    /**
     * The resource that was injected.
     */
    readonly resourceId: string;
    /**
     * Map of environment variable names to values that were injected.
     */
    readonly injectedVariables: Readonly<Record<string, string>>;
    /**
     * Error message if the injection failed.
     */
    readonly error?: string;
}
/**
 * Integration Strategy interface.
 *
 * Defines how resources are integrated with Lambda functions.
 * Strategies are stateless and can be composed.
 *
 * Implements: Strategy Pattern
 *
 * @example
 * ```typescript
 * class FullAccessStrategy implements IIntegrationStrategy {
 *   readonly strategyType = 'full-access';
 *
 *   grantPermissions(resource, role, options) {
 *     // Grant full access permissions
 *   }
 *
 *   injectEnvironment(resource, lambda, options) {
 *     // Inject all resource identifiers
 *   }
 * }
 * ```
 *
 * Validates: Requirements 4.1, 4.2, 4.3, 4.4, 4.5, 4.6
 */
export interface IIntegrationStrategy {
    /**
     * Strategy type identifier.
     */
    readonly strategyType: IntegrationStrategyType;
    /**
     * Grant permissions to a Lambda role for accessing the resource.
     *
     * @param resource - The resource to grant access to
     * @param role - The IAM role to grant permissions to (CDK IRole)
     * @param options - Optional grant configuration
     * @returns Result of the grant operation
     */
    grantPermissions(resource: IResourceEntity, role: unknown, options?: GrantOptions): GrantResult;
    /**
     * Inject environment variables into a Lambda function.
     *
     * @param resource - The resource to inject identifiers for
     * @param lambda - The Lambda function to inject into (CDK Function)
     * @param options - Optional injection configuration
     * @returns Result of the injection operation
     */
    injectEnvironment(resource: IResourceEntity, lambda: unknown, options?: InjectOptions): InjectResult;
}
/**
 * Factory for creating integration strategies.
 *
 * Provides a centralized way to create and configure strategies.
 */
export interface IIntegrationStrategyFactory {
    /**
     * Create a strategy by type.
     *
     * @param type - The strategy type to create
     * @returns The created strategy
     */
    create(type: IntegrationStrategyType): IIntegrationStrategy;
    /**
     * Create a composite strategy from multiple strategies.
     *
     * @param strategies - The strategies to compose
     * @returns A composite strategy
     */
    createComposite(strategies: readonly IIntegrationStrategy[]): IIntegrationStrategy;
    /**
     * Get the default strategy.
     *
     * @returns The default full-access strategy
     */
    getDefault(): IIntegrationStrategy;
}
