Skip to content

Commit

Permalink
default to any instead of extend
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kornelakis authored and CodeFoodPixels committed Apr 29, 2022
1 parent ea3305c commit b457fbb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export interface PoolConfig extends mysql.PoolConfig {
}

export interface QueryFunction {
<T extends any>(query: mysql.Query | string | mysql.QueryOptions): Bluebird<T>;
<T = any>(query: mysql.Query | string | mysql.QueryOptions): Bluebird<T>;

<T extends any>(options: string, values?: any): Bluebird<T>;
<T = any>(options: string, values?: any): Bluebird<T>;
}

export interface Query<T> extends mysql.Query {
Expand All @@ -38,7 +38,7 @@ export interface Query<T> extends mysql.Query {

on(ev: 'fields', callback: (fields: mysql.FieldInfo[], index: number) => void): mysql.Query;

on<T extends any>(ev: 'packet', callback: (packet: T) => void): mysql.Query;
on<T = any>(ev: 'packet', callback: (packet: T) => void): mysql.Query;

on(ev: 'end', callback: () => void): mysql.Query;
}
Expand All @@ -58,7 +58,7 @@ export class Connection {

ping(options?: mysql.QueryOptions): Bluebird<void>;

queryStream<T extends any>(options: string, values?: any): Query<T>;
queryStream<T = any>(options: string, values?: any): Query<T>;

statistics(options?: mysql.QueryOptions): Bluebird<void>;

Expand Down Expand Up @@ -108,7 +108,7 @@ export class Pool {

on(ev: 'enqueue', callback: (err?: mysql.MysqlError) => void): mysql.Pool;

on<T extends any>(ev: string, callback: (...args: T[]) => void): mysql.Pool;
on<T = any>(ev: string, callback: (...args: T[]) => void): mysql.Pool;
}

export class PoolCluster {
Expand All @@ -135,7 +135,7 @@ export class PoolCluster {
/**
* Set handler to be run on a certain event.
*/
on<T extends any>(ev: string, callback: (...args: T[]) => void): PoolCluster;
on<T = any>(ev: string, callback: (...args: T[]) => void): PoolCluster;

/**
* Set handler to be run when a node is removed or goes offline.
Expand Down

0 comments on commit b457fbb

Please sign in to comment.