-
-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript: Pool Cluster Typing Mismatch #1991
Comments
if I’m not mistaken this is the correct type declare class PromisePoolCluster extends EventEmitter {
config: PoolCluster.PoolClusterOptions;
add(config: PoolCluster.PoolClusterOptions): Promise<void>;
add(group: string, config: PoolCluster.PoolClusterOptions): Promise<void>;
end(): Promise<void>;
getConnection(): Promise<PoolConnection>;
getConnection(group: string): Promise<PoolConnection>;
getConnection(group: string): Promise<PoolConnection>;
of(pattern: string, selector?: string): PromisePoolCluster;
on(event: string, listener: Function): this;
on(event: 'remove', listener: (nodeId: number) => void): this;
on(event: 'connection', listener: (connection: PoolConnection) => void): this;
} @sidorares see: |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
After version
I'm closing this Issue, but feel free to ask anything 🙋🏻♂️ |
I am working in a typescript node project and running into a interface mismatch. If you clone https://github.com/JacobBanghart/Mysql2PoolClusterIssue and
npm i
you will see that there are 2 issues with the typings for PoolClusters.First: uri is not a valid as a property to pass.
This can be adjusted by one of 2 ways. Either add the property to PoolOptions or better yet to Connection.ConnectionOptions as an optional property.
Secondly: PoolCluster.of returns a type of PoolCluster which is actually a PoolNamespace.
I can open a pr for these items if you would like.
The text was updated successfully, but these errors were encountered: