/** * Script Manager - Manages persistent script injection across page navigations. * * This module provides functions to register, remove, and manage scripts that * should be automatically re-injected when pages load or navigate. * * @internal This module is for internal use only and is not exposed as MCP tools. */ /** * Type of script to inject. */ export type ScriptType = 'inline' | 'url'; /** * A script entry in the registry. */ export interface ScriptEntry { /** Unique identifier for this script. */ id: string; /** Type of script (inline code or external URL). */ type: ScriptType; /** The script content (JavaScript code) or URL. */ content: string; } /** * Response from script registration. */ interface RegisterScriptResponse { registered: boolean; scriptId: string; } /** * Response from script removal. */ interface RemoveScriptResponse { removed: boolean; scriptId: string; } /** * Response from clearing scripts. */ interface ClearScriptsResponse { cleared: number; } /** * Response from getting scripts. */ interface GetScriptsResponse { scripts: ScriptEntry[]; } /** * Registers a script to be injected into the webview. * * The script will be immediately injected if the page is loaded, and will be * automatically re-injected on subsequent page loads/navigations. * * @param id - Unique identifier for the script * @param type - Type of script ('inline' for code, 'url' for external script) * @param content - The script content (JavaScript code) or URL * @param windowLabel - Optional window label to target * @returns Promise resolving to registration result */ export declare function registerScript(id: string, type: ScriptType, content: string, windowLabel?: string, appIdentifier?: string | number): Promise; /** * Removes a script from the registry and DOM. * * @param id - The script ID to remove * @param windowLabel - Optional window label to target * @returns Promise resolving to removal result */ export declare function removeScript(id: string, windowLabel?: string, appIdentifier?: string | number): Promise; /** * Clears all registered scripts from the registry and DOM. * * @param windowLabel - Optional window label to target * @returns Promise resolving to the number of scripts cleared */ export declare function clearScripts(windowLabel?: string, appIdentifier?: string | number): Promise; /** * Gets all registered scripts. * * @returns Promise resolving to the list of registered scripts */ export declare function getScripts(appIdentifier?: string | number): Promise; /** * Checks if a script with the given ID is registered. * * @param id - The script ID to check * @returns Promise resolving to true if the script is registered */ export declare function isScriptRegistered(id: string, appIdentifier?: string | number): Promise; export {};