From 05acbae599895a6ff3a2ae5d995bb028ac32ad72 Mon Sep 17 00:00:00 2001 From: Mugi Khan Date: Thu, 12 Dec 2024 16:27:35 +0200 Subject: [PATCH] Better typing and assertions for encryptionKey --- packages/web/src/db/PowerSyncDatabase.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/web/src/db/PowerSyncDatabase.ts b/packages/web/src/db/PowerSyncDatabase.ts index d834c1e4..4cfa6499 100644 --- a/packages/web/src/db/PowerSyncDatabase.ts +++ b/packages/web/src/db/PowerSyncDatabase.ts @@ -6,6 +6,8 @@ import { AbstractPowerSyncDatabase, DBAdapter, DEFAULT_POWERSYNC_CLOSE_OPTIONS, + isDBAdapter, + isSQLOpenFactory, PowerSyncDatabaseOptions, PowerSyncDatabaseOptionsWithDBAdapter, PowerSyncDatabaseOptionsWithOpenFactory, @@ -82,9 +84,7 @@ export type WebPowerSyncDatabaseOptionsWithSettings = WithWebSyncOptions< WithWebFlags> >; -export type WebPowerSyncDatabaseOptions = WithWebSyncOptions< - WithWebFlags> ->; +export type WebPowerSyncDatabaseOptions = WithWebSyncOptions>; export const DEFAULT_POWERSYNC_FLAGS: Required = { ...DEFAULT_WEB_SQL_FLAGS, @@ -99,6 +99,20 @@ export const resolveWebPowerSyncFlags = (flags?: WebPowerSyncFlags): Required