Skip to content

Commit 3dd7f25

Browse files
authored
fix(pg): make the tests pass again (DefinitelyTyped#72923)
1 parent a02b352 commit 3dd7f25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

types/pg/lib/type-overrides.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ declare enum builtins {
6363
REGROLE = 4096,
6464
}
6565
type TypeId = builtins;
66-
type TypeParser<I extends (string | Buffer), T> = (value: I) => T;
66+
type TypeParser<TOid = number, TReturn = any> = (oid: TOid) => TReturn;
67+
type TypeFormat = 'text' | 'binary';
6768

6869
export = TypeOverrides;
6970
declare class TypeOverrides implements CustomTypesConfig {
@@ -72,6 +73,5 @@ declare class TypeOverrides implements CustomTypesConfig {
7273
setTypeParser<T>(oid: number | TypeId, format: "text", parseFn: TypeParser<string, T>): void;
7374
setTypeParser<T>(oid: number | TypeId, format: "binary", parseFn: TypeParser<Buffer, T>): void;
7475

75-
getTypeParser<T>(oid: number | TypeId, format?: "text"): TypeParser<string, T | string>;
76-
getTypeParser<T>(oid: number | TypeId, format: "binary"): TypeParser<Buffer, T | string>;
76+
getTypeParser<T>(oid: number | TypeId, format?: TypeFormat): TypeParser;
7777
}

0 commit comments

Comments
 (0)