diff options
author | Joel Kronqvist <work.joelkronqvist@pm.me> | 2022-03-11 20:46:06 +0200 |
---|---|---|
committer | Joel Kronqvist <work.joelkronqvist@pm.me> | 2022-03-11 20:46:06 +0200 |
commit | 080c5819d87b933816d724a83f3bf4f1686770a7 (patch) | |
tree | 4a2ccc68b27edf7d4cbc586c932cc7542b655e19 /node_modules/mysql2/index.d.ts | |
parent | 5ac7049a9d30733165cc212dee308163c2a14644 (diff) | |
parent | d003b82235a9329f912522a2f70aa950dfce4998 (diff) | |
download | LYLLRuoka-080c5819d87b933816d724a83f3bf4f1686770a7.tar.gz LYLLRuoka-080c5819d87b933816d724a83f3bf4f1686770a7.zip |
Merge branch 'master' of https://github.com/JoelHMikael/FoodJS
Updating remote changes
Diffstat (limited to 'node_modules/mysql2/index.d.ts')
-rw-r--r-- | node_modules/mysql2/index.d.ts | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/node_modules/mysql2/index.d.ts b/node_modules/mysql2/index.d.ts new file mode 100644 index 0000000..a465b43 --- /dev/null +++ b/node_modules/mysql2/index.d.ts @@ -0,0 +1,189 @@ +import { + Connection as PromiseConnection, + Pool as PromisePool, + PoolConnection as PromisePoolConnection +} from './promise'; + +import * as mysql from './typings/mysql'; +export * from './typings/mysql'; + +export interface Connection extends mysql.Connection { + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + sql: string, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields: mysql.FieldPacket[] + ) => any + ): mysql.Query; + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + sql: string, + values: any | any[] | { [param: string]: any }, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields: mysql.FieldPacket[] + ) => any + ): mysql.Query; + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + options: mysql.QueryOptions, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields?: mysql.FieldPacket[] + ) => any + ): mysql.Query; + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + options: mysql.QueryOptions, + values: any | any[] | { [param: string]: any }, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields: mysql.FieldPacket[] + ) => any + ): mysql.Query; + ping(callback?: (err: mysql.QueryError | null) => any): void; + promise(promiseImpl?: PromiseConstructor): PromiseConnection; +} + +export interface PoolConnection extends mysql.PoolConnection, Connection { + promise(promiseImpl?: PromiseConstructor): PromisePoolConnection; +} + +export interface Pool extends mysql.Connection { + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + sql: string, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields: mysql.FieldPacket[] + ) => any + ): mysql.Query; + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + sql: string, + values: any | any[] | { [param: string]: any }, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields: mysql.FieldPacket[] + ) => any + ): mysql.Query; + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + options: mysql.QueryOptions, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields?: mysql.FieldPacket[] + ) => any + ): mysql.Query; + execute< + T extends + | mysql.RowDataPacket[][] + | mysql.RowDataPacket[] + | mysql.OkPacket + | mysql.OkPacket[] + | mysql.ResultSetHeader + >( + options: mysql.QueryOptions, + values: any | any[] | { [param: string]: any }, + callback?: ( + err: mysql.QueryError | null, + result: T, + fields: mysql.FieldPacket[] + ) => any + ): mysql.Query; + getConnection( + callback: (err: NodeJS.ErrnoException, connection: PoolConnection) => any + ): void; + on(event: 'connection', listener: (connection: PoolConnection) => any): this; + on(event: 'acquire', listener: (connection: PoolConnection) => any): this; + on(event: 'release', listener: (connection: PoolConnection) => any): this; + on(event: 'enqueue', listener: () => any): this; + promise(promiseImpl?: PromiseConstructor): PromisePool; +} + +type authPlugins = (pluginMetadata: { + connection: Connection; + command: string; +}) => ( + pluginData: Buffer +) => Promise<string> | string | Buffer | Promise<Buffer> | null; + +export interface ConnectionOptions extends mysql.ConnectionOptions { + charsetNumber?: number; + compress?: boolean; + authSwitchHandler?: (data: any, callback: () => void) => any; + connectAttributes?: { [param: string]: any }; + decimalNumbers?: boolean; + isServer?: boolean; + maxPreparedStatements?: number; + namedPlaceholders?: boolean; + nestTables?: boolean | string; + passwordSha1?: string; + pool?: any; + rowsAsArray?: boolean; + stream?: any; + uri?: string; + connectionLimit?: number; + Promise?: any; + queueLimit?: number; + waitForConnections?: boolean; + authPlugins?: { + [key: string]: authPlugins; + }; +} + +export interface PoolOptions extends mysql.PoolOptions, ConnectionOptions {} + +export function createConnection(connectionUri: string): Connection; +export function createConnection(config: ConnectionOptions): Connection; +export function createPool(config: PoolOptions): Pool; |