Skip to content

Commit

Permalink
fix(typings): synchronize types of sqlstring (#3047)
Browse files Browse the repository at this point in the history
* fix: Export types directly from sqlstring dependency

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>

* Revert "fix: Export types directly from sqlstring dependency"

This reverts commit f489a97.

* refactor: Merged similarly shaped format overloads

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>

* fix: Added "hidden" type definitions provided by sqlstring package

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>

* Added header comments

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>

* refactor: moved header comment

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>

* refactor: typing corrections

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>

* fix: Ran prettier

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>

---------

Signed-off-by: Scraps <123112608+ScrapsPrograms@users.noreply.github.com>
  • Loading branch information
ScrapsPrograms authored Sep 14, 2024
1 parent 3d2327d commit 81be01b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions typings/mysql/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* sqlstring types are based on https://www.npmjs.com/package/@types/sqlstring, version 2.3.2
*/
import { Pool as BasePool, PoolOptions } from './lib/Pool.js';
import {
Connection as BaseConnection,
Expand Down Expand Up @@ -53,23 +56,21 @@ export function createPool(config: PoolOptions): BasePool;

export function createPoolCluster(config?: PoolClusterOptions): PoolCluster;

export function escape(value: any): string;

export function escapeId(value: any): string;

export function format(sql: string): string;
export function format(
sql: string,
values: any[],
type TimeZone = 'local' | 'Z' | (string & NonNullable<unknown>);
export function escape(
value: any,
stringifyObjects?: boolean,
timeZone?: string,
timeZone?: TimeZone,
): string;

export function escapeId(value: any, forbidQualified?: boolean): string;

export function format(sql: string): string;
export function format(
sql: string,
values: any,
values: any | any[],
stringifyObjects?: boolean,
timeZone?: string,
timeZone?: TimeZone,
): string;

export function raw(sql: string): {
Expand Down

0 comments on commit 81be01b

Please # to comment.