/** * @license MIT * * Copyright (c) 2025 Aiden Bai * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { n as StackFrame, r as Fiber, t as copyContent } from "./copy-content-CqFXlS9J.js"; //#region src/utils/extract-element-css.d.ts declare const disposeBaselineStyles: () => void; //#endregion //#region src/primitives.d.ts interface ReactGrabElementContext { element: Element; snippet: string; htmlPreview: string; stackString: string; stack: StackFrame[]; componentName: string | null; filePath: string | null; lineNumber: number | null; columnNumber: number | null; fiber: Fiber | null; selector: string | null; styles: string; } /** * Gathers comprehensive context for a DOM element — the same context * React Grab copies to the clipboard, plus structured source location * and computed styles. * * @example * const ctx = await getElementContext(document.querySelector('.my-button')!); * ctx.snippet; // formatted text identical to React Grab's clipboard output * ctx.componentName; // "SubmitButton" * ctx.filePath; // "/src/components/Button.tsx" * ctx.lineNumber; // 12 */ declare const getElementContext: (element: Element) => Promise; /** * Returns all elements at the given viewport coordinates, temporarily * suspending the pointer-events freeze so `elementsFromPoint` can * reach real elements underneath. * * @example * freeze(); * const elements = getElementsAtPosition(e.clientX, e.clientY); * // elements[0] is the topmost element under the cursor */ declare const getElementsAtPosition: (clientX: number, clientY: number) => Element[]; /** * Freezes the page by halting React updates, pausing CSS/JS animations, * and preserving pseudo-states (e.g. :hover, :focus) on the given elements. * * @example * freeze(); // freezes the entire page * freeze([document.querySelector('.modal')!]); // freezes only the modal subtree */ declare const freeze: (elements?: Element[]) => void; /** * Restores normal page behavior by re-enabling React updates, resuming * animations, and releasing preserved pseudo-states. * * @example * freeze(); * // ... capture a snapshot ... * unfreeze(); // page resumes normal behavior */ declare const unfreeze: () => void; /** * Returns whether the page is currently in a frozen state. * * @example * if (isFreezeActive()) { * console.log('Page is frozen, skipping update'); * } */ declare const isFreezeActive: () => boolean; /** * Opens the source file at the given path in the user's editor. * Tries the dev-server endpoint first (Vite / Next.js), then falls back * to a protocol URL (e.g. vscode://file/…). * * @example * openFile("/src/components/Button.tsx"); * openFile("/src/components/Button.tsx", 42); */ declare const openFile: (filePath: string, lineNumber?: number) => Promise; //#endregion export { ReactGrabElementContext, type StackFrame, copyContent, disposeBaselineStyles, freeze, getElementContext, getElementsAtPosition, isFreezeActive, openFile, unfreeze };