import { IProtocolCommand , IProtocolSuccess , IProtocolError , Connection } from "vscode-cdp-proxy" ; import { SourcemapPathTransformer } from "../../sourcemapPathTransformer" ; import { IProjectType } from "../../../../utils/cordovaProjectHelper" ; export declare type ProtocolMessage = IProtocolCommand | IProtocolSuccess | IProtocolError ; export enum DispatchDirection { FORWARD , BACK , CANCEL } export interface ProcessedCDPMessage { event : ProtocolMessage ; dispatchDirection : DispatchDirection ; communicationPreparationsDone ? : boolean ; } export interface ExecutionContext { id : number ; origin : string ; name : string ; auxData ? : { isDefault : boolean ; type ? : "default" | "page" ; frameId ? : string ; } ; } export interface HandlerOptions { platform : string ; debugRequest : string ; ionicLiveReload ? : boolean ; devServerAddress ? : string ; devServerPort ? : number ; simulatePort ? : number ; iOSAppPackagePath ? : string ; iOSVersion ? : string ; } export abstract class CDPMessageHandlerBase { protected sourcemapPathTransformer : SourcemapPathTransformer ; protected projectType : IProjectType ; protected applicationPortPart : string ; protected platform : string ; protected debugRequestType : string ; protected applicationServerAddress : string ; protected ionicLiveReload ? : boolean ; protected debuggerTarget : Connection | null ; protected applicationTarget : Connection | null ; constructor ( sourcemapPathTransformer , projectType , options ) { this . sourcemapPathTransformer = sourcemapPathTransformer ; this . projectType = projectType ; this . applicationPortPart = "" ; this . platform = options . platform ; this . ionicLiveReload = options . ionicLiveReload ; this . applicationServerAddress = options . devServerAddress || "localhost" ; this . debugRequestType = options . debugRequest ; } public abstract processDebuggerCDPMessage ( event ) ; public abstract processApplicationCDPMessage ( event ) ; public abstract configureHandlerAfterAttachmentPreparation ( options ) ; public setDebuggerTarget ( debuggerTarget ) { this . debuggerTarget = debuggerTarget ; } public setApplicationTarget ( applicationTarget ) { this . applicationTarget = applicationTarget ; } }