Skip to content
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

generic-pool should use PromiseLike, not Promise #23846

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions types/generic-pool/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Type definitions for generic-pool 3.1
// Project: https://github.com/coopernurse/node-pool#readme
// Definitions by: Jerray Fu <https://github.com/jerray>
// Will Boyce <https://github.com/wrboyce>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />
Expand All @@ -16,17 +17,17 @@ export class Pool<T> extends EventEmitter {
max: number;
min: number;

acquire(priority?: number): Promise<T>;
acquire(priority?: number): PromiseLike<T>;
release(resource: T): void;
destroy(resource: T): void;
drain(): Promise<undefined>;
clear(): Promise<undefined[]>;
drain(): PromiseLike<undefined>;
clear(): PromiseLike<undefined[]>;
}

export interface Factory<T> {
create(): Promise<T>;
destroy(client: T): Promise<undefined>;
validate?(client: T): Promise<boolean>;
create(): PromiseLike<T>;
destroy(client: T): PromiseLike<undefined>;
validate?(client: T): PromiseLike<boolean>;
}

export interface Options {
Expand Down