File tree Expand file tree Collapse file tree
packages/dev-middleware/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export class DebuggerAgent {
8484
8585export class DebuggerMock extends DebuggerAgent {
8686 // Empty handlers
87- + handle : JestMockFn < [ message : JSONSerializable ] , void > = jest . fn ( ) ;
87+ readonly handle : JestMockFn < [ message : JSONSerializable ] , void > = jest . fn ( ) ;
8888
8989 __handle ( message : JSONSerializable ) : void {
9090 this . handle ( message ) ;
Original file line number Diff line number Diff line change @@ -98,16 +98,18 @@ export class DeviceAgent {
9898
9999export class DeviceMock extends DeviceAgent {
100100 // Empty handlers
101- + connect : JestMockFn < [ message : ConnectRequest ] , void > = jest . fn ( ) ;
102- + disconnect : JestMockFn < [ message : DisconnectRequest ] , void > = jest . fn ( ) ;
103- + getPages : JestMockFn <
101+ readonly connect : JestMockFn < [ message : ConnectRequest ] , void > = jest . fn ( ) ;
102+ readonly disconnect : JestMockFn < [ message : DisconnectRequest ] , void > =
103+ jest . fn ( ) ;
104+ readonly getPages : JestMockFn <
104105 [ message : GetPagesRequest ] ,
105106 | GetPagesResponse [ 'payload' ]
106107 | Promise < GetPagesResponse [ 'payload' ] | void >
107108 | void ,
108109 > = jest . fn ( ) ;
109- + wrappedEvent : JestMockFn < [ message : WrappedEventToDevice ] , void > = jest . fn ( ) ;
110- + wrappedEventParsed : JestMockFn <
110+ readonly wrappedEvent : JestMockFn < [ message : WrappedEventToDevice ] , void > =
111+ jest . fn ( ) ;
112+ readonly wrappedEventParsed : JestMockFn <
111113 [
112114 payload : {
113115 ...WrappedEventToDevice [ 'payload' ] ,
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const PAGES_POLLING_DELAY = 2100;
2525jest . useFakeTimers ( ) ;
2626
2727async function setupDevice (
28- serverRef : { + serverBaseWsUrl : string , ...} ,
28+ serverRef : { readonly serverBaseWsUrl : string , ...} ,
2929 signal : AbortSignal ,
3030) {
3131 const device = await createDeviceMock (
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ export default class Device {
138138 // Logging reporting batches of cdp messages
139139 #cdpDebugLogging: CdpDebugLogging ;
140140
141- + #experiments: Experiments ;
141+ readonly #experiments: Experiments ;
142142
143143 constructor ( deviceOptions : DeviceOptions ) {
144144 this . #experiments = deviceOptions . experiments ;
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export default class InspectorProxy implements InspectorProxyQueries {
9393
9494 #eventReporter: ?EventReporter ;
9595
96- + #experiments: Experiments ;
96+ readonly #experiments: Experiments ;
9797
9898 // custom message handler factory allowing implementers to handle unsupported CDP messages.
9999 #customMessageHandler: ?CreateCustomMessageHandlerFn ;
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ export type JSONSerializable =
156156 | string
157157 | null
158158 | ReadonlyArray < JSONSerializable >
159- | { + [ string ] : JSONSerializable } ;
159+ | { readonly [ string ] : JSONSerializable } ;
160160
161161export type DeepReadOnly < T > =
162162 T extends ReadonlyArray < infer V >
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export interface DevToolLauncher {
2727 * the host of dev-middleware. Implementations are responsible for rewriting
2828 * this as necessary where the server is remote.
2929 */
30- + launchDebuggerAppWindow : ( url : string ) = > Promise < void > ;
30+ readonly launchDebuggerAppWindow: ( url : string ) => Promise < void > ;
3131
3232 /**
3333 * Attempt to open a debugger frontend URL in a standalone shell window
@@ -47,7 +47,10 @@ export interface DevToolLauncher {
4747 * the host of dev-middleware. Implementations are responsible for rewriting
4848 * this as necessary where the server is remote.
4949 */
50- + launchDebuggerShell ?: ( url : string , windowKey : string ) => Promise < void > ;
50+ readonly launchDebuggerShell ?: (
51+ url : string ,
52+ windowKey : string ,
53+ ) => Promise < void > ;
5154
5255 /**
5356 * Attempt to prepare the debugger shell for use and returns a coded result
@@ -60,5 +63,5 @@ export interface DevToolLauncher {
6063 * SHOULD NOT return a rejecting promise in any case, and instead SHOULD report
6164 * errors via the returned result object.
6265 */
63- + prepareDebuggerShell ?: ( ) => Promise < DebuggerShellPreparationResult > ;
66+ readonly prepareDebuggerShell ?: ( ) => Promise < DebuggerShellPreparationResult > ;
6467}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export interface ReadonlyURLSearchParams {
1515 get ( name : string ) : string | null ;
1616 getAll ( name : string ) : Array < string > ;
1717 has ( name : string , value ? : string ) : boolean ;
18- + size : number ;
18+ readonly size: number ;
1919 entries ( ) : Iterator < [ string , string ] > ;
2020 keys ( ) : Iterator < string > ;
2121 values ( ) : Iterator < string > ;
@@ -37,18 +37,18 @@ export interface ReadonlyURLSearchParams {
3737 * Used for URLs passed between module boundaries.
3838 */
3939export interface ReadonlyURL {
40- + hash : string ;
41- + host : string ;
42- + hostname : string ;
43- + href : string ;
44- + origin : string ;
45- + password : string ;
46- + pathname : string ;
47- + port : string ;
48- + protocol : string ;
49- + search : string ;
50- + searchParams : ReadonlyURLSearchParams ;
51- + username : string ;
40+ readonly hash : string ;
41+ readonly host : string ;
42+ readonly hostname : string ;
43+ readonly href : string ;
44+ readonly origin : string ;
45+ readonly password : string ;
46+ readonly pathname : string ;
47+ readonly port : string ;
48+ readonly protocol : string ;
49+ readonly search : string ;
50+ readonly searchParams: ReadonlyURLSearchParams ;
51+ readonly username : string ;
5252 toString ( ) : string ;
5353 toJSON ( ) : string ;
5454}
You can’t perform that action at this time.
0 commit comments