types: compact receiver hovers via public aliases#3248
Merged
Conversation
156694b to
97aaa29
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 97aaa29. Configure here.
PavelPashov
approved these changes
May 21, 2026
|
|
||
| export function createClientPool(): RedisDefaultClientPoolType; | ||
| export function createClientPool( | ||
| clientOptions: Omit<RedisClientOptions, "clientSideCache">, |
Contributor
There was a problem hiding this comment.
Should we make this optional as they were before?
Collaborator
Author
There was a problem hiding this comment.
they are optional, first overload doesnt have options. but nvm, im reverting to more simple state without overloads
| RESP extends RespVersions = RedisDefaultRESP, | ||
| TYPE_MAPPING extends TypeMapping = RedisDefaultTypeMapping | ||
| >( | ||
| clientOptions: Omit<RedisClientOptions<M, F, S, RESP, TYPE_MAPPING>, "clientSideCache">, |
Contributor
There was a problem hiding this comment.
Should we make this optional as they were before?
97aaa29 to
afc1452
Compare
Move the RedisDefaultModules & M intersection into the Redis*Type alias
bodies and switch RedisDefaultModules to an interface so create*() hovers
as Redis*Type<…> instead of expanding to GenericRedis*Type<RedisDefaultModules
& M, …>. Finish the RESP=3 defaults master's Default Resp3 PR didn't reach
(Pool/Cluster + create* generics) and give every create* generic
`= {}` / `= 3` defaults.
@redis/client: rename and export InternalRedisClientMultiCommandType as
RedisClientMultiCommandTyped so chained multi hovers stay named.
afc1452 to
75ce623
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Introduces public
RedisDefault*aliases (Modules,Functions,Scripts,RESP=3,TypeMapping)plus named
RedisDefault{Client,ClientPool,Cluster,Sentinel}Typealiases.Each
create*function gains non-generic overloads that returnthe named default type when no custom modules are supplied;
The generic overload is preserved (with named-alias defaults for F/S/RESP/TYPE_MAPPING)
so custom-M callers keep inferred types and RESP stays pinned at 3.
No visible performance implications for ts compilation
Before:


After:
--
Checklist
npm testpass with this change (including linting)?Note
Medium Risk
Type-level refactors in the public
packages/redissurface and multi-command typing could change downstream TypeScript inference/hover output, but should not affect runtime behavior.Overview
Improves public TypeScript aliases and inference for Redis Stack clients. The PR introduces a public
RedisClientMultiCommandTypedalias (replacing an internal-only type) so multi/pipeline command chaining exposes cleaner, reusable typed signatures.In
packages/redis, default module typing is reworked so exportedRedisClientType/RedisClientPoolType/RedisClusterType/RedisSentinelTypealways includeRedisDefaultModuleswhile still allowing callers to extend with custom modules. ThecreateClient/createClientPool/createCluster/createSentinelgenerics are updated to default to empty custom modules and RESP=3, and their return types are cast to the new exported aliases.Reviewed by Cursor Bugbot for commit 75ce623. Bugbot is set up for automated code reviews on this repo. Configure here.