Skip to content

Commit

Permalink
fix(types): correct TypeCast's Next callback to return unknown (#3129)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bbugh authored Oct 31, 2024
1 parent 4c6e140 commit 401db79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion typings/mysql/lib/Connection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
* }
* ```
Expand Down
2 changes: 1 addition & 1 deletion typings/mysql/lib/parsers/typeCast.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion typings/mysql/lib/protocol/sequences/Query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
* }
* ```
Expand Down

0 comments on commit 401db79

Please sign in to comment.