export interface InsertPropOptions { /** Source code of the file being patched. */ source: string; /** Path of the file (used only for diagnostics). */ filePath: string; /** 1-indexed line of the construct invocation as reported by the scanner. */ line: number; /** 1-indexed column of the construct invocation. */ column: number; /** * Restrict to construct invocations whose callee matches this regex. For * example `^(s3\.)?Bucket$` to only match `new s3.Bucket(...)` or * `new Bucket(...)`. The matcher is applied to the full callee text. */ expectedCalleePattern: RegExp; /** The property name to insert, e.g. `enforceSSL`. */ propertyName: string; /** * Source text for the property value — inserted verbatim. Use literals * (`'true'`, `'lambda.Tracing.ACTIVE'`) so this stays string-based. */ propertyValueSource: string; } export type InsertPropOutcome = { status: 'applied'; updatedSource: string; summary: string; } | { status: 'skipped'; reason: string; } | { status: 'error'; reason: string; }; /** * Find the `new (scope, id, props)` expression at (or enclosing) the * given source location and add a property to the third-argument object * literal. Refuses to apply when: * - The TypeScript compiler isn't installed in the consuming project. * - The line/column doesn't land inside any matching NewExpression. * - The third argument exists but isn't an object literal (e.g. user passed * a variable — we can't safely mutate that without leaving scope). * - The property already exists (treated as `skipped`, not an error). */ export declare const insertOrUpdateProp: (opts: InsertPropOptions) => InsertPropOutcome; export interface ReplacePropOptions extends Omit { /** * Optional regex; only replace if the existing value text matches. Used by * the Lambda-runtime fixer to avoid downgrading already-current runtimes. */ onlyIfValueMatches?: RegExp; /** Source text for the replacement value. */ newPropertyValueSource: string; } /** * Find the construct at line:col, locate `` on its props * object, and replace its value text with `newPropertyValueSource`. Returns * `skipped` when the property doesn't exist (use insertOrUpdateProp to add * it) or when an `onlyIfValueMatches` filter is supplied and doesn't match. */ export declare const replaceProp: (opts: ReplacePropOptions) => InsertPropOutcome;