/**
 * Method-body walker — shared infrastructure for #27 (behavior step
 * extraction) and #28-lifecycle Tier B (transition graph extraction).
 *
 * Given a class body string, produces per-method fact sheets: each
 * method's `this.X = Y` assignments, `if (this.X op Y) throw` guards,
 * external calls, throws, and explicit returns. The walker itself is
 * pattern-matching only — interpretation (which call is a "step", how
 * a guard pairs with an assignment to form a transition) is the
 * caller's responsibility.
 *
 * Language assumption: TypeScript / JavaScript. Relies on regex-based
 * parsing rather than a full AST walker — pragmatic for the patterns
 * we care about (decorator-style classes with method bodies that
 * follow the realize-stack discipline). When this stops being enough
 * (genuinely complex flow control, ternary state mutations, etc.) we
 * upgrade to tree-sitter via the CodeGraph backend.
 *
 * NOT intended to be exhaustive. The "soft oracle" stance from
 * 2026-04-26-BEHAVIOR-EXTRACTION-FOR-ANALYSE.md applies: extract what
 * the patterns clearly say, fall through to LLM for the rest.
 */
/** Per-method extracted facts. Empty arrays when no matches found. */
export interface MethodBodyFacts {
    /** Method name as declared on the class. */
    methodName: string;
    /** Raw body source — for cross-validation against LLM extraction. */
    body: string;
    /** Async marker. */
    isAsync: boolean;
    /** Source line range [startLine, endLine] (1-based, inclusive) within the
     *  class body that was walked. Used by audit-trail sidecars to link
     *  walker output back to source positions. */
    sourceLineRange: [number, number];
    /** `this.<field> = <expr>` assignments. */
    thisAssignments: ThisAssignment[];
    /** `if (this.<field> [!=|==|!==|===] <expr>)` style guards.
     *  `throws` is true when the guard's body is a throw statement
     *  (the common precondition pattern). */
    guards: ThisGuard[];
    /** `await foo.bar(...)` / `obj.method(...)` invocations.
     *  Excludes calls inside string literals or comments (cheap
     *  best-effort: a literal containing `foo.bar()` text won't be
     *  scanned thanks to the comment/string stripping pass). */
    calls: MethodCall[];
    /** `throw new Error('...')` / `throw new SomeError('...')`. */
    throws: ThrowStmt[];
    /** Explicit `return <expr>;` statements. */
    returns: ReturnStmt[];
}
/**
 * Positional metadata shared by all walker outputs. `position` is the
 * byte offset of the match within the method body (NOT the class body),
 * so consumers can order events across the per-kind arrays into a
 * single timeline. Used by `behavior-step-classifier.ts` (#27-B).
 */
interface Positioned {
    position: number;
}
export interface ThisAssignment extends Positioned {
    /** Field being assigned (`status` in `this.status = X`). */
    field: string;
    /** Raw RHS expression as text. */
    valueExpr: string;
    /** When the RHS is `<EnumName>.<Member>`, the parsed parts. */
    enumName?: string;
    enumMember?: string;
}
export interface ThisGuard extends Positioned {
    field: string;
    /** Comparison operator as written in source. */
    op: '!=' | '==' | '!==' | '===';
    /** RHS of the comparison. */
    valueExpr: string;
    enumName?: string;
    enumMember?: string;
    /** True when the guard's body contains a `throw` statement
     *  (the load-bearing pattern for preconditions). */
    throws: boolean;
}
export interface MethodCall extends Positioned {
    /** Receiver expression — `this.repo` in `this.repo.save(...)`,
     *  `eventBus` in `eventBus.emit(...)`. */
    receiver: string;
    /** Method name being called. */
    method: string;
    /** Raw argument text (no parsing). */
    argsExpr: string;
    /** True when the call site is `await ...`. */
    isAwait: boolean;
}
export interface ThrowStmt extends Positioned {
    /** Constructor name, if `throw new X(...)`. */
    errorClass?: string;
    /** Argument text — useful as a precondition explanation. */
    argsExpr?: string;
}
export interface ReturnStmt extends Positioned {
    /** Raw return expression text (or empty for bare `return;`). */
    valueExpr: string;
}
/**
 * Walk all methods in a class body, returning per-method facts.
 *
 * Method extraction is pattern-based: we match either
 *   - explicit `<methodName>(<params>): <ret> {` declarations, or
 *   - shorthand `<methodName>(<params>) {` (no return type)
 *   - `async <methodName>` and `public/private/protected` modifiers
 *
 * Constructor + property initialisers are skipped — only "real"
 * methods. Tightening the body extraction (matching the exact closing
 * brace via brace counting) keeps multi-method classes from crossing
 * boundaries.
 */
export declare function walkMethodBodies(classBody: string): MethodBodyFacts[];
export {};
//# sourceMappingURL=method-body-walker.d.ts.map