@@ -15,7 +15,10 @@ import { ClientClosedError, DisconnectsClientError, AuthError } from '../errors'
15
15
import { URL } from 'url' ;
16
16
import { TcpSocketConnectOpts } from 'net' ;
17
17
18
- export interface RedisClientOptions < M extends RedisModules , S extends RedisScripts > extends RedisPlugins < M , S > {
18
+ export interface RedisClientOptions <
19
+ M extends RedisModules = Record < string , never > ,
20
+ S extends RedisScripts = Record < string , never >
21
+ > extends RedisPlugins < M , S > {
19
22
url ?: string ;
20
23
socket ?: RedisSocketOptions ;
21
24
username ?: string ;
@@ -73,8 +76,10 @@ export type WithScripts<S extends RedisScripts> = {
73
76
[ P in keyof S as ExcludeMappedString < P > ] : RedisClientCommandSignature < S [ P ] > ;
74
77
} ;
75
78
76
- export type RedisClientType < M extends RedisModules , S extends RedisScripts > =
77
- RedisClient < M , S > & WithCommands & WithModules < M > & WithScripts < S > ;
79
+ export type RedisClientType <
80
+ M extends RedisModules = Record < string , never > ,
81
+ S extends RedisScripts = Record < string , never >
82
+ > = RedisClient < M , S > & WithCommands & WithModules < M > & WithScripts < S > ;
78
83
79
84
export type InstantiableRedisClient < M extends RedisModules , S extends RedisScripts > =
80
85
new ( options ?: RedisClientOptions < M , S > ) => RedisClientType < M , S > ;
@@ -112,10 +117,10 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
112
117
return new ( RedisClient . extend ( options ) ) ( options ) ;
113
118
}
114
119
115
- static parseURL ( url : string ) : RedisClientOptions < Record < string , never > , Record < string , never > > {
120
+ static parseURL ( url : string ) : RedisClientOptions {
116
121
// https://www.iana.org/assignments/uri-schemes/prov/redis
117
122
const { hostname, port, protocol, username, password, pathname } = new URL ( url ) ,
118
- parsed : RedisClientOptions < Record < string , never > , Record < string , never > > = {
123
+ parsed : RedisClientOptions = {
119
124
socket : {
120
125
host : hostname
121
126
}
0 commit comments