import * as Common from '../../core/common/common.js'; import * as Platform from '../../core/platform/platform.js'; import * as SDK from '../../core/sdk/sdk.js'; import type * as TextUtils from '../text_utils/text_utils.js'; import * as Workspace from '../workspace/workspace.js'; import { DebuggerWorkspaceBinding } from './DebuggerWorkspaceBinding.js'; export declare class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper implements SDK.TargetManager.SDKModelObserver { #private; readonly storage: Storage; readonly targetManager: SDK.TargetManager.TargetManager; readonly debuggerWorkspaceBinding: DebuggerWorkspaceBinding; private constructor(); static instance(opts?: { forceNew: boolean | null; targetManager: SDK.TargetManager.TargetManager | null; workspace: Workspace.Workspace.WorkspaceImpl | null; debuggerWorkspaceBinding: DebuggerWorkspaceBinding | null; }): BreakpointManager; modelAdded(debuggerModel: SDK.DebuggerModel.DebuggerModel): void; modelRemoved(debuggerModel: SDK.DebuggerModel.DebuggerModel): void; addUpdateBindingsCallback(callback: ((uiSourceCode: Workspace.UISourceCode.UISourceCode) => Promise)): void; copyBreakpoints(fromSourceCode: Workspace.UISourceCode.UISourceCode, toSourceCode: Workspace.UISourceCode.UISourceCode): Promise; restoreBreakpointsForScript(script: SDK.Script.Script): Promise; getUISourceCodeWithUpdatedBreakpointInfo(script: SDK.Script.Script): Promise; static getScriptForInlineUiSourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): SDK.Script.Script | null; static breakpointLocationFromUiLocation(uiLocation: Workspace.UISourceCode.UILocation): { lineNumber: number; columnNumber: number | undefined; }; static uiLocationFromBreakpointLocation(uiSourceCode: Workspace.UISourceCode.UISourceCode, lineNumber: number, columnNumber: number | undefined): Workspace.UISourceCode.UILocation; static isValidPositionInScript(lineNumber: number, columnNumber: number | undefined, script: SDK.Script.Script | null): boolean; private restoreBreakpoints; private uiSourceCodeAdded; private uiSourceCodeRemoved; private projectRemoved; private removeUISourceCode; setBreakpoint(uiSourceCode: Workspace.UISourceCode.UISourceCode, lineNumber: number, columnNumber: number | undefined, condition: UserCondition, enabled: boolean, isLogpoint: boolean, origin: BreakpointOrigin): Promise; private innerSetBreakpoint; findBreakpoint(uiLocation: Workspace.UISourceCode.UILocation): BreakpointLocation | null; addHomeUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode, breakpoint: Breakpoint): void; removeHomeUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode, breakpoint: Breakpoint): void; possibleBreakpoints(uiSourceCode: Workspace.UISourceCode.UISourceCode, textRange: TextUtils.TextRange.TextRange): Promise; breakpointLocationsForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): BreakpointLocation[]; allBreakpointLocations(): BreakpointLocation[]; removeBreakpoint(breakpoint: Breakpoint, removeFromStorage: boolean): void; uiLocationAdded(breakpoint: Breakpoint, uiLocation: Workspace.UISourceCode.UILocation): void; uiLocationRemoved(breakpoint: Breakpoint, uiLocation: Workspace.UISourceCode.UILocation): void; supportsConditionalBreakpoints(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean; } export declare enum Events { BreakpointAdded = "breakpoint-added", BreakpointRemoved = "breakpoint-removed" } export type EventTypes = { [Events.BreakpointAdded]: BreakpointLocation; [Events.BreakpointRemoved]: BreakpointLocation; }; export declare const enum DebuggerUpdateResult { OK = "OK", ERROR_BREAKPOINT_CLASH = "ERROR_BREAKPOINT_CLASH", ERROR_BACKEND = "ERROR_BACKEND", PENDING = "PENDING" } export type ScheduleUpdateResult = DebuggerUpdateResult.OK | DebuggerUpdateResult.ERROR_BACKEND | DebuggerUpdateResult.ERROR_BREAKPOINT_CLASH; export declare class Breakpoint implements SDK.TargetManager.SDKModelObserver { #private; readonly breakpointManager: BreakpointManager; uiSourceCodes: Set; isRemoved: boolean; currentState: Breakpoint.State | null; constructor(breakpointManager: BreakpointManager, primaryUISourceCode: Workspace.UISourceCode.UISourceCode, url: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number | undefined, condition: UserCondition, enabled: boolean, isLogpoint: boolean, origin: BreakpointOrigin); get origin(): BreakpointOrigin; refreshInDebugger(): Promise; modelAdded(debuggerModel: SDK.DebuggerModel.DebuggerModel): void; modelRemoved(debuggerModel: SDK.DebuggerModel.DebuggerModel): void; modelBreakpoint(debuggerModel: SDK.DebuggerModel.DebuggerModel): ModelBreakpoint | undefined; addUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): void; clearUISourceCodes(): void; removeUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): void; url(): Platform.DevToolsPath.UrlString; lineNumber(): number; columnNumber(): number | undefined; uiLocationAdded(uiLocation: Workspace.UISourceCode.UILocation): void; uiLocationRemoved(uiLocation: Workspace.UISourceCode.UILocation): void; enabled(): boolean; bound(): boolean; hasBoundScript(): boolean; setEnabled(enabled: boolean): void; /** * The breakpoint condition as entered by the user. */ condition(): UserCondition; /** * The breakpoint condition as it is sent to V8. */ backendCondition(): SDK.DebuggerModel.BackendCondition; setCondition(condition: UserCondition, isLogpoint: boolean): void; isLogpoint(): boolean; get storageState(): BreakpointStorageState; updateState(newState: BreakpointStorageState): void; updateBreakpoint(): Promise; remove(keepInStorage: boolean): Promise; breakpointStorageId(): string; private defaultUILocation; private removeAllUnboundLocations; private addAllUnboundLocations; getUiSourceCodes(): Set; getIsRemoved(): boolean; } export declare class ModelBreakpoint { #private; constructor(debuggerModel: SDK.DebuggerModel.DebuggerModel, breakpoint: Breakpoint, debuggerWorkspaceBinding: DebuggerWorkspaceBinding); get currentState(): Breakpoint.State | null; resetLocations(): void; scheduleUpdateInDebugger(): Promise; private scriptDiverged; resetBreakpoint(): Promise; private didRemoveFromDebugger; private breakpointResolved; private locationUpdated; private addResolvedLocation; cleanUpAfterDebuggerIsGone(): void; } interface Position { url: Platform.DevToolsPath.UrlString; scriptHash: string; lineNumber: number; columnNumber?: number; } export declare const enum BreakpointOrigin { USER_ACTION = "USER_ACTION", OTHER = "RESTORED" } export declare namespace Breakpoint { class State { positions: Position[]; condition: SDK.DebuggerModel.BackendCondition; constructor(positions: Position[], condition: SDK.DebuggerModel.BackendCondition); static equals(stateA?: State | null, stateB?: State | null): boolean; } } declare class Storage { #private; readonly setting: Common.Settings.Setting; readonly breakpoints: Map; constructor(); mute(): void; unmute(): void; breakpointItems(url: Platform.DevToolsPath.UrlString, resourceTypeName?: string): BreakpointStorageState[]; updateBreakpoint(storageState: BreakpointStorageState): void; removeBreakpoint(storageId: string): void; private save; static computeId({ url, resourceTypeName, lineNumber, columnNumber }: BreakpointStorageState): string; } /** * A breakpoint condition as entered by the user. We use the type to * distinguish from {@link SDK.DebuggerModel.BackendCondition}. */ export type UserCondition = Platform.Brand.Brand; export declare const EMPTY_BREAKPOINT_CONDITION: UserCondition; export declare const NEVER_PAUSE_HERE_CONDITION: UserCondition; /** * All the data for a single `Breakpoint` thats stored in the settings. * Whenever any of these change, we need to update the settings. */ interface BreakpointStorageState { readonly url: Platform.DevToolsPath.UrlString; readonly resourceTypeName: string; readonly lineNumber: number; readonly columnNumber?: number; readonly condition: UserCondition; readonly enabled: boolean; readonly isLogpoint: boolean; } export declare class BreakpointLocation { readonly breakpoint: Breakpoint; readonly uiLocation: Workspace.UISourceCode.UILocation; constructor(breakpoint: Breakpoint, uiLocation: Workspace.UISourceCode.UILocation); } export {};