From 401db79b88cae8731a9eb334e456528134f821f9 Mon Sep 17 00:00:00 2001 From: Brian Bugh <438465+bbugh@users.noreply.github.com> Date: Thu, 31 Oct 2024 12:29:13 -0500 Subject: [PATCH] fix(types): correct TypeCast's Next callback to return unknown (#3129) * fix(types): correctly type Next as unknown Fixes typeCast Next type appears to be incorrect #3122 * Revert fixed type change in txt files * Revert txt to 5c22cf0^ for weird EOF issue --- typings/mysql/lib/Connection.d.ts | 2 +- typings/mysql/lib/parsers/typeCast.d.ts | 2 +- typings/mysql/lib/protocol/sequences/Query.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/typings/mysql/lib/Connection.d.ts b/typings/mysql/lib/Connection.d.ts index 2dabd960fc..6af95e1f7d 100644 --- a/typings/mysql/lib/Connection.d.ts +++ b/typings/mysql/lib/Connection.d.ts @@ -183,7 +183,7 @@ export interface ConnectionOptions { * * You can also specify a function to do the type casting yourself: * ```ts - * (field: Field, next: () => void) => { + * (field: Field, next: () => unknown) => { * return next(); * } * ``` diff --git a/typings/mysql/lib/parsers/typeCast.d.ts b/typings/mysql/lib/parsers/typeCast.d.ts index b8e975148b..7d62b983ad 100644 --- a/typings/mysql/lib/parsers/typeCast.d.ts +++ b/typings/mysql/lib/parsers/typeCast.d.ts @@ -49,6 +49,6 @@ export type Field = Type & { geometry: () => Geometry | Geometry[] | null; }; -export type Next = () => void; +export type Next = () => unknown; export type TypeCast = ((field: Field, next: Next) => any) | boolean; diff --git a/typings/mysql/lib/protocol/sequences/Query.d.ts b/typings/mysql/lib/protocol/sequences/Query.d.ts index 44d6c910c9..34da54c23c 100644 --- a/typings/mysql/lib/protocol/sequences/Query.d.ts +++ b/typings/mysql/lib/protocol/sequences/Query.d.ts @@ -44,7 +44,7 @@ export interface QueryOptions { * * You can also specify a function to do the type casting yourself: * ```ts - * (field: Field, next: () => void) => { + * (field: Field, next: () => unknown) => { * return next(); * } * ```