/** * Shared helpers for measuring policy sizes and resolving CloudFormation references. */ import type { CloudFormationResource } from '../../../types/analysis.types'; /** * Measure the byte size of a policy document when serialized to JSON. * CloudFormation serializes policies as JSON, so this matches the deployed size. */ export declare const measurePolicyBytes: (policyDocument: unknown) => number; /** * Count the number of statements in a policy document. */ export declare const countPolicyStatements: (policyDocument: unknown) => number; /** * Resolve a CloudFormation value to a logical resource ID. * Handles Ref, Fn::GetAtt, and literal strings. * Returns the logical resource ID or null if unresolvable. */ export declare const resolveCfnRef: (value: unknown, allResourceIds: Set) => string | null; /** * Recursively find all logical resource IDs referenced in a value. */ export declare const findAllReferencedResources: (value: unknown, allResourceIds: Set) => string[]; /** * Get policy statements from a policy document as an array. */ export declare const getPolicyStatements: (policyDocument: unknown) => Array>; /** * Calculate the percentage of a limit that's been used. */ export declare const percentOfLimit: (current: number, limit: number) => number; /** * Format byte size as human-readable string. */ export declare const formatBytes: (bytes: number) => string; /** * Collect all inline policies from an IAM Role resource. */ export declare const getInlinePolicies: (resource: CloudFormationResource) => Array<{ name: string; document: unknown; }>;