@@ -4,14 +4,14 @@ import type { Action, AnyAction, Log, Meta } from '../log/index.js'
4
4
import type { LoguxError , LoguxErrorOptions } from '../logux-error/index.js'
5
5
6
6
interface Authenticator < Headers extends object > {
7
- ( nodeId : string , token : string , headers : { } | Headers ) : Promise < boolean >
7
+ ( nodeId : string , token : string , headers : Headers | object ) : Promise < boolean >
8
8
}
9
9
10
10
export interface ActionFilter {
11
- ( action : Action , meta : Meta ) :
12
- | [ Action , Meta ]
13
- | false
14
- | Promise < [ Action , Meta ] | false >
11
+ (
12
+ action : Action ,
13
+ meta : Meta
14
+ ) : [ Action , Meta ] | false | Promise < [ Action , Meta ] | false >
15
15
}
16
16
17
17
interface EmptyHeaders {
@@ -78,7 +78,6 @@ export abstract class Connection {
78
78
disconnect ( reason ?: 'destroy' | 'error' | 'timeout' ) : void
79
79
on ( event : 'disconnect' , listener : ( reason : string ) => void ) : Unsubscribe
80
80
on ( event : 'error' , listener : ( error : Error ) => void ) : Unsubscribe
81
-
82
81
/**
83
82
* Subscribe for connection events. It implements nanoevents API.
84
83
* Supported events:
@@ -97,7 +96,6 @@ export abstract class Connection {
97
96
event : 'connect' | 'connecting' | 'disconnect' ,
98
97
listener : ( ) => void
99
98
) : Unsubscribe
100
-
101
99
on ( event : 'message' , listener : ( msg : Message ) => void ) : Unsubscribe
102
100
103
101
/**
@@ -108,7 +106,7 @@ export abstract class Connection {
108
106
send ( message : Message ) : void
109
107
}
110
108
111
- export interface NodeOptions < Headers extends object = { } > {
109
+ export interface NodeOptions < Headers extends object = object > {
112
110
/**
113
111
* Function to check client credentials.
114
112
*/
@@ -177,8 +175,8 @@ export interface NodeOptions<Headers extends object = {}> {
177
175
* are based on this module.
178
176
*/
179
177
export class BaseNode <
180
- Headers extends object = { } ,
181
- NodeLog extends Log = Log < Meta >
178
+ Headers extends object = object ,
179
+ NodeLog extends Log = Log
182
180
> {
183
181
/**
184
182
* Did we finish remote node authentication.
@@ -369,12 +367,10 @@ export class BaseNode<
369
367
destroy ( ) : void
370
368
371
369
on ( event : 'headers' , listener : ( headers : Headers ) => void ) : Unsubscribe
372
-
373
370
on (
374
371
event : 'clientError' | 'error' ,
375
372
listener : ( error : LoguxError ) => void
376
373
) : Unsubscribe
377
-
378
374
/**
379
375
* Subscribe for synchronization events. It implements nanoevents API.
380
376
* Supported events:
@@ -401,7 +397,6 @@ export class BaseNode<
401
397
event : 'connect' | 'debug' | 'headers' | 'state' ,
402
398
listener : ( ) => void
403
399
) : Unsubscribe
404
-
405
400
on (
406
401
event : 'debug' ,
407
402
listener : ( type : 'error' , data : string ) => void
0 commit comments