import { z } from "zod"; import { type ReferenceTreeChain } from "../parsers/leaksDebugStacks.js"; import type { LeaksReport, NextCallSuggestion } from "../types.js"; export declare const findRetainersSchema: z.ZodObject<{ path: z.ZodString; className: z.ZodString; maxResults: z.ZodDefault; includeReferenceTree: z.ZodDefault; }, "strip", z.ZodTypeAny, { className: string; path: string; maxResults: number; includeReferenceTree: boolean; }, { className: string; path: string; maxResults?: number | undefined; includeReferenceTree?: boolean | undefined; }>; export type FindRetainersInput = z.infer; export interface RetainerChainEntry { className: string; address: string; edge?: string; retainKind: string; count?: number; } export interface RetainerChain { /** Path from a top-level node down to the matching node — entry[0] is the root, last entry is the match. */ path: RetainerChainEntry[]; matchAddress: string; matchClassName: string; } export interface FindRetainersResult { ok: boolean; path: string; className: string; totalMatches: number; retainers: RetainerChain[]; /** * v1.12+. Populated when `includeReferenceTree: true` and `leaks * --debug=stacks` returned data. Each chain aggregates instances that * share the same allocation call stack (the 342 notelet AVPlayerItem * instances collapse to 1 chain with `instanceCount: 342`). The * `userFrame` field surfaces the deepest non-system frame, which is * the line a developer would inspect (e.g. `MediaNoteItemVideoView.prepareVideo` * for the notelet case). */ referenceTreeChains?: ReferenceTreeChain[]; /** Pipeline hint: once you know who retains the class, locate it in source. */ suggestedNextCalls?: NextCallSuggestion[]; } /** * Walk the cycle forest and collect every parent-path that ends in a node whose * className contains `needle`. Pure function for testing. */ export declare function findRetainersIn(report: LeaksReport, needle: string, maxResults?: number): { totalMatches: number; retainers: RetainerChain[]; }; export declare function findRetainers(input: FindRetainersInput): Promise;