From d7a8b0c63991c4ce166b4459f6b31f5c3962b525 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Mon, 5 Feb 2024 13:38:19 +1100 Subject: [PATCH] chore: add missing return types (#447) --- client.ts | 2 +- connection/connection.ts | 6 +++--- query/query.ts | 2 +- query/transaction.ts | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client.ts b/client.ts index 96d01780..40b05b08 100644 --- a/client.ts +++ b/client.ts @@ -52,7 +52,7 @@ export abstract class QueryClient { this.#connection = connection; } - get connected() { + get connected(): boolean { return this.#connection.connected; } diff --git a/connection/connection.ts b/connection/connection.ts index 1764a25b..d25b3616 100644 --- a/connection/connection.ts +++ b/connection/connection.ts @@ -128,17 +128,17 @@ export class Connection { #tls?: boolean; #transport?: "tcp" | "socket"; - get pid() { + get pid(): number | undefined { return this.#pid; } /** Indicates if the connection is carried over TLS */ - get tls() { + get tls(): boolean | undefined { return this.#tls; } /** Indicates the connection protocol used */ - get transport() { + get transport(): "tcp" | "socket" | undefined { return this.#transport; } diff --git a/query/query.ts b/query/query.ts index e58aa85a..b600c7e8 100644 --- a/query/query.ts +++ b/query/query.ts @@ -151,7 +151,7 @@ export class QueryResult { #row_description?: RowDescription; public warnings: Notice[] = []; - get rowDescription() { + get rowDescription(): RowDescription | undefined { return this.#row_description; } diff --git a/query/transaction.ts b/query/transaction.ts index a5088cfd..0e2ae4ce 100644 --- a/query/transaction.ts +++ b/query/transaction.ts @@ -30,7 +30,7 @@ export class Savepoint { this.#update_callback = update_callback; } - get instances() { + get instances(): number { return this.#instance_count; } @@ -142,11 +142,11 @@ export class Transaction { this.#updateClientLock = update_client_lock_callback; } - get isolation_level() { + get isolation_level(): IsolationLevel { return this.#isolation_level; } - get savepoints() { + get savepoints(): Savepoint[] { return this.#savepoints; }