Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.1 KB
Raw Blame
declare module '@memlab/lens/dist/memlens.lib.bundle.js' {
    export interface MemLensScanResult {
        totalElements: number
        totalDetachedElements: number
        detachedComponentToFiberNodeCount: Map<string, number>
        componentToFiberNodeCount: Map<string, number>
        start: number
        end: number
    }

    export interface MemLensDOMElementInfo {
        element: WeakRef<Element>
        componentStack: string[] | null | undefined
    }

    export interface MemLensScanner {
        subscribe: (callback: (result: MemLensScanResult) => void) => () => void
        start: () => void
        stop: () => void
        dispose: () => void
        scan: () => Omit<MemLensScanResult, 'start' | 'end'>
        getDetachedDOMInfo: () => MemLensDOMElementInfo[]
    }

    export interface MemLensScanOptions {
        scanIntervalMs?: number
        trackEventListenerLeaks?: boolean
    }

    export function createReactMemoryScan(options?: MemLensScanOptions): MemLensScanner

    const _default: {
        createReactMemoryScan: typeof createReactMemoryScan
    }
    export default _default
}