File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1- import type { connect as nodeConnect , Socket } from "@arrowood.dev/socket" ;
21import type { connect } from "cloudflare:sockets" ;
32
43export type RedisResponse = Uint8Array | number | null | RedisResponse [ ] ;
@@ -23,7 +22,7 @@ export type RedisConnectionOptions =
2322
2423export type RedisClientOptions = {
2524 tls ?: boolean ;
26- connectFn ?: typeof connect | typeof nodeConnect ;
25+ connectFn ?: typeof connect ;
2726 onReply ?: ( reply : RedisResponse ) => boolean ;
2827} & RedisConnectionOptions ;
2928
@@ -42,8 +41,10 @@ export type Redis = ((
4241 ) => Promise < Buffer | null > ;
4342} ;
4443
44+ export type Socket = ReturnType < typeof connect > ;
45+
4546export interface ConnectionInstance {
46- writer : WritableStreamDefaultWriter < Uint8Array > ;
47- reader : ReadableStreamDefaultReader < Uint8Array > ;
48- socket : Socket | ReturnType < typeof connect > ;
47+ writer : WritableStreamDefaultWriter < any > ;
48+ reader : ReadableStreamDefaultReader < any > ;
49+ socket : Socket ;
4950}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export async function getConnectFn(fn?: RedisClientOptions["connectFn"]) {
1717 "@arrowood.dev/socket"
1818 ) ;
1919
20- return connect ;
20+ return connect as typeof import ( "cloudflare:sockets" ) . connect ;
2121 } catch ( e ) {
2222 throw new Error ( "No socket provider found" ) ;
2323 }
You can’t perform that action at this time.
0 commit comments