/** * Virtual Lambda Scope — shared mechanism for comptime scope boundaries. * * Multiple plugins (farm-plugin-obfuscate mix_scope, farm-plugin-struct typed_scope) * need the same pattern: a virtual lambda `scope_name(() => { ... })` that creates * a comptime boundary for collecting/transforming code within the block. * * Usage: * import { findVirtualScopes } from 'plugin-common-lib/virtual-scope' * const scopes = findVirtualScopes(code, 'mix_scope') * const scopes = findVirtualScopes(code, 'typed_scope') */ export interface VirtualScope { /** Scope name (empty string for unnamed) */ name: string; /** Scope kind (plugin-defined: 'mix', 'typed', etc.) */ kind: string; /** Start position of the entire scope call */ start: number; /** End position of the entire scope call */ end: number; /** Start position of the lambda body */ bodyStart: number; /** End position of the lambda body */ bodyEnd: number; } /** * Find all virtual scope calls in source code. * Matches patterns: * scope_name(() => { ... }) * scope_name("name", () => { ... }) * scope_name('name', () => { ... }) * * Uses brace matching to find the lambda body boundaries. */ export declare function findVirtualScopes(code: string, scopeFunctionName: string, kind?: string): VirtualScope[];